Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hands-on Exercise SALES begin{tabular}{|r|l|l|} hline Sales_ID & Sales_Name & Sales_Phone hline 13579 & Nasri & 60195624664 hline 23598 & Zelda & 60125479563

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Hands-on Exercise SALES \begin{tabular}{|r|l|l|} \hline Sales_ID & Sales_Name & Sales_Phone \\ \hline 13579 & Nasri & 60195624664 \\ \hline 23598 & Zelda & 60125479563 \\ \hline 56523 & Florence & 60135698231 \\ \hline 68595 & Arshavin & 60168462649 \\ \hline 98665 & Clarry & 60148597965 \\ \hline \end{tabular} ITEM INVOICE \begin{tabular}{|r|l|r|r|r|r|} \hline Invoice_ID & Invoice_Date & Invoice_Qty & Buyer_ID & Item_ID & Sales_ID \\ \hline 10010 & 20081215 & 1 & 2 & 659 & 68595 \\ \hline 10011 & 20060113 & 3 & 6 & 879 & 56523 \\ \hline 10012 & 20080306 & 4 & 8 & 989 & 23598 \\ \hline 10013 & 20071028 & 1 & 1 & 965 & 13579 \\ \hline 10014 & 20080516 & 7 & 6 & 888 & 98665 \\ \hline 10015 & 20081201 & 6 & 1 & 456 & 13579 \\ \hline 10016 & 20081203 & 3 & 7 & 659 & 98665 \\ \hline \end{tabular} 1. Create a new database call "Lab08". Next create the above tables (clearly define the primary and foreign keys). Note: Please export the database and save it for next tutorial after done. 2. Write SQL commands to insert the data into each table as shown below: 3. Write the SQL statement to list buyer's name and phone sort by buyer's name in ascending order. 4. Write the SQL statement to show the names of the sales person who handles the invoice of buyer Jeremy. 5. Write the SQL statement to show all sale person name and phone who issued invoice involving item type computer in the month of December 2008. 6. Write the SQL statement to show all item name, item price, item balance and a new column named as total value (price * balance) of items which is not under the category of computer. 7. Find all buyers name whose phone number starts with 6013. 8. List the purchase record (the item name, purchase date) that has been performed by 'Jesmon'. 9. List the sales report (include the sales name, buyer name, the purchase date, purchase items name, and quantity)

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

International Baccalaureate Computer Science HL And SL Option A Databases Part I Basic Concepts

Authors: H Sarah Shakibi PhD

1st Edition

1542457084, 978-1542457088

More Books

Students also viewed these Databases questions