Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

that Problems 5-9 may refer to the invoice_id created in Problem 4: you can get that by visually ipect the invoice_id created in the query

image text in transcribedimage text in transcribed

that Problems 5-9 may refer to the invoice_id created in Problem 4: you can get that by visually ipect the invoice_id created in the query for Problem 4. To test whether a table has been modified correctly as you do these exercises, you can write and run an appropriate SELECT statement. Or, when you're using MySQL Workbench, you can right-click on a table name in the Object Browser window and select the Select Rows - Limit 1000 command to display the data for the table in a Result tab. To refresh the data in this tab after modifying the table data, click the Refresh button in the toolbar at the top of the tab. 1. Write an INSERT statement that adds this row to the Terms table: \( \begin{array}{ll}\text { terms_id: } & 6 \\ \text { terms_description: } & \text { Net due } 120 \text { days } \\ \text { terms_due_days: } & 120\end{array} \) Use MySQL Workbench to review the column definitions for the Terms table, and include a column list with the required columns in the INSERT statement. 2. Write an UPDATE statement that modifies the row you just added to the Terms table. This statement should change the terms_description column to "Net due 125 days", and it should change the terms_due_days column to 125 . 3. Write a DELETE statement that deletes the row you added to the Terms table in exercise 1. 4. Write an INSFRT statement that adds this row to the Invoices table: tically generated ID Write this statement without using a column list. 5. Write an INSERT statement that adds these rows to the Invoice_Line_Items table: rver update Set the invoice_id column of these two rows to the invoice ID that was generated by MySQL for the invoice you added in exercise 4. 6. Write an UPDATE statement that modifies the invoice you added in exercise 4. This statement should change the credit_total column so it's 10% of the invoice_total column, and it should change the payment_total column so the sum of the payment_total and credit_total columns are equal to the invoice_total column. 7. Write an UPDATE statement that modifies the Vendors table. Change the default_account_number column to 403 for the vendor with an ID of 44 . 8. Write an UPDATE statement that modifies the Invoices table. Change the terms_id column to 2 for each invoice that's for a vendor with a default_terms_id of 2 . 9. Write a DELETE statement that deletes the row that you added to the Invoices table in exercise 4. When you execute this statement, it will produce an error since the invoice has related rows in the Invoice_Line_Items table. To fix that, precede the DELETE statement with another DELETE statement that deletes the line items for this invoice. (Remember that to code two or more statements in a script, you must end each statement with a semicolon.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions