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

Term 2 CS Practical File

Uploaded by

x5rpgcv4mk
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Term 2 CS Practical File

Uploaded by

x5rpgcv4mk
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 29

COMPUTER

SCIENCE

PRACTICAL FILE

MOHD. TAHA SALEEM


Class: - XII-A
Roll no. - ___________
CERTIFICATE
This is to certify that “MOHD. TAHA SALEEM”
Student of class XII-A has successfully completed
his COMPUTER file on
“PYTHON PROGRAMS”
Under the guidance of “Mr. Kalpana Sadhu”.

Mrs. Kalpana Sadhu MOHD. TAHA SALEEM


ACKNOWLEDGEMENT
Primarily I would thank GOD for being able to complete this
project with success. Then I would like to thank my
COMPUTER teacher Mrs. Kalpana Sadhu, whose valuable
guidance has been the ones that help me patch this project and
make it full proof success his suggestion and his instructions
has served as the major contributor towards the completion of
the project.
I would like to thank my parents and friends who have helped
me with their valuable suggestion and guidance. It has been
helpful in various phases of the completion of the project.

By: MOHD. TAHA SALEEM


CLASS- XII-A
CONTENT
S. Pg.
No
Programs No.
.
1. Write a program to implement a stack for these book 1
– details (book no, book name). That is, now each
item node of the stack contains two types of
information – a book no and its name. Implement
Push, Pop and display operation.
2. Write a python program all records in ascending 3
order of their age from the given table student.

3. Write a program to delete the student record whose 4


name is read from the keyboard at execution time.

4. Consider the tables given below and answer the 5


questions that follow:

5. 1. Create a database Records 5


6. 2. Get inside the database Records 5
7. 3. Create tables Employee and Department 6
8. 4. Insert tuples as shown above 6
9. 5. Display the databases that are already created. 6
10. 6. Display the database Records 7
11. 7. Display the tables that exists in the current 7
database.
12. 8. Display the structure of the table Employee 7
13. 9. Display the structure of the table Department 8
14. 10. Display the details of all the employees. 8
15. 11. Display the Salary, Zone, and Grade of all the 8
employees.
16. 12. Display the records of all the employees along 9
with their annual salaries. The Salary column of the
table contains monthly salaries of the employees.
17. 13. Display the records of all the employees along with 9
their annual salaries. The Salary column of the table
contains monthly salaries of the employees. The new
column should be given the name “Annual Salary”.
18. 14. Display the details of all the employees who are 10
below 30 years of age.
19. 15. Display the names of all the employees working in 10
North zone.
20. 16. Display the salaries of all the employees of 10
department 10.
21. 17. Display the details of all the employees whose 11
Grade is NULL.
22. 18. Display the details of all the employees whose 11
Grade is not NULL.
23. 19. Display the names of various zones from the table 11
Employee. A zone name should appear only once.

24. 20. Display the various department numbers from the 12


table Employee. A department number should be
displayed only once.
25. 21. Display the details of all the employees of 12
department 10 who are above 30 years of age.
26. 22. Display the details of all the employees who are 12
getting a salary of more than 35000 in the department
30.
27. 23. Display the names and salaries of all the 13
employees who are working neither in West zone nor
in Centre zone.
28. 24. Display the names of all the employees who are 13
working in department 20 or 30.
29. 25. Display the details of all the employees whose 13
salary is between 32000 and 38000.
30. 26. Display the details of all the employees whose 14
grade is between ‘A’ and ‘C’.
31. 27. Display the names of all the employees who are 14
working in department 20 or 30. (Using IN operator)
32. 28. Display the names and salaries of all the 14
employees who are working neither in West zone nor
in Centre zone. (Using IN operator)
33. 29. Display the details of all the employees whose 15
salary is between 32000 and 38000. (Using BETWEEN
operator)
34. 30. Display the details of all the employees whose 15
grade is between „A‟ and „C‟. (Using BETWEEN
operator)
35. 31. Display the name, salary, and age of all the 15
employees whose names start with „M‟.
36. 32. Display the name, salary, and age of all the 16
employees whose names end with „a‟.
37. 33. Display the details of all the employees whose 16
names contain „a‟ as the second character.
38. 34. Display the details of all the employees in the 16
ascending order of their salaries.
39. 35. Display the details of all the employees in the 17
descending order of their names.
40. 36. Display the details of all the employees in the 17
ascending order of their grades and within grades in
the descending order of their salaries.
41. 37. Display the total number of employees in each 18
department.
42. 38. Display the highest salary, lowest salary, and 18
average salary of each zone.
43. 39. Display the average age of employees in each 18
department only for those departments in which
average age is more than 30.
44. 40. Display department name, minsal and name of 19
employee whose department no is 20.
45. 41. Display zone and department name, employee 19
name and age whose department no is 10 and age is
less than 30.
46. 42. Put the grade B for all those whose grade is NULL. 19
47. 43. Increase the salary of all the employees above 30 20
years of age by 10%.
48. 44. Delete the records of all the employees whose 20
grade is C and salary is below 30000.
49. 45. Add another column HireDate of type Date in the 21
Employee table.
50. 46. Modify the column age to Empage with datatype 21
date
51. 47. Remove the column HireDate 21
52. 48. Drop the tables Employee and Department. 22
PROGRAMS
Q1. Write a program to implement a stack for these book –
details (book no, book name). That is, now each item node of
the stack contains two types of information – a book no and
its name. Implement Push, Pop and display operation.
CODE:
OUTPUT:
Q3. Write a program to delete the student record whose
name is read from the keyboard at execution time.

INPUT:

Select * from student order by Age;

OUTPUT:
Q4. Consider the tables given below and answer the
questions that follow:
Table: Department
Dept DName MinSal MaxSal HOD
10 Sales 25000 32000 1
20 Finance 30000 50000 5
30 Admin 25000 40000 7

Table: Employee
No Name Salary Zone Age Grade Dept
1 Mukul 30000 West 28 A 10
2 Kritika 35000 Centre 30 A 10
3 Naveen 32000 West 40 20
4 Uday 38000 North 38 C 30
5 Nupur 32000 East 26 20
6 Moksh 37000 South 28 B 10
7 Shelly 36000 North 26 A 30

1. Create a database Records

2. Get inside the database Records


3. Create tables Employee and Department.

4. Insert tuples as shown above

5. Display the databases that are already created.


6. Display the database Records.

7. Display the tables that exists in the current database.

8. Display the structure of the table Employee


9. Display the structure of the table Department

10. Display the details of all the employees.

11. Display the Salary, Zone, and Grade of all the employees.
12. Display the records of all the employees along with their annual
salaries. The Salary column of the table contains monthly salaries of
the employees.

13. Display the records of all the employees along with their annual
salaries. The Salary column of the table contains monthly salaries of
the employees. The new column should be given the name “Annual
Salary”.
14. Display the details of all the employees who are below 30 years
of age.

15. Display the names of all the employees working in North zone.

16. Display the salaries of all the employees of department 10.


17. Display the details of all the employees whose Grade is NULL.

18. Display the details of all the employees whose Grade is not NULL.

19. Display the names of various zones from the table Employee. A
zone name should appear only once.
20. Display the various department numbers from the table
Employee. A department number should be displayed only once.

21. Display the details of all the employees of department 10 who


are above 30 years of age.

22. Display the details of all the employees who are getting a salary
of more than 35000 in the department 30.
23. Display the names and salaries of all the employees who are
working neither in West zone nor in Centre zone.

24. Display the names of all the employees who are working in
department 20 or 30.

25. Display the details of all the employees whose salary is between
32000 and 38000.
26. Display the details of all the employees whose grade is between
‘A’ and ‘C’.

27. Display the names of all the employees who are working in
department 20 or 30. (Using IN operator).

28. Display the names and salaries of all the employees who are
working neither in West zone nor in Centre zone. (Using IN
operator).
29. Display the details of all the employees whose salary is between
32000 and 38000. (Using BETWEEN operator)

30. Display the details of all the employees whose grade is between
‘A’ and ‘C’. (Using BETWEEN operator).

31. Display the name, salary, and age of all the employees whose
names start with ‘M’.
32. Display the name, salary, and age of all the employees whose
names end with ‘a’.

33. Display the details of all the employees whose names contain ‘a’
as the second character.

34. Display the details of all the employees in the ascending order of
their salaries.
35. Display the details of all the employees in the descending order
of their names.

36. Display the details of all the employees in the ascending order of
their grades and within grades in the descending order of their
salaries.
37. Display the total number of employees in each department.

38. Display the highest salary, lowest salary, and average salary of
each zone.

39. Display the average age of employees in each department only


for those departments in which average age is more than 30.
40. Display department name, MinSal and name of employee whose
department no is 20.

41. Display zone and department name, employee name and age
whose department no is 10 and age is less than 30.

42. Put the grade B for all those whose grade is NULL.
43. Increase the salary of all the employees above 30 years of age by
10%.

44. Delete the records of all the employees whose grade is C and
salary is below 30000.
45. Add another column HireDate of type Date in the Employee
table.

46. Modify the column age to Empage with datatype date.

47. Remove the column HireDate.


48. Drop the tables Employee and Department.
BIBLIOGRAPHY
 Computer Science By: Sumita Arora
 Google
 Learnpython4cbse.com

You might also like