Before you start:InstallSQL, Workbench, and text book files in your environment.DB used for this activity is:apConnect to a DB server, then use the ap DB.View the data in the vendors table. take a...











  1. Before you start:InstallSQL, Workbench, and text book files in your environment.


    DB used for this activity is:ap







    1. Connect to a DB server, then use the ap DB.

    2. View the data in the vendors table. take a snapshot of the result (name: youName-Lab2a)

    3. What is the primary key column in the vendors table?

    4. Write a SELECT statement that returns three columns from the Vendors table:vendor_name, vendor_contact_last_name, and vendor_contact_first_name.Then, run this statement to make sure it works correctlySubmit the SQL code name it: youName-Lab2-SQL1)

    5. Write a SELECT statement that returns these three columns from the Vendors table:vendor_name, The vendor_name column from the Vendors tabledefault_account, The default_account_number column from the Vendors tabledescription The account_description column from the General_Ledger_Accounts tableSort the result set by account_description and then by vendor_nameThis should return 122 rows. Submit the SQL code name it : youName-Lab2-SQL2)

    6. Write an INSERT statement that adds this row to the Invoices table:


    invoice_id:The next automatically generated ID


    vendor_id:32


    invoice_number:AX-014-027


    invoice_date:8/1/2018


    invoice_total:$434.58


    payment_total:$0.00


    credit_total:$0.00


    terms_id:2


    invoice_due_date:8/31/2018


    payment_date:null


    Submit the SQL codename it:youName-Lab2-SQL3
    )











    1. Write an UPDATE statement that modifies the invoice you added in exercise 6. 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.Submit the SQL code name it: youName-Lab2-SQL4)

    2. Write a DELETE statement that deletes the row that you added to the Invoices table in exercise 6. 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.)

    3. Submit the SQL code name it: youName-Lab2-SQL5)










Nov 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here