PRACTICAL FILE INDEX SQL
PRACTICAL FILE INDEX SQL
2 Ravinder 1008
3 Janila 1001
4 Naaz 1003
4. MYSQL Question IV
Create the following tables Customer and Bill. Write SQL commands for
the statements (i) to (v)
Table : Customer
Cust_Id Cust_Name Address Phone_no City
C007 Pritam Sharma 12,M.G Road 71274250 Bangalore
C008 Sutopa 14/1 Pritam Pura 41206819 Delhi
C010 Anurag Basu 15A, Park Road 61281921 Kolkata
C012 Hrithik 7/2 Vasant Kunj 26121949 Delhi
C013 Firoz Shah 2, Servamali road 25014192 Bangalore
C025 Vinod Nagpal 46-a Navi Mumbai 64104944 Mumbai
C027 Sameer 41,Dwarka 42101619 Delhi
C002 Pasunjit Bose 16/A K.G Marg 27220012 Bangalore
C035 Aamina Begum 13/A Versova 41612181 Mumbai
Table : BILL
Ord_id Cust_id Item Ord_date Qty Price
7002 C007 Pizza 20-11-07 1 249.50
7003 C013 Garlic Bread 24-10-05 3 75.75
7004 C012 Pasta 03-03-07 4 173.00
7005 C010 Ice Cream 01-01-08 30 195.75
7006 C035 Pizza 02-03-06 4 249.50
7009 C035 Garlic Bread 02-03-08 2 75.75
7010 C013 Brownie 04-05-07 4 40.50
7011 C014 Ice Cream 02-06-08 5 195.75
7012 C002 Pizza 01-02-08 7 249.50
(i) Display a report containing cust_id, cust_name,
Item,qty,price and bill amount. Bill amount is calculated
as the sum of qty*price
(ii) Display how many customers have ordered Pizza in the
month of August
(iii) Display the name of customer along with their city in
alphabetical order of city
(iv) Insert into table customer a column City and enter
Delhi to all of them.
(v) To display how many clients are there in each city.
5. MYSQL Question V
Create the tables BOOKS and ISSUES and write the SQL commands for
(i) to (v)
(i) To show Book name, Author name and Price of books of ABC publisher.
(ii) To display the details of the books in descending order of their price.
(iii) To decrease the Qty_Issued from ISSUES table by 3 (all rows must
decrease).
(iv) To display the Book Id, Book name, Publisher, Price, Qty, Qty_Issued
from both the tables with their matching Book ID.
(v) To display the Price of Books where Quantity Issued is equal to 5.
Table: ISSUES
Book_ID Qty_Issued
L02 13
L04 5
L05 21
Table: BOOKS
Book_ID BookName AuthorName Publisher Price Qty