Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

help 1. This query will show the Vendors and their balance due Write a SELECT statement that shows four columns by joining Vendors and Invoices

help
image text in transcribed
1. This query will show the Vendors and their balance due Write a SELECT statement that shows four columns by joining Vendors and Invoices VendorName (Vendors table) InvoiceNumber (Invoices table) InvoiceDate (Invoices table) Balance (InvoiceTotal -PaymentTotal-CreditTotal) Sort the result by VendorName in ascending order 2. Write a query that shows the names of the Vendors who have zero Balance. Use \#1 as a starting point and add a WHERE clause. 3. Write a SELECT statement that shows three columns: VendorName, the DefaultAccountNo of all Vendors and AccountDescription. Which two tables do you have to join? Order the result set by the AccountDescription column. 4. Write a query to show the names of the vendors who have a default account description of Freight or Computer Equipment. Use \#3 as a starting point and add a WHERE clause. 5. Write a SELECT statement that shows two columns: InvoiceNumber and InvoiceSequence, by joining the Invoices and InvoiceLineltems tables. Use this join as a starting point for the next two queries. a. Write a query such that the result looks like the following table: \begin{tabular}{|l|l|l|} \hline & Invicellember & mroce Sequence \\ 1 & im271001 & 4 \\ 2 & 17271001 & 3 \\ 3 & 97522 & 2 \\ 4 & 17271001 & 2 \end{tabular} b. Write a query to show only those Invoices that have not been paid. There are multiple ways to do this-it depends on how you determine that the Invoices are unpaid. Show only columns that are relevant to the query. 6. Write a query that shows the balance due for each Invoice and the number of days given to pay off each invoice. Which two tables do you have to join? Show only columns that are relevant to the query. Show only those Invoices that have a balance greater than 0 . Sort in a way that makes sense. 1. This query will show the Vendors and their balance due Write a SELECT statement that shows four columns by joining Vendors and Invoices VendorName (Vendors table) InvoiceNumber (Invoices table) InvoiceDate (Invoices table) Balance (InvoiceTotal -PaymentTotal-CreditTotal) Sort the result by VendorName in ascending order 2. Write a query that shows the names of the Vendors who have zero Balance. Use \#1 as a starting point and add a WHERE clause. 3. Write a SELECT statement that shows three columns: VendorName, the DefaultAccountNo of all Vendors and AccountDescription. Which two tables do you have to join? Order the result set by the AccountDescription column. 4. Write a query to show the names of the vendors who have a default account description of Freight or Computer Equipment. Use \#3 as a starting point and add a WHERE clause. 5. Write a SELECT statement that shows two columns: InvoiceNumber and InvoiceSequence, by joining the Invoices and InvoiceLineltems tables. Use this join as a starting point for the next two queries. a. Write a query such that the result looks like the following table: \begin{tabular}{|l|l|l|} \hline & Invicellember & mroce Sequence \\ 1 & im271001 & 4 \\ 2 & 17271001 & 3 \\ 3 & 97522 & 2 \\ 4 & 17271001 & 2 \end{tabular} b. Write a query to show only those Invoices that have not been paid. There are multiple ways to do this-it depends on how you determine that the Invoices are unpaid. Show only columns that are relevant to the query. 6. Write a query that shows the balance due for each Invoice and the number of days given to pay off each invoice. Which two tables do you have to join? Show only columns that are relevant to the query. Show only those Invoices that have a balance greater than 0 . Sort in a way that makes sense

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

PostgreSQL 10 High Performance Expert Techniques For Query Optimization High Availability And Efficient Database Maintenance

Authors: Ibrar Ahmed ,Gregory Smith ,Enrico Pirozzi

3rd Edition

1788474481, 978-1788474481

More Books

Students also viewed these Databases questions