Question

Display the VendorName, the InvoiceTotal, and the InvoiceLineItemDescription for all invoices that have an InvoiceTotal less...

Display the VendorName, the InvoiceTotal, and the InvoiceLineItemDescription for all invoices that have an InvoiceTotal less than $1,000 and the InvoiceLineItemDescription is the same as the AccountDescription. Display in InvoiceTotal order from smallest to largest. Use the alias LineItems for the InvoiceLineItems table. The correct solution has 42 rows. Show the full query and all the rows.

Homework Answers

Answer #1

Since you have not provided the db schema which contains the table description along with column names, I am providing the query by guessing the table/column names. Hence, the query might need some changes in order to run properly. Feel free to reach out in case of any concerns.

QUERY:

SELECT v.VendorName, i.InvoiceTotal, LineItems.AccountDescription FROM Vendor v JOIN Invoice i ON v.VendorID = i.VendorID JOIN InvoiceLineItems LineItems ON i.InvoiceID = LineItems.InvoiceID WHERE i.InvoiceTotal < 1000 ORDER BY i.InvoiceTotal;

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Open the World database on MySQL. Write the SQL code to display the name and population...
Open the World database on MySQL. Write the SQL code to display the name and population of all cities that meet two conditions: a.) the city has a population more than 100,000; and b.) the city name has (anywhere) the letter a followed by any character followed by the letter z. Use a regular expression for the second condition. Sequence the query results in descending order by population. What is the city with the largest population in the output?
EMPLOYEE Field Name EMP_ID EMP_LNAME EMP_MI EMP_FNAME EMP_SEX EMP_AGE EMP_SALARY EMP_HIREDATE DEPT_CODE Table: DEPARTMENT DEPT_CODE BIOL...
EMPLOYEE Field Name EMP_ID EMP_LNAME EMP_MI EMP_FNAME EMP_SEX EMP_AGE EMP_SALARY EMP_HIREDATE DEPT_CODE Table: DEPARTMENT DEPT_CODE BIOL CPTR HIST MATH RELB Data Type Text Text Text Text Text Number Currency Date/Time Text DEPT_TITLE Biology Computer Science History Mathematics Religion    Field Name DEPT_CODE DEPT_TITLE Data Type Text Text INSTRUCTIONS Use SQL commands to create the tables and enter the data shown above using MS Access. Write the following SQL statement given below: 1. 2. 3. 4. 5. 6. 7. 8. 9....
Introduction to Database Oracle Assingment Use any table of your choice for solving 1. Display all...
Introduction to Database Oracle Assingment Use any table of your choice for solving 1. Display all the information of the EMP table? 2. Display unique Jobs from EMP table? 3. List the emps in the asc order of their Salaries? 4. List the details of the emps in asc order of the Dptnos and desc of Jobs? 5. Display all the unique job groups in the descending order? 6. Display all the details of all ‘Mgrs’ 7. List the emps...
Write a SQL statement which joins the parts table with the supplier table and lists the...
Write a SQL statement which joins the parts table with the supplier table and lists the part_name, supplier_name for all parts in the part table. The supplier_id column in the suppliers table is the primary key in the suppliers table, and this key has been exported to the parts table where it is a foreign key. You should use an inner join for this query. Write a SQL statement which joins the parts table with the suppliers table and lists...
Suppose all the employees got promoted on January 1, 2000. Write an SQL query that will...
Suppose all the employees got promoted on January 1, 2000. Write an SQL query that will output first name, last name, salary, department and date (in a specific format) columns from the Employees table. The first column will be the employee’s first name, the second column will be the employee’s last name, the third column will be the current salary and the fourth column will show the 'Updated salary' of the employees. The updated salary column will be calculated as...
Using mySQL, tables at the end... This assignment uses the tables from the vets database. The...
Using mySQL, tables at the end... This assignment uses the tables from the vets database. The goal of the assignment is to get you to think about joins- inner join and outer joins.  If you do a join, where you have the names of two or more tables in the From clause, then you must use the condition join syntax or the column name join. Take care that you do not accidentally do a Cartesian product. If your result set contains...
Which query lists all products with a total quantity sold less than the average quantity sold?...
Which query lists all products with a total quantity sold less than the average quantity sold? Select one: a. SELECT P_CODE, SUM(LINE_UNITS) AS TOTALUNITS FROM LINE GROUP BY P_CODE HAVING SUM(LINE_UNITS) < AVG(LINE_UNITS); b. SELECT P_CODE, AVG(LINE_UNITS) AS TOTALUNITS FROM LINE GROUP BY P_CODE HAVING AVG(LINE_UNITS) < (SELECT AVG(LINE_UNITS) FROM LINE); c. SELECT P_CODE, SUM(LINE_UNITS) AS TOTALUNITS FROM LINE GROUP BY P_CODE HAVING SUM(LINE_UNITS) < (SELECT AVG(LINE_UNITS) FROM LINE); d. SELECT P_CODE, SUM(LINE_UNITS) AS TOTALUNITS FROM LINE GROUP BY P_CODE...
I'm really struggling with these homework questions it's mainly 1 and 2, so if you can't...
I'm really struggling with these homework questions it's mainly 1 and 2, so if you can't help with all then please just one and two I've spent hours on those two and can't seem to get past them. SQL That being said, if you could help with these 5 I would very much appreciate it: INVOICES(table) Columns INVOICE_ID VENDOR_ID INVOICE_NUMBER INVOICE_DATE INVOICE_TOTAL PAYMENT_TOTAL CREDIT_TOTAL TERMS_ID INVOICE_DUE_DATE PAYMENT_DATE VENDORS(table) Columns VENDOR_ID VENDOR_NAME VENDOR_ADDRESS1 VENDOR_ADDRESS2 VENDOR_CITY VENDOR_STATE VENDOR_ZIP_CODE VENDOR_PHONE DEFAULT_TERMS_ID DEFAULT_ACCOUNT_NUMBER GENERAL_LEDGER_ACCOUNTS(table)...
1) Write SQL to return the first and last name of all actors with a first...
1) Write SQL to return the first and last name of all actors with a first name of "ADAM" (use the ACTOR table) who have: (a) an ID of 11, 16, or greater than or equal to 70 AND (b) a last name that starts with the letter H or higher (I, J, K, etc.) 2) Write SQL with the LIKE operator to return addresses that are in the "Dhaka" district and have street addresses that do not contain the...
Class-In Assignment 3: Chapters 4&5 How to retrieve data from two or more tables Exercises 1....
Class-In Assignment 3: Chapters 4&5 How to retrieve data from two or more tables Exercises 1. Write a SELECT statement that returns all columns from the Vendors table inner-joined with all columns from the Invoices table. 2. Write a SELECT statement that returns four columns: vendor_name vendor_name from the Vendors table invoice_number invoice_number from the Invoices table invoice_date invoice_date from the Invoices table balance_due invoice_total minus payment_total minus credit_total from the Invoices table The result set should have one row...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT