0% found this document useful (0 votes)
21 views

CS Practical File (1)

Uploaded by

shabakdqrazy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

CS Practical File (1)

Uploaded by

shabakdqrazy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

(a) Create table structure of above tables.

SOURCE CODE:

OUTPUT:

1
(b) Insert one record in any of the table given above.

SOURCE CODE:

OUTPUT:

(c) Reduce the price of Amul products by 5%

SOURCE CODE:

OUTPUT:

2
(d) Display Itemname, Brand, price, Category name through natural Join.

(e) Display itemname of items where brand is NULL

(f) Display Itemname,Brand, price, Category name through Equi Join.

3
(g) Add Item Id as primary Key in table store_Items

SOURCE CODE:

OUTPUT:

(h) Display the Item_name,PricePerUnit,Brand of MILK Eggs and Honey.

(i) Display Brand wise total number of Products

4
(j) Display categoryId wise count of Items.

5
a) To display CNO, CNAME, TRAVELDATE from the table TRAVEL in
descending order of CNO.

6
(b) To display the CNAME of all customers from the table TRAVEL who are
travelling by vehicle with code T01 or T02

(c) To display the CNO and CNAME of those customers from the table
TRAVEL who travelled between '2019-01-06' and '2019-05-01'.

(d) To display all the details from table TRAVEL for the customers, who have
travel distance more than 250 KM in ascending order of NOP (Number of
Passengers)

7
(e) Display average and maximum KM from table Travel.

(f) Add a field Taxi_Owner in table Taxi_Type

SOURCE CODE:

OUTPUT:

(g) Display CNAME, Taxi Type for all the customers.

8
(h) Increase per Km cost by 10 % for all

SOURCE CODE:

OUTPUT:

(i) Display all TaxiType whose name starts and end with “A”

(j) Display Taxi Code wise average NOP.

9
(k) Display Total cost to be paid by each customer.

10
3) Write a Python MySQL connectivity program to accept data for the
following structure in python from the user and store the data in form of
Records in MYSQL table Product.

SOURCE CODE:

OUTPUT:

11
4) Write a Python MySQL connectivity program to display all records
belonging to category “Electronics” from MYSQL table Product.

SOURCE CODE:

OUTPUT:

12
5) Write a Python MySQL connectivity program to increase price of items
belonging to category “Electronics” in table PRODUCT.

SOURCE CODE:

OUTPUT:

13
6) Write a Python MySQL connectivity program to delete items having
category as NULL from table PRODUCT.
CURRENT TABLE: (after a few modifications)

SOURCE CODE:

OUTPUT:

14

You might also like