1/9
Looks like no tags are added yet.
Which of the following statements is true when you use MySQL Workbench to run INSERT, UPDATE, and DELETE statements?
By default, the changes are automatically committed to the database.
If autocommit mode is on, you can rollback the changes by clicking on the Rollback button.
If autocommit mode is on, you can commit the changes by clicking on the Commit button.
By default, the changes are rolled back when you exit MySQL Workbench unless you commit them.
By default, the changes are automatically committed to the database.
Assuming that all of the table and column names are spelled correctly, what's wrong with the INSERT statement that follows? INSERT INTO invoices (vendor_id, invoice_number, invoice_total, payment_total, credit_total, terms_id, invoice_date, invoice_due_date) VALUES (97, '456789', 8344.50, 0, 0, 1, '2012-08-31')
The column names in the column list are in the wrong sequence.
All of the values should be enclosed by single quotes.
There are too many items in the VALUES list.
The number of items in the column list doesn't match the number in the VALUES list.
The number of items in the column list doesn't match the number in the VALUES list.
Which of the following statements best describes what this INSERT statement does? INSERT INTO invoices_copy SELECT * FROM invoices WHERE terms_id = 1
Adds one row from the Invoices table to the Invoices_Copy table.
Adds all of the rows in the Invoices table that have 1 in the terms_id column to the Invoices_Copy table.
Adds all of the rows in the Invoices table to the Invoices_Copy table and sets the terms_id column to 1 in each row.
Updates all of the rows in the Invoices_Copy table that have 1 in the terms_id column to the rows in the Invoices table.
Adds all of the rows in the Invoices table that have 1 in the terms_id column to the Invoices_Copy table.
Which of the following statements best describes what this UPDATE statement does? UPDATE invoices SET credit_total = invoice_total - payment_total WHERE vendor_id = 10 AND invoice_total - payment_total - credit_total > 0
Updates the credit_total column for all invoices with a balance due so they don't have a balance due.
Updates the credit_total column for the first invoice with 10 in the vendor_id column and a balance so it doesn't have a balance due.
Updates the credit_total column for all invoices with 10 in the vendor_id column and a balance due so they don't have a balance due.
Updates the credit_total column for all invoices with a balance due so they don't have a balance due.
Updates the credit_total column for all invoices with 10 in the vendor_id column and a balance due so they don't have a balance due.
Which of the following statements about creating a table using the CREATE TABLE AS statement with a SELECT statement is not true?
The table must not exist.
Each column name in the SELECT clause must be unique.
You can include any of the clauses of the SELECT statement.
The definitions of primary keys, foreign keys, and indexes are included in the new table.
The definitions of primary keys, foreign keys, and indexes are included in the new table.
Code example 5-1 team_id INT NOT NULL AUTO_INCREMENT, team_name VARCHAR(50), team_rank INT NOT NULL DEFAULT 0
(Refer to code example 5-1.) What are the values of the team_id, team_name, and team_rank columns after the following statement is executed, assuming that the Teams table has one row in it with a team_id of 1? INSERT INTO teams VALUES (DEFAULT, NULL, 3)
0, NULL, 0
2, NULL, 1
0, NULL, 3
2, NULL, 3
2, NULL, 3
Code example 5-1 team_id INT NOT NULL AUTO_INCREMENT, team_name VARCHAR(50), team_rank INT NOT NULL DEFAULT 0
(Refer to code example 5-1.) What are the values of the team_id, team_name, and team_rank columns after the following statement is executed, assuming that the Teams table has one row in it with a team_id of 1? INSERT INTO teams (team_name) VALUES ('Angels')
2, Angels, 0
2, Angels, 1
1, Angels, 0
1, Angels, 1
2, Angels, 0
When you use a subquery to insert rows from one table into another table, which of the following statements is not true?
The target table must already exist.
You must omit the column list from the INSERT statement.
You must omit the VALUES clause from the INSERT statement.
You must include a SELECT statement that retrieves the rows to be inserted.
You must omit the column list from the INSERT statement.
Which of the following statements would you use to change the invoice_total value in the Invoices table so it's 1% less than the current invoice total for every vendor in the state of Arizona?
UPDATE invoices SET invoice_total = invoice_total - (invoice_total * .01) WHERE vendor_id IN (SELECT vendor_id FROM vendors WHERE vendor_state = 'AZ')
UPDATE invoices SET invoice_total = invoice_total * .01 WHERE vendor_id IN (SELECT vendor_id FROM vendors WHERE vendor_state = 'AZ')
UPDATE invoices SET invoice_total = invoice_total - (invoice_total * .01) WHERE vendor_id = (SELECT vendor_id FROM vendors WHERE vendor_state = 'AZ')
UPDATE invoices SET invoice_total = invoice_total * .01 WHERE vendor_id = (SELECT vendor_id FROM vendors WHERE vendor_state = 'AZ')
UPDATE invoices SET invoice_total = invoice_total - (invoice_total * .01) WHERE vendor_id IN (SELECT vendor_id FROM vendors WHERE vendor_state = 'AZ')
Before you can delete a row that has related rows in another table, you should
turn safe mode off
change all of the related rows so they point to a row other than the one you want to delete
delete the related rows
delete the related table
delete the related rows