Xii Cs Practical Sets
Xii Cs Practical Sets
Table: EMPLOYEE
Table: SALGRADE
SGRADE SALARY HRA
S001 56000 18000
S002 32000 12000
S003 24000 8000
TABLE: ACTIVITY
Acode ActivityName Stadium ParticipantsNum PrizeMoney ScheduleDate
1001 Relay 100x4 Star Annex 16 10000 23-Jan-04
1002 High jump Star Annex 10 12000 12-Dec-03
1003 Shot put Super Power 12 8000 14-Feb-04
1005 Long jump Star Annex 12 9000 01-Jan-04
1008 Discuss Throw Super Power 10 15000 19-Mar-04
TABLE: COACH
1. To display the Acode, ActivityName, Stadium from the table ACTIVITY of Prize Money
greater than 10000
2. To display the names of all activities with their Acodes in descending order
3. To display the coach’s name, Activity Name and ACode from the table ACTIVITY and
COACH which has more than 13 participants.
Give the output for the following:
4. SELECT Name, ActivityName FROM ACTIVITY A Natural Join COACH C;
C
TABLE: SALESPERSON
Code NAME SALARY ITCODE
1001 TANDEEP JHA 60000 12
1002 YOGRAJ SINHA 70000 15
1003 TENZIN JACK 45000 12
1005 ANOKHI RAJ 50000 17
1004 TARANA SEN 55000 17
TABLE: ITEM
ITCODE ITEMTYPE TURNOVER
15 STATIONERY 3400000
17 HOSIERY 6500000
12 BAKERY 10090000
1. To display the CODE and NAME of all SALESPERSON having “I7” Item Type Code from
the table SALESPERSON.
2. To display all details from table SALESPERSON in descending order of SALARY
3. To display NAME of all the salespersons from the SALESPERSON table along with their
corresponding ITEMTYPE from the ITEM table.
Give the output for the following:
4. SELECT DISTINCT ITCODE FROM SALESPERSON;
5. SELECT CODE,NAME, I.ITCODE FROM SALESPERSON S, ITEM I WHERE
S.ITCODE=I.ITCODE AND TURNOVER>=7000000;
D
COMPUTER SCIENCE(CODE: 083)
1 8
Write a Python Program to create the following functions:
i) create_csv - create a CSV file student.csv with the details [sno,name,marks] of n number of
students.
ii) search_csv - search a student record(sno) from a csv file student and display all the details of
the particular student.
2 4
Consider the following tables WORKER and PAYLEVEL and answer the questions given below:
TABLE: WORKER
ECODE NAME DESIG PLEVEL DOJ DOB
11 Radhe Shyam Supervisor P001 13-Sep-04 23-Aug-81
12 Chander Nath Operator P003 22-Feb-10 12-Jul-87
13 Fizza Operator P003 14-Jun-09 14-Oct-83
15 Ameen Ahmed Mechanic P002 21-Aug-06 13-Mar-84
18 Sanya Clerk P002 19-Dec-05 09-Jun-83
TABLE: PAYLEVEL
PLEVEL PAY ALLOWANCE
P001 26000 12000
P002 22000 10000
P003 12000 6000
3 Report/Practical File 7
4 Project 8
5 Viva Voce 3
E
COMPUTER SCIENCE(CODE: 083)
1 Write a program to read a text file "paragraph.txt" and perform the following functions : 8
i) display_chr() - display the number vowels, consonants, uppercase and lowercase letters in the file.
ii) count_the() - display total number times the word "the" occurs in the text file
Consider the following tables BOOKS and ISSUED and answer the questions given below: 4
2
TABLE: BOOKS
Book_Id Book_Name Author_Name Publishers Price Type Quantity
F000
1 The Tears William Hopkins First Publ. 750 Fiction 10
F000
2 Thunderbolts Anna Roberts First Publ. 700 Fiction 5
T000
1 My First C++ Brain & Brooke EPB 250 Text 10
T000 C++
2 Brainworks A.W. Rossaine TDH 325 Text 5
C000
1 Fask Cook Lata Kapoor EPD 350 Cookery 8
TABLE: ISSUED
Book_Id Quantity_Issued
F0001 3
T0001 1
C0001 5
1. To show Book name, Author name and Price of books of EPB publishers
2. To increase the price of all books of First Publ. by 50
3. To display the Book_Id, Book_Name and Quantity_Issued for all books from the table BOOKS
and ISSUED which have been issued.
Give the output for the following:
4. SELECT SUM(Price) FROM Books WHERE Quantity >5;