0% found this document useful (0 votes)
34 views2 pages

Done

The document contains 10 SQL queries: 1. Lists customer codes and addresses from the customer table. 2. Lists product names and quantities from the product table. 3. Lists product codes and names where the quantity is greater than 500. 4. Finds the customer code and invoice date for a customer with an address in Nam Dinh.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views2 pages

Done

The document contains 10 SQL queries: 1. Lists customer codes and addresses from the customer table. 2. Lists product names and quantities from the product table. 3. Lists product codes and names where the quantity is greater than 500. 4. Finds the customer code and invoice date for a customer with an address in Nam Dinh.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

List customer codes and customer addresses in the customer table

π CustomerID, CustomerAddress(Customers)

2. List the product name and product quantity in the product table

π ProductName, NumInStock(Products)

3. List product codes and product names with a quantity of products in stock
greater than 500 products.

σ NumInStock >500 (π ProductID, NumName(Products))

4. Find out the customer code and Invoice date of the customer with an address
in Nam Dinh.

π CustomerID, DateInvoice (σ CustomerAddress = ‘Nam Dinh’ ( Invoice


⋈ Customers) )

5. List names of customers who had purchase invoices on 12-09-2023.

π CustomerName (σ DateInvoice =’12-09-2023’( Customers ⋈ Invoice))

6. List product codes and product names with unit prices greater than
10.000.000
ΠProductID,ProductName (σPriceUnit>10,000,000(Products ⨝
InvoiceDetails))
7. Find out the name of the customer with an address in Son La with a purchase
invoice on 13-09-2023

ΠCustomerName(σCustomerAddress=’Son La’ AND DateInvoice=’13-09-


23’(Customers ⨝ Invoice))

8. List product codes and product names sold on 14-09-2023.

π ProductID, ProductName (Products * (σ DateInvoice =’ 14-09-2023’(Invoice


⋈ InvoiceDetails))

9. List product codes that have never been sold

π ProductID(Products)−(π ProductID(InvoiceDetails))
10. List customer codes that have never made a purchase on 11-09-2023

π CustomerID(Customers) – (π CustomerID(σ DateInvoice = ‘11-09-


2023’(Invoice))

You might also like