Cs Practical Manas New
Cs Practical Manas New
SCIENCE
XIITH – E
Roll Number: 41
Swyam Sharma
41
12th E
Q1.
b)
c)
d)
Swyam Sharma
41
12th E
e)
f)
g)
Swyam Sharma
41
12th E
Q2.
2.
3.
Swyam Sharma
41
12th E
4.
5.
6.
Swyam Sharma
41
12th E
7.
8.
Swyam Sharma
41
12th E
Q3.
Lab exercises:
Consider the following table named "GYM"
with details about Fitness products
being sold in the store.
Table Name: GYM
PrCode stores Codes of Products
PrName stores names of Products
(Unit Price is in Rs.)
Swyam Sharma
41
12th E
Write SQL statements to do the following:
Swyam Sharma
41
12th E
A3.
a)
b)
c)
Swyam Sharma
41
12th E
d)
e)
f)
g)
Swyam Sharma
41
12th E
h)
i)
Swyam Sharma
41
12th E
Q4.
Swyam Sharma
41
12th E
A4.
a)
b)
c)
d)
Swyam Sharma
41
12th E
e)
f)
g)
Swyam Sharma
41
12th E
Q5. Study the following tables SENDER and
RECIPIENT. Write SQL commands for the questions (i)
to (v)
Swyam Sharma
41
12th E
A5.
a)
b)
c)
Swyam Sharma
41
12th E
d)
e)
Swyam Sharma
41
12th E
Q6.
Consider the following tables CABHUB and
CUSTOMER.
Swyam Sharma
41
12th E
Write SQL commands for the statements (i) to
(v).
(i) To display the names of all the white coloured
vehicles from the cabhub table.
Swyam Sharma
41
12th E
A6.
a)
b)
c)
Swyam Sharma
41
12th E
d)
e)
f)
Swyam Sharma
41
12th E
Q7.
Consider the following tables PRODUCT and
CLIENT
Swyam Sharma
41
12th E
Write SQL commands for the statements (i) to
(v).
Swyam Sharma
41
12th E
a)
b)
c)
Swyam Sharma
41
12th E
d)
e)
f)
Swyam Sharma
41
12th E
g)
Swyam Sharma
41
12th E
Q8. Consider the following tables EMPLOYEE and SALARY.
Swyam Sharma
41
12th E
Write SQL commands for the statements (i) to (v)
Swyam Sharma
41
12th E
a)
b)
c)
Swyam Sharma
41
12th E
d)
e)
Swyam Sharma
41
12th E
10) Write SQL commands for (a) to (b) on the
basis of relations given below:
Swyam Sharma
41
12th E
10)
Swyam Sharma
41
12th E
c) To display the Product Name, Manufacturer, Expiry
Date of all the products that expired on or before 2010-
12-31
Swyam Sharma
41
12th E
11) Consider the following tables STORE and
SUPPLIERS.
b) To display itemno and item name of those items from Store table
whose rate is more than 15 rupees SELECT itemno, item FROM store
WHERE rate>15;
CODE: SELECT itemno, item FROM store WHERE rate>15;
Swyam Sharma
41
12th E
Q 12 Consider a database LOANS with the
following table:
c) Display the count of all loan holders whose name ends with
'Sharma'.
CODE: SELECT count(*) FROM loans WHERE cust_name LIKE
'%Sharma';
Swyam Sharma
41
12th E
Swyam Sharma
41
12th E
a)
b)
c)
Swyam Sharma
41
12th E
d)
e)
f)
g)
Swyam Sharma
41
12th E
Swyam Sharma
41
12th E
a)
b)
c)
Swyam Sharma
41
12th E
d)
e)
f)
Swyam Sharma
41
12th E
Q15. Create Database School and table Studinfo
with columns rollnum, name and marks in MySQL
and insert five records of student by using python
and database connectivity coding.
CODE:
Swyam Sharma
41
12th E
OUTPUT:
BEFORE:
AFTER:
Swyam Sharma
41
12th E
Q16. Program to delete the marks of a students
on the basis of rollnum fetched from the user at
run time.
CODE:
Swyam Sharma
41
12th E
OUTPUT:
Swyam Sharma
41
12th E
Q 17 Write Menu Driven program in python to
demonstrate four major operations (add, fetch,
update, delete) in database school.
Swyam Sharma
41
12th E
Swyam Sharma
41
12th E
OUTPUT:
Swyam Sharma
41
12th E
Swyam Sharma
41
12th E
Q 18 ABC infotech Pvt Ltd. needs to store, retrieve and delete the
records of its employees. Develop an interface that provides front-
end interaction through Python, and stores and updates records
using MySQL. The operations on MySQL table "emp" involve reading,
searching, updating and deleting the records of employees.
(Database name company)
Swyam Sharma
41
12th E
(a) Program to read and fetch all the records
from emp table having salary more than
62000
CODE:
OUTPUT:
Swyam Sharma
41
12th E
(b) Program to update the records of employee by
increasing salary by Rs 1000 of all those employees who
are getting less than 80000
CODE:
OUTPUT:
BEFORE: AFTER:
Swyam Sharma
41
12th E
(c) Program to delete the records on the basis of
inputted salary.
CODE:
OUTPUT
BEFORE: AFTER:
Swyam Sharma
41
12th E
Q 19 Write a Menu Driven program in python to
implement all basic operations (PUSH, POP,
DISPLAY) of stack using list.
CODE:
OUTPUT:
Swyam Sharma
41
12th E
Q 20 Program to add, delete and display the
records of an employee using list.
CODE:
OUTPUT:
Swyam Sharma
41
12th E