Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

ST MARTIN’S DIOCESAN SCHOOL.

[083]

NAME : ARNAV TANWAR


CLASS : XII A
ROLL NO :

P a g e 1 | 14
INDEX.
SNO PRACTICAL PAGE NO SIGN
Write a Python program 3-4
1. to implement a stack
using list.

2. Implement the following


SQL commands on the
5-9

student table.

Create a Table employee 10


3. with following structure.

4. Create another table Job


with following structure.
11

5. Write a Python Database


connectivity script that
12-14

deletes records from


category table of
database items that have
name=’Stockable’.

P a g e 2 | 14
QUES 1-
Write a Python program to implement a stack using list.
OUTPUT:

P a g e 3 | 14
Output:

P a g e 4 | 14
QUES 2-
.Create a student table having
1. Roll no
2. Name
3. Class
4. DOB
5. Gender
6. City
7. Marks insert 10 values.
Implement the following SQL commands on the student table:
i. ALTER table to add new attributes / modify data type / drop attribute
ii. UPDATE table to modify data
iii. ORDER By to display data in ascending / descending order
iv. Find the min, max, sum, count and average
v. To display the class, DOB and city whose marks is between 450 and
551.
vi. To display Name, Class and total number of student who have
secured more than 450 marks, class wise.
vii. To increase marks of all students by 20 whose class is “XII”

MYSQL-
P a g e 5 | 14
P a g e 6 | 14
P a g e 7 | 14
P a g e 8 | 14
3. Create a Table employee with following structure.
ID Number(4)
First_Name Varchar(30)
Last_Name Varchar(30)
User_id Varchar(10)
Salary Number(9,2)
P a g e 9 | 14
i. ID should be Primary key .
ii. User_Id should be Unique.
iii. Salary must be greater than 5000.
iv. First_Name and Last_Name must not remain blank.

4. Create another table Job with following structure.


Job_id Number(4)
Job_desc varchar(30)
Alloc_on Date
Due_on Date
Emp_id Number(4)

P a g e 10 | 14
i. Job_id is Primary key
ii. Job_desc ,Alloc_on, Due_on cannot be left blank.
iii. Emp_id is foreign key that is related to ID column created in
Employee Table Q3

5. Write a Python Database connectivity script that deletes records


from category table of database items that have name=’Stocktable.

P a g e 11 | 14
CODE:
P a g e 12 | 14
OUTPUT:

MYSQL:
P a g e 13 | 14
P a g e 14 | 14

You might also like