Harsh CS Project

You might also like

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

Jaypee Vidya Mandir, Tomri

(Bulandshahr)

Computer Science Project


Topic : Python and MySQL
Submitted to : Mr. Ankit Kumar
Submitted by : Harsh Bhati
Class : XIIth Sci. (PCM)
CBSE Roll Number :

1
CERTIFICATE
This is to certify that H A R S H B H A TI of class XII (Science) of
JAYPEE VIDYA MANDIR, TOMRI (BULANDSHAHR) has completed
the Investigatory Project in Computer Science titled “ Python and
MySQL” himself under the supervision and guidance of Computer
Science Teacher, MR. ANKIT KUMAR during the academic session
2022-23. The progress of the project has been continuously reported
and has been in my knowledge consistently.

______________ _______________ _____________


Signature of Signature of Signature of
Principal External Subject
Invigilator Teacher

2
ACKNOWLEDGEMENT
First of all, I am deeply thankful to my Computer Science Teacher MR.
ANKIT KUMAR for extending his valuable and scholarly guidance
throughout the preparation of this project. I wish to extend my sincere
thanks to MRS. SANGITA SINGH respected Principal, JAYPEE VIDYA
MANDIR, TOMRI (BULANDSHAHR) for her continuous motivation
and moral support for completing the work.

I am also thankful to all my respected teachers, library staff, office staff


and staff members of the Computer Science Laboratory of the school.

Last but not the least I am indebted to my friends, classmates and


parents for encouraging and never let me down in my confidence while
completing the project.

3
Python

1. A python script to input the values of Principal, Rate,


and Time and calculate SI and CI.

OUTPUT:

4
2. Python script to input two numbers from the user
and store these values in two different variables.

OUTPUT:

5
3. Script to Convert Seconds into hours, minute and
seconds

OUTPUT:

6
4. To print list of names of students in reverse order

OUTPUT:

7
5. Find prime numbers between 1 and n number

OUTPUT:

8
6. Program to print the even elements using function

OUTPUT:

9
7. To print number ending with 0 from a list

OUTPUT:

10
8. To print odd numbers from a list

OUTPUT:

11
9. Program to print the sum of 'n' natural numbers
using recursion function

OUTPUT:

12
10.Program to print the sum of all the elements in the
list using recursion

OUTPUT:

11.Program to print original list

OUTPUT:

13
12.To verify whether a list is empty or not

OUTPUT:

13.Sum of first n terms of series:

OUTPUT:

14
14.Program to find the number of digits in a number:

OUTPUT:

15
15.Reading whole content of the file:

OUTPUT:

16
SQL
Enter the database Himanshu
Enter the password for MySQL CENTER@123#1
Enter the table name EMP
Successfully Connected to Database
1. Insert Record
2. Display Record
3. Search Record
4. Modify Record
5. Delete Record
6. Exit
Enter the choice 1
NOTE: Please enter string/varchar/date values (if
any) in quotes
Enter the EMPNO 120
NOTE: Please enter string/varchar/date values (if
any) in quotes
Enter the EMPNAME "Himanshu Pal"
NOTE: Please enter string/varchar/date values (if
any) in quotes
Enter the DEPT "Computer"
NOTE: Please enter string/varchar/date values (if
any) in quotes
Enter the DESIGN "Coder"

17
NOTE: Please enter string/varchar/date values (if
any) in quotes
Enter the basic 100000
NOTE: Please enter string/varchar/date values (if
any) in quotes
Enter the CITY "Srinagar"
Record successfully inserted
1. Insert Record
2. Display Record
3. Search Record
4. Modify Record
5. Delete Record
6. Exit
Enter the choice 2
Enter the number of records to display 10
(111, 'Akash Narang', 'Account', 'Manager', 50000,
'Dehradun')
(112, 'Vijay Duneja', 'Sales', 'Clerk', 21000,
'Lucknow')
(113, 'Kunal Bose', 'Computer', 'Programmer',
45000, 'Delhi')
(114, 'Ajay Rathor', 'Account', 'Clerk', 26000,
'Noida')
(115, 'Kiran Kukreja', 'Computer', 'Operator', 30000,
'Dehradun')

18
(116, 'Piyush Sony', 'Sales', 'Manager', 55000,
'Noida')
(117, 'Makrand Gupta', 'Account', 'Clerk', 16000,
'Delhi')
(118, 'Harish Makhija', 'Computer', 'Programmer',
34000, 'Noida')
(120, 'Himanshu Pal', 'Computer', 'Coder', 100000,
'Srinagar')
1. Insert Record
2. Display Record
3. Search Record
4. Modify Record
5. Delete Record
6. Exit
Enter the choice 3
Enter the column name using which you want to
find the record EMPNO
Enter the EMPNO of that record 120
[(120, 'Himanshu Pal', 'Computer', 'Coder', 100000,
'Srinagar')]
1. Insert Record
2. Display Record
3. Search Record
4. Modify Record
5. Delete Record
6. Exit

19
Enter the choice 4
Enter the field name to modify basic
Enter the column name using which you want to
find the record EMPNAME
Enter the EMPNAME of that record Himanshu Pal
Enter the new basic 200000
Record successfully modified
1. Insert Record
2. Display Record
3. Search Record
4. Modify Record
5. Delete Record
6. Exit
Enter the choice 5
Enter the column name using which you want to
find the record
NOTE: NO TWO RECORDS SHOULD HAVE SAME
VALUE FOR THIS COLUMN: EMPNO
Enter the EMPNO of that record 120
Record successfully deleted

20
MySQL queries:

I. SELECT * FROM job;

II. SELECT jobtitle,salary FROM job;

21
III. SELECT * FROM job WHERE salary>100000;

IV. SELECT MAX(salary) FROM job;

V. SELECT COUNT(DISTINCT jobtitle) FROM job;

VI. SELECT * FROM job WHERE jobtitle LIKE “R%”

22
VII. SELECT * FROM job ORDER BY salary ASC;

VIII. . SELECT SUM(salary) AS “TOTAL SALARY” FROM


job;

IX. SELECT * FROM CLUB;

23
X. SELECT * FROM CLUB GROUP BY SPORTS;

XI. SELECT * FROM EMP;

XII. . SELECT CITY,COUNT(*) FROM EMP GROUP BY


CITY HAVING COUNT(*)>1;

24
XIII. SELECT DEPT,SUM(basic) AS “TOTAL SALARY”
FROM EMP GROUP BY DEPT;

XIV. SELECT * FROM GROUP BY CITY HAVING


basic>30000;

XV. SELECT * FROM WHERE CITY=”Noida” ORDER BY


basic ASC;

25

You might also like