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

P - File - 2 Ques

The document outlines a series of programming tasks and SQL queries for various scenarios. It includes Python programs for managing data structures like dictionaries and lists, as well as SQL commands for manipulating and querying data from multiple tables related to games, vehicles, employees, teachers, and gym members. Each task is designed to enhance skills in programming and database management through practical applications.

Uploaded by

JEE Aspirant
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)
7 views3 pages

P - File - 2 Ques

The document outlines a series of programming tasks and SQL queries for various scenarios. It includes Python programs for managing data structures like dictionaries and lists, as well as SQL commands for manipulating and querying data from multiple tables related to games, vehicles, employees, teachers, and gym members. Each task is designed to enhance skills in programming and database management through practical applications.

Uploaded by

JEE Aspirant
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

Practical File Part-2 Questions

S.NO LIST OF PROGRAMS SIGNATURE


1. Write a menu driven program in Python to create a dictionary containing names and marks
as key-value pairs of 10 students, with separate user defined functions to perform the
following operations:
--Push the keys (names) on to the stack where the value of marks is more than 75.
--Peek, Pop and display the contents of the stack.
2. Write a menu driven program in Python to create a list containing n integers with separate
user defined functions to perform the following operations based on this list.
-- Traverse the content of the list and push the even numbers
onto the stack.
-- Peek, Pop and display the content of the stack.
3. Write a menu driven program in Python to create a list containing 10 book names and the
subject with separate user defined functions to perform the following operations based on
this list.
-- Traverse the content of the list and push the names of the Computer Science books
on to the stack
-- Peek, Pop and display the content of the stack.
4. Consider the following tables GAMES and PLAYER. Write SQL commands for the following :
GAMES
GCode GameName Number PrizeMoney ScheduleDate
101 Carom Board 2 5000 23-Jan-2004
102 Badminton 2 12000 12-Dec-2003
103 Table Tennis 4 8000 14-Feb-2004
105 Chess 2 9000 01-Jan-2004
108 Lawn Tennis 4 25000 19-Mar-2004
PLAYER
PCode Name Gcode
1 Nabi Ahmad 101
2 Ravi Sahai 108
3 Jatin 101
4 Nazneen 103
1. To display the name of all Games with their Gcodes in desc.Order of their scheduledate.
2. To display details of those games which are having PrizeMoney more than 7000.
3. To display gcode, Player name, game name and prizemoney .
4. To display sum of PrizeMoney for each of the Number of participation groupings (as
shown in column Number)
5. To display the names of players whose name start with “N”earning prizemoney more
than 5000.

5. Consider the following tables CABHUB and CUSTOMER. Write SQL commands for the
following : CABHUB
Vcode VehicleName Make Color Capacity Charges
100 Innova Toyota WHITE 7 15
102 SX4 Suzuki BLUE 4 14
104 C Class Mercedes RED 4 35
105 A-Star Suzuki WHITE 3 14
108 Indigo Tata SILVER 3 12
CUSTOMER
CCode CName VCode
1 Hemant Sahu 101
2 Raj Lal 108
3 Feroza Shah 105
4 Ketan Dhal 104
1. To display the names of all white colored vehicles.

2. To display name of vehicle, make and capacity of vehicles in ascending order of their
sitting capacity.

3. To display the highest charges at which a vehicle can be hired from CABHUB.

4. To display the customer name and the corresponding name of the vehicle hired by
them.

5. To display the average of charges at which a vehicle can be hired from CABHUB.

6. Consider the following DEPT and EMPLOYEE tables. Write SQL commands for the following:

DEPT

DCODE DEPARTMENT LOCATION


D01 INFRASTRUCTURE DELHI
D02 MARKETING DELHI
D03 MEDIA MUMBAI
D05 FINANCE KOLKATA
D04 HUMAN RESOURCE MUMBAI
EMPLOYEE
ENO NAME DOJ DOB GENDER DCODE
1001 George K 2013-09-02 1991-09-01 MALE D01
1002 Ryma Sen 2012-12-11 1990-12-15 FEMALE D03
1003 Mohitesh 2013-02-03 1987-09-04 MALE D05
1007 Anil Jha 2014-01-17 1984-10-19 MALE D04
1004 Manila Sahai 2012-12-09 1986-11-14 FEMALE D01
1005 R SAHAY 2013-11-18 1987-03-31 MALE D02
1006 Jaya Priya 2014-06-09 1985-06-23 FEMALE D05
1. To display Eno, Name, Gender from the table EMPLOYEE in ascending order of Eno.
2. To display the Name of all the MALE employees from the table EMPLOYEE.
3. To display the Eno and Name of those employees from the table EMPLOYEE who are
born between '1987‐01‐01' and '1991‐12‐01'.
4. To count and display FEMALE employees who have joined after '1986‐01‐01'.
5. To display the eno, ename,gender, department,location of employees who all joined in
2012.
7. Consider the following tables SCHOOL and ADMIN. Write SQL commands for the following:
SCHOOL

CODE TEACHERNAME SUBJECT DOJ PERIODS EXPERIENCE


1001 RAVI SHANKAR ENGLISH 12/03/2000 24 10
1009 PRIYA RAI PHYSICS 03/09/1998 26 12
1203 LISA ANAND ENGLISH 09/04/2000 27 5
1045 YASHRAJ MATHS 24/08/2000 24 15
1123 GANAN PHYSICS 16/07/1999 28 3

1167 HARISH B CHEMISTRY 19/10/1999 27 5

ADMIN
CODE GENDER DESIGNATION
1001 MALE VICE PRINCIPAL
1009 FEMALE COORDINATOR
1203 FEMALE COORDINATOR
1045 MALE HOD
1123 MALE SENIOR TEACHER
1167 MALE SENIOR TEACHER
1215 MALE HOD
1. To display TEACHERNAME, PERIODS of all teachers whose periods are less than 25.
2. To display TEACHERNAME, CODE and DESIGNATION from tables SCHOOL and ADMIN.
3. To display the TEACHERNAME who have minimum PERIODS.
4. To display CODE, TEACHERNAME and SUBJECT of all teachers who have joined the school
after 01/01/1999.
5. To display contents of both the tables.
8. Consider the following relation TEACHER and SALARY. Write SQL commands for the
following : TEACHER
TID FIRST_NAME LAST_NAME ADDRESS SUBJECT
010 Rohit Sharma 83, Lok Vihar English
105 Meeta Rathi 842, Rajauri Physics
152 Seema Verma 33, Safdarganj Maths
215 Sarad Singh 440, Ashok Vihar Physics
244 Manish Sengupta 24, New Street Maths
300 Ram Gupta 9, Fifth Road Chemistry
355 Heena Jain 12, Friends Street Computer
400 Rachit Sharma 10, Paschim Vihar Computer
441 Punit Jain 11, Rohini Chemistry
SALARY
TID SALARY BONUS DESIGNATION
010 7500 1500 PGT
105 8500 1500 PGT
152 6000 1200 TGT
215 7500 1500 PGT
1. To display FIRST_NAME, LAST_NAME and SUBJECT of all teachers of PHYSICS subject
2. To display all records in ascending order of LAST_NAME.
3. To display the TID, FIRST_NAME and total SALARY of all PGT from the table TEACHER and
SALARY, where total salary is calculated as SALARY + BONUS.
4. To display the ADDRESS of teachers SUBJECT wise.
5. To display the names of teachers whose bonus is more than 1000.

9. Write a menu driven program in Python to create a table (GYM) of SQL with the following
contents : (Python SQL Interface)
Mno member number integer, Mname member name string
Fee membership fee float, Address member address string
Gender member gender character, Write user defined functions to :
1. insert rows in this table. (using parameterized query concept)
2. display the rows
3. update rows (using parameterized query concept)
4. Display data in sorted order as per the user choice
5. Query based on group by clause

You might also like