You are on page 1of 2

Questions for practice

Ques-1 Write a program to create a stack called Employee, to perform the basic operation on
stack using list. The list contain the two values-employee number and employee name. The
program should include the option for addition, deletion and display of employee details.

Ques- 2 Write a menu-based program to add, delete and display the record of hostel using list as
stack data structure in python. Record of hostel contains the fields: Hostel number, Total Students
and Total Rooms.

Ques-3 Consider a dictionary with keys as course name and fee as value. Write a program
to push course name in stack where fee is more than 10000. Pop and display contents of
stack on the screen.

Ques-1 Consider the following tables Product and Client. Write SQL commands for the
statements (i) to (iii) and give outputs for SQL queries (iv) to (v)

Table: PRODUCT
P_ID Product Name Manufacturer Price
TP01 Talcum Powder LAK 40
FW05 Face Wash ABC 45
BS01 Bath Soap ABC 55
SH06 Shampoo XYZ 120
FW12 Face Wash XYZ 95

Table: CLIENT
C_ID Client Name City P_ID
01 Cosmetic Shop Delhi FW05
06 Total Health Mumbai BS01
12 Live Life Delhi SH06
15 Pretty Woman Delhi FW12
16 Dreams Bengaluru TP01

(1) To display the details of those Clients whose city is Delhi


(2) To display the details of Products whose Price is in the range of 50 to 100(both values included).
(3) To display the details of those products whose name ends with ‘Wash’.
(4) SELECT DISTINCT CITY FROM CLIENT;
(5) SELECT Product Name, Price *4 FROM PRODUCT;
Ques-2 consider the following tables PRODUCTS and SUPPLIERS. Write SQL commands for
the statements (i) to (iii) and give outputs for SQL queries (iv) to (v)

Table: PRODUCTS
PID PName QTY PRICE COMPANY SUBCODE
101 DIGITAL CAMERA 14X 120 12000 RENIX S01
102 DIGITAL PAD 11i 100 22000 DIGI POP S02
104 PEN DRIVE 16 GB 500 1100 STOREKING S01
106 LED SCREEN 32 70 28000 DISPEXPERTS S02
105 CAR GPS SYSTEM 60 12000 MOVEON S03

Table: SUPPLIERS
SUBCODE SNAME CITY
S01 GET ALL INC KOLKATA
S03 EASY MARKET CORP DELHI
S02 DIGI BUSY GROUP CHENNAI

(i) To arrange and display all the records of table Products on the basis of product name in the
ascending order.
(ii) To display product name and price of all those products whose price is in the range of 10000
and 15000(both values inclusive).
(iii) To display the names of those Suppliers who are either from DELHI or from CHENNAI.
(iv) SELECT DISTINCT SUPCODE FROM PRODUCTS;
(v) SELECT MAX(PRICE), MIN(PRICE) FROM PRODUCTS;

Also practice similar type of questions from Book/study material

You might also like