0% found this document useful (0 votes)
13 views4 pages

Model Practical

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views4 pages

Model Practical

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

Class 12 Computer science

PYTHON PROGRAMS
1. Write a python program to create a stack called Employee, to perform the basic
operations on stack using list. The list contains two values – employee number and
employee name.
2. Write a menu driven program using binary file
Insert Student Record (Rollno, Name, Marks)
Display Record
Exit

3. Write a menu driven program using binary file


Insert Student Record (Rollno, Name, Marks)
Search based on Roll no
Exit
4. Write a python program to read the content of text file and display the total number of
consonants, vowels, upper case letters, lower case letters, digits and special characters.
5. Write a program to create CSV file and store empno, name, salary and search any
empno and display name, salary and if not found appropriate message

MYSQL PROGRAMS
1) Write SQL command based on following 2 tables.-Handsets, Customer

(1) Display Hand sets in descending order of PhoneCost.


Select setName from HandSets order by PhoneCost desc;

(2) Display information of all Nokia handsets.


Select * from HandSets where setCode like “%Nokia%”;

(3) Find total number of customers in Delhi


Select count(*) from Customer where CustAddress = “Delhi”;
(4) Delete information of non TouchScreen types from table Hansets.
Delete from Handsets where TouchScreen =”N”;

(5) Display CustNo, CustAddress and corresponding SetName for each customer.
Select CustNo, CustAddress,SetName from Customer,Handsets where Handsets.SetCode = Customer.SetNo;

(2) Write SQL command based on following 2 tables- Doctors, Patients


DOCTORS
DocID DocName Department OPD_Days
101 M.Panday ENT TTS
102 G.P.Gupta Paed MWF
201 C.K.Sharma Ortho MWF
PATIENTS
PatNo PatName Department DocID
1 Neeraj ENT 101
2 Mohit Ortho 201
3 Ragini ENT 101
4 Mohit Paed 102
5 Nandini Ortho 201
1) Display Doctor names in ascending order of names.
Select DocName from DOCTORS order by DocName;

2) Display Total numbers of patients admitted in ENT Department.


Select count(*) from PATIENTS where Department= “ENT”;

3) Include an additional attribute DateOfAdmn in Patients table


Alter table PATIENTS add DateOfAdmn date;

4) Display Doctors name ending with “a”.


Select DocName from DOCTORS where DocName like “%a”;

5) Display PatNo, PatName, DocName for each patient.


Select PatNo, PatName, DocName from DOCTORS,PATIENTS where DOCTORS.DocID=PATIENTS.DocID;

(3) Write SQL command based of following 2 tables.- Voter, Candidate

VOTER-ID VOTER-NAME CANDIDATE-ID


101 PARASU 1001
102 MERCHANT 1001
103 OLIVER 1002
104 NIXON 1003
CANDIDATE
CANDIDATE-ID CANDIDATE-NAME NOOFVOTES
1001 RICHIN 20
1002 PATRICK 22
1003 WINCHURCH 16
1) Display the candidates in descending order of votes obtained.
Select CANDIDATE-NAME from CANDIDATE order by NOOFVOTES desc;

2) Display number of candidates in the Candidate table.


Select count(*) from CANDIDATE;

3) Display Voter Names ends with “R”.


Select VOTER-NAME from VOTER where VOTER-NAME like “%R”;

4) Include an additional attribute “ CANDIDATE-ADDRESS” in Candidate table.


Alter table CANDIDATE add CANDIDATE-ADDRESS varchar(40);

5) Display Voter-Name for Each candidate.


Select VOTER-NAME from VOTER ,CANDIDATE where VOTER.CANDIDATE-ID =
CANDIDATE.CANDIDATE-ID;

(4) Write SQL command based on following 2 tables-Books, Publisher

BOOK-ID TITLE PRICE


101 DATA BASE MANAGEMENT SYSTEM 743
102 MANAGEMENT INFORMATION SYSTEM 1200
103 OLIVERS’ TRAVEL 540
104 WAR AND PEACE 378

PUBLISHER
PUBLISHER-ID PUSLISHER-NAME BOOK-ID
1001 TATA MCGRAW HILL 101
1002 OXFORD PRESS 102
1003 UNIVERSITY PRESS 104

1) Display the Books in descending order of price.


Select TITLE from BOOKS order by PRICE desc;

2) Display number of Books in the BOOKS table.


Select count(*) from BOOKS;

3) Display Publisher Name ends with “PRESS”.


Select PUSLISHER-NAME from PUBLISHER where PUBLISHER-NAME like “%PRESS”;

4) Include an additional attribute “DATE-OF-PUBLICATION” in PUBLISHER table;


Alter table PUBLISHER add DATE-OF-PUBLICATION date;

5) Display Books information with their Publisher name.


Select BOOKS.*,PUBLISHER-NAME from BOOKS,PUBLISHER where BOOKS.BOOK-ID =
PUBLISHER.BOOK-ID;

(5) Write SQL command based of following 2 tables.


ITEM-ID ITEMNAME
101 TRANSPORT ACCESSORIES
102 COMPUTER ACCESSORIES
103 BUILDING MATERIALS
104 FURNITURE ITEMS
SUPPLIER
SUPPLIER-ID SUPPLIER-NAME CITY ITEM-ID
1001 AJAY & CO MUMBAI 101
1002 PURI BROTHERS DELHI 102
1003 ROYAL FURNITURE CHENNAI 104

1)Display the Items in alphabetical order.


Select ITEMNAME from ITEM order by ITEMNAME;

2) Display number of items in the ITEM table.


Select count(*) from ITEM;

3) Display ITEMNAME ends with “ACCESSORIES”.


Select ITEMNAME from ITEM where ITEMNAME like “%ACCESSORIES”;

4) Include an additional attribute “REORDERLEVEL” in ITEMS table;


Alter table ITEM add REORDERLEVEL varchar(20);

5) Display SUPPLIER details of each Item.


Select SUPPLIER.* from ITEM,SUPPLIER where ITEM.ITEM-ID = SUPPLIER.ITEM-ID;

You might also like