CSC 345 Lab 5-1
Task 1: For each invoice, list the invoice number and invoice date along with the ID,
first name, and last name of the customer for which the invoice was created.
SELECT INVOICE_NUM, INVOICE_DATE, CUSTOMER.CUST_ID, FIRST_NAME,
LAST_NAME
FROM INVOICES, CUSTOMER
WHERE INVOICES.CUST_ID = CUSTOMER.CUST_ID;
Task 2: For each invoice placed on November 15, 2021, list the invoice number along
with the ID, first name, and last name of the customer for which the invoice was created.
SELECT INVOICE_NUM, CUSTOMER.CUST_ID, FIRST_NAME, LAST_NAME
FROM INVOICES, CUSTOMER
WHERE (INVOICES.CUST_ID = CUSTOMER.CUST_ID) AND (INVOICE_DATE =
"2021-11-15");
Task 3: For each invoice, list the invoice number, invoice date, item ID, quantity
ordered, and quoted price for each invoice line that makes up the invoice.
SELECT INVOICES.INVOICE_NUM, INVOICE_DATE, ITEM_ID, QUANTITY,
QUOTED_PRICE
FROM INVOICES, INVOICE_LINE
WHERE (INVOICES.INVOICE_NUM = INVOICE_LINE.INVOICE_NUM);
Task 4: Use the IN operator to find the ID, first name, and last name of each customer
for which as invoice was created on November 15, 2021.
SELECT CUST_ID, FIRST_NAME, LAST_NAME
FROM CUSTOMER
WHERE CUST_ID IN (SELECT CUST_ID
FROM INVOICES
WHERE INVOICE_DATE = "2021-11-15");
Task 5: Repeat Task 4, but this time use the EXISTS operator in your answer.
SELECT CUST_ID, FIRST_NAME, LAST_NAME
FROM CUSTOMER
WHERE EXISTS (SELECT *
FROM INVOICES
WHERE (INVOICES.CUST_ID = CUSTOMER.CUST_ID)
AND (INVOICE_DATE = "2021-11-15"));
Task 6: Find the ID, first name, and last name of each customer for which an invoice
was not created on November 15, 2021.
SELECT CUST_ID, FIRST_NAME, LAST_NAME
FROM CUSTOMER

No comments found.
Login to post a comment

jordancarter 6 months ago

This study guide is clear, well-organized, and covers all the essential topics. The explanations are concise, making complex concepts easier to understand. It could benefit from more practice questions, but overall, it's a great resource for efficient studying. Highly recommend!
Login to review this item
Q. What will I receive when I purchase this document?
A. You will receive a PDF that is available for instant download upon purchase. The document will be accessible to you at any time, from anywhere, and will remain available indefinitely through your profile.
Q. Satisfaction guarantee: how does it work?
A. Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Q. Who am I buying these notes from?
A. you are buying this document from us learnexams
Q. Will I be stuck with a subscription?
A. No, you only buy these notes for $ indicated . You are not obligated to anything after your purchase.
Q. Can learnexams be trusted?
A. check our reviews at trustpilot
Price $11.50
Add To Cart

Buy Now
Category Study Material
Comments 0
Rating
Sales 0

Buy Our Plan

We have

The latest updated Study Material Bundle with 100% Satisfaction guarantee

Visit Now
{{ userMessage }}
Processing