Question: SQL (a) Write a SELECT command that returns the vendor name, the invoice id, the invoice sequence number, and the line item amount for each

SQL

SQL (a) Write a SELECT command that returns the vendor name, the

invoice id, the invoice sequence number, and the line item amount for

(a) Write a SELECT command that returns the vendor name, the invoice id, the invoice sequence number, and the line item amount for each invoice that would list more than one item. While using a subquery that tests for an invoice sequence number > 1 will be holpful, the command will require joins as woll (b) Then write two result dataset rows of sample data that might be retrieved by the query. What is actually retrieved depends on what is in the table. The data you write does not have to match any data that is actually in our sample tables See the table structure shown below. Table: invoices Nullable Default Data Constraint Column Name ata Type invoice id vendor_id invoice_n invoice date invoice total number(9,2) payment total number(9,2) credit total terms id invoice due date date payment _date date PK FK No number varchar2(50) date No number(9,2) Yes No No FK Table: invoice line items Column Name invoice i Nullable Default Data Constraint No No Data Type NUMBER PK,FK PK FK sequence NUMBER account number NUMBER line item amt line item description VARCHAR2(100) No NUMBER(9,2) No Table:vendors Column Name Nullable Default Data No Data Type Constraint vendor name vendor address1 vendor address2 vendor city vendor_state vendor_zip_code vendor ohone UNIQUE varchar2(50) No varchar2(50) Yes varchar2(50) Yes varchar2(50) No char(2) varchar2(20) No varchar2iSO) Yes No

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!