0% found this document useful (0 votes)
17 views3 pages

Class XII CS Term2 - Board Practical Record Programs 2024-25

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)
17 views3 pages

Class XII CS Term2 - Board Practical Record Programs 2024-25

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/ 3

DELHI PUBLIC SCHOOL

NACHARAM
Term-II PRACTICAL RECORD PROGRAMS SUB: COMPUTER SCIENCE CLASS: XII
2024-25

16. Write SQL queries for the following.

i. Write a Query to Create a new database in the name of "STUDENTS"

ii. Write a Query to Open the database "STUDENTS"

iii. LIST all DDL, DML, DCL and TCL commands in SQL

i.
17. Write SQL Queries for the given below questions using STUDENT table:

Field Name Data type


Student_ID int(14)
Student_Name Varchar(15)
Computer Varchar(20)
Informatics_Practices Varchar(20)
Artifitial_Intelligence Varchar(20)
Information_Technology Varchar(20)

i. Create a student database from the above table structure


ii. Add record into the table for 5 students, using insert command
iii. Display the description of the fields(design view) in table using desc command
iv. Display all records form the Student table using select command
v. Add to new fields to the table:
Total Int(10)

vi. Calculate total Marks by using update command


vii. Find the min, max, sum, and average of the marks in a student marks table
viii. Add two new fields to the table:
Percentage Int(20)
Result Varchar(10)

ix. Calculate Percentage Marks


x. Compute the result as "pass" or "fail" by checking if the student has scored more
than 35 marks in each subject.
18. CONSIDER THE FOLOWING TABLE “GAMES” and write SQL queries for the following
statements.
GCODE GAMENAME Type NUMBER PRIZE SCHEDULE
101 CaromBoard Indoor 2 5000 23-Jan-2019
102 Badminton Outdoor 2 12000 12-Dec-2019
103 TableTennis Indoor 4 8000 14-Feb-2019
104 Chess Indoor 2 9000 01-Sep-2019
105 Cricket Outdoor 4 25000 19-Mar-2019

i. Write SQL queries to create the above table by using create and insert commands.
ii. To display the name of all GAMES with their GCodes
iii. To display details of those GAMES which are scheduled between 02-Mar2014 and
10-Dec-2019.
iv. To display the content of the GAMES table in ascending order of Schedule Date
v. To display sum of Prize Money for each Type of GAMES.

Write output for the following commands.


vi. select count(distinct number) from games;
vii. SELECT MAX(ScheduleDate),MIN(ScheduleDate) FROM GAMES;
viii. Display all the records of GAMES table

19. Write SQL Query to create the tables CARDEN and CUSTOMER and write given SQL
commands.
Table: CARDEN

CCODE CARNAME MAKE COLOR CAPACITY CHARGES


501 A-Star Suziki Red 3 14
503 Indigo Tata Silver 3 12
502 Innova Toyota Whiler 7 15
509 SX4 Suziki Silver 4 14
510 CClass Mercedes Red 4 35

Table: CUSTOMER

CODE CNAME CCODE


1001 Hemanth 501
1002 Raj 509
1003 Shaz 503
1004 Ketan 502

i. Write SQL commands to create the above tables and insert the records in it as
given above
ii. To display the names of all the silver coloured cars
iii. To display name of the car, make and capacity of cars in descending order of
their seating capacity
iv. To display the highest charges at which a vehicle can be hired from CARDEN
v. To display the customer name and the corresponding name of the cars hired by
them
vi. To count and display colour from the table carden
vii. Update the record cname Raj Kumar where code=1002
viii. Add a new column CTYPE into the table customer

20. Write SQL queries based on the below given COLOR and SHADES tables.

RED LIGHT

GREEN CYAN

BLIE SILVER

i. Write an SQL query for cross join


ii. Write an SQL query for Equi join
iii. Write an SQL query for Natural join

21. Write a Python Program to integrate MYSQL with Python by inserting records to Emp
table and display the records. (EMPNO, EMPNAME, EMPSALARY, EMPDEPT)

22. Write a Python Program to integrate MYSQL with Python to search an Employee using
EMPID and display the record if present in already existing table EMP, if not display the
appropriate message.

23. Explain the following with examples in IDLE connectivity.


i. fetchone()
ii. fetchmany()
iii. fetchall()
iv. rowcount

You might also like