CS Programmes
CS Programmes
V public school
ashok vihar phase-iv delhi
Computer
science
With Python
Practicle file
Session[2023-2024]
Name: Naki Imam
Class: XII-A
Roll No. :
INDEX OF COMPUTER SCIENCE
PRACTICAL FILE
01 Revision tour
02 function
This chapter deals with all the concept taught in class 11 that are basic for
python language
This chapter deals with defining and creating sub programs and functions
This chapter deals with programs libraries modules related to text file
1. Program to read & print the lines having length more than 50 in text files
5. Find the total no. of lines & total no. of words in a text file
6. Program to read & print the words having length more than 7 from text file
8. Program to make a copy file of only those lines starting with uppercase letters
Program to append employees in the record and search those employees having salary
9.
more than 15000
binary file
This chapter deals with programs libraries modules related to binary file
1. Program for writing & reading students’ record in a binary file. (METHOD-1)
2. Program for writing & reading students’ record in a binary file. (METHOD-2)
3. Program to push, pop , and display name and ID of the book in stack of book
4. Program to push,pop & display name and marks of students in stack of students
STACK
IMPLEMENTATION
This chapter deals with the new algorithms
SQL (Structured Query Language) is a domain-specific language used for managing and
querying relational databases, facilitating data storage, retrieval, and manipulation.
6. DATABASE CONNECTIVITY
01
REVISION TOUR
Sort a list
FUNCTION
Finding area of different
shapes using functions
TEXT FILE
Program to read & print the lines
having length more than 50 in
text files
output
output
output
output
output
output
output
Copied file
output
BINARY FILE
Program for writing &
reading students’ record in a
binary file. (METHOD-1)
Initial
Entries
output
Initial
Source code entries
Program for updating
a record in a binary
file
output
Initial file
Source code data
Program to store Gmeet
Info in binary files
CSV FILE
Program to reading a
csv file
output
output
DATABASES
LOANs TABLE
(I) Display the sum of all Loan Amounts whose interest rate is greater than
10.
Ans: Mysql> SELECT SUM(Loan_Amount) FROM LOANS WHERE Int_Rato>10;
(iii) Display the count of all loan holders whose name ends with 'Sharma’.
Ans: Mysql> SELECT COUNT(*) FROM LOANS WHERE Cust_Name LIKE ‘%Sharma’;
(iv) Display the count of all loan holders whose Interest rate is Null.
Ans: Mysql> SELECT COUNT(*) FROM LOANS WHERE Int_Rate IS NULL;
(i) TO display details Of all models in the Model table in ascending order Of
dateOf Manufacture
Ans: SELECT * FROM Model ORDER BY DATEOfManufacture;
(ii) TO display details Of those models manufactured in 2011 and whose
Cost is below 2000
Ans: SELECT * FROM Model WHERE year(DateOfManufacture)=2011 And Cost<2000;
(iii) To display the Model_ID, C_ID, Cost from the table Model, Compname
and ContactPerson from Company table. with their corresponding comp_lD.
Ans: SELECT Model _ ID, C_ID, Cost, CompName, ContactPerson FROM Model,
Company WHERE MODEL .C_ID = Company.C_ID;
(iv) To decrease the cost of all the models in Model table by 15%.
Ans: UPDATE Model SET Cost = Cost - 0.15*Cost;
(v) To display total number of records in the Company table on the basis of
CompHO with no duplicate values.
Ans: SELECT COUNT(DISTINCT CompHO) FROM Company;
stock table
ItemNo Item Dcode Qty UnitPrice StockDate
(i) To display details of all models in the Stock table in ascending order of
Stock Date
Ans: SELECT * FROM Stock ORDER BY StockDate;
(ii) TO display details Of those models whose Dealer Code(Dcode) is 102 or
quantity in Stock(Qty) is more than 100.
Ans: SELECT * FROM Stock WHERE Dcode = 102 OR Qty > 100;
(iii) TO insert a record in the Stock table with the values: (5010. 'Pencil HB'.
102. 500. 10. '2010-01-26')
Ans: INSERT INT0 Stock VALUES (5010, 'Pencil HB', 102, 500, 10, '2010-01-26’);
(iv) TO display Dcode, Dname from Dealer table and Item. UnitPrice from
Stock table of all the Dealers (including the dealer details that have not sold
any item)
Ans: SELECT Dealer, Dcode, Item,UnitPrice FROM Dealer LEFT JOIN Stock ON Dealer.
Dcode = Stock. Dcode
(v) TO display the product of Qty & UnitPrice from the table Stock whose
ItemNo is 5006.
Ans: SELECT Qty*UnitPrice FROM Stock WHERE ItemNo=5006;
carden
-naki imam