Question: 1. Fill in a missing clause to complete the statement below so it returns the sum of invoice total of each year. SELECT year(InvoiceDate), sum(InvoiceTotal)

1. Fill in a missing clause to complete the statement below so it returns the sum of invoice total of each year.

SELECT year(InvoiceDate), sum(InvoiceTotal) as YearlyTotal FROM Invoices ________________;

2. Complete the 2nd statement so it returns the same as the first statement given below.

SELECT VendorID, VendorState FROM Vendors WHERE not exists (SELECT * FROM Invoices WHERE VendorID = Vendors.VendorID);

SELECT v.VendorID, VendorState FROM Vendors v ________ outer join Invoices i on v.VendorID = i.VendorID WHERE i.InvoiceID ______ null;

3. Suppose Product is a table with three coulmns: PID, Pname, and Price. Complete the statement below so no prices can below zero. Prices already exists in the table should be ignored and not validated by this statement.

_______ TABLE Product WITH ________ _______ CONSTRAINT c101 __________ (Price >= 0);

4. To switch the execution context from a login 'shark' back to the original login, we need to execute a _________ statement.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!