Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

(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

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

Recommended Textbook for

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

7. It is advisable to do favors for people whenever possible.

Answered: 1 week ago