0% found this document useful (0 votes)
29 views

Final Cs

This document is a computer science practical file submitted by a student named Gaurav in class 12. It contains an acknowledgement expressing gratitude to the teacher and parents for their support. It also includes a certificate signed by the teacher certifying that the student has completed all the practical assignments satisfactorily. The main body of the file includes implementations of various data handling, stack, SQL, and Python-SQL integration programs along with inputs and outputs.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Final Cs

This document is a computer science practical file submitted by a student named Gaurav in class 12. It contains an acknowledgement expressing gratitude to the teacher and parents for their support. It also includes a certificate signed by the teacher certifying that the student has completed all the practical assignments satisfactorily. The main body of the file includes implementations of various data handling, stack, SQL, and Python-SQL integration programs along with inputs and outputs.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

COMPUTER SCIENCE PRACTICAL FILE

NAME:- GAURAV
CLASS:- xii
Roll no:-
SCHOOL NAME:- NAVYUG SCHOOL S.N
SUBMITTED TO: M.S MENKA SINGH
(PGT C.S)
ACKNOWLEDGEMENT

I WOULD LIKE TO EXPRESS MY SPECIAL


THANKS OF GRATITUDE TO MY COMPUTER
SCIENCE TEACHER M.S MENKA SINGH FOR HER
GUIDANCE AND SUPPORT TO COMPLETE THIS
PRACTICAL FILE. I WOULD ALSO LIKE TO
EXTEND MY GRATITUDE TOWARDS MY
PARENTS WHO ARE A VUNERABLE PART OF MY
WHOLE LIFE GAVE ME EMOTIONAL AS WELL AS
MENTAL SUPPORT TO DO HARDWORK
THROUGHOUT MY HIGH SCHOOL JOURNEY.
JUST BECAUSE OF THEM I WAS ABLE TO FINISH
THIS FILE WITHIN TIME. JUST BECAUSE OF
THEM I WAS ABLE TO PRESENT THIS IN MY
PRACTICAL EXAM. THANKS AGAIN TO ALL WHO
HELPED ME DURING THIS PERIOD OF TIME.
CERTIFICATE
THIS IS TO CERTIFY THAT………………..OF
CLASS/SEC………….HAS SUCCESSFULLY
COMPLETED ALL THE PRACTICAL’S TO MY
SATISFACTION AND SUBMITTED THE SAME
DURING ACADEMIC YEAR 2022-23. THE FILE IS
THE OF HIS EFFORTS & ENDEAVOURS.

MS. ………………….. DATE ………….


(NAME OF TEACHER)
…………………………..
(SIGNATURE OF TEACHER)
DATA HANDLING

PRACTICAL IMPLEMENTATION-1
INPUT:-

OUTPUT:-
PRACTICAL IMPLEMENTATION-2
INPUT:-

OUPUT:-

PRACTICAL IMPLEMENTATION-3
INPUT:-

OUTPUT:-
PRACTICAL IMPLEMENTATION-4
INPUT:-

OUTPUT:-
PRACTICAL IMPLEMENTATION-5
INPUT:

OUTPUT:-

PRACTICAL IMPLEMENTATION-6
INPUT:-

OUTPUT:-
PRACTICAL IMPLEMENTATION-7
INPUT:-

OUTPUT:-

PRACTICAL IMPLEMENTATION-8
INPUT:-

OUTPUT:-
PRACTICAL IMPLEMENTATION-9
INPUT:-

OUTPUT:-
Csv Programs
Practical implementation-1
INPUT:-

OUTPUT:-

EXCEL FILE:- TEXT FILE:-


Practical implementation-2
INPUT:-

OUTPUT:-

Practical implementation-3
INPUT:-

OUTPUT:-
Practical implementation-4
INPUT:-

OUTPUT:-

Practical implementation-5
INPUT:-

OUPUT:-
Practical implementation-6
INPUT:-

OUTPUT:-

EXCEL FILE:-
Practical implementation-7
INPUT:-

OUTPUT:-

EXCEL FILE:-
STACK PROGRAMS

PRACTICAL IMPLEMENTATION-1
INPUT:-

OUTPUT:-
PRACTICAL IMPLEMENTATION-2
INPUT:-

OUTPUT:-
PRACTICAL IMPLEMENTATION-3
INPUT:-

OUTPUT:-
SQL QUERIES
Q 1:- Consider a database LOANS with the following table:
Table : LOANS

( i) Display sum of all Loan Amounts whose interest rate is greater


than 10.
SELECT SUM(LOANAMT) FROM LOANS WHERE
INTEREST>10;
( ii ) Display the maximum Interest from Loans table.
SELECT MAX (INTEREST) FROM LOANS;
(iii ) Display the count of all loan holders whose name ends with
'Sharma'.
SELECT COUNT (*) FROM LOANS WHERE CUSTNAME LIKE
'%SHARMA';
( iv ) Display the count of all loan holders whose interest rate is
Null.
SELECT COUNT (*) FROM LOANS WHERE INTEREST IS
NULL;
( v ) Display the Interest - wise details of Loan Account Holders.
SELECT * FROM LOANS GROUP BY INTEREST;
( vi ) Display the Interest - wise details of Loan Account Holders
with at least 10 installments remaining.
SELECT * FROM LOANS GROUP BY INTEREST HAVING
INSTALLMENTS>=10;
Q2:- Consider the following tables Product and Client. Write SQL
commands for the statements ( i ) to ( iii ) and give outputs for
SQL queries ( iv ) to ( vi ).

( i ) To display the details of those clients whose city is Delhi.


SELECT * FROM CLIENT WHERE CITY ='DELHI';
( ii ) To display the details of Products whose price is in the range
of 50 (both values included).
SELECT * FROM PRODUCT WHERE PRICE BETWEEN 50
AND 100;
( iii ) To display the details of those products whose name ends
with ' Wash ' .
SELECT * FROM PRODUCT WHERE PRODUCTNAME LIKE
'%WASH';
( iv) SELECT DISTINCT CITY FROM CLIENT;

(v) SELECT MANUFACTURER , MAX(PRICE) , MIN(PRICE) ,


COUNT(*) FROM PRODUCT GROUP BY MANUFACTURER;

(vi) SELECT PRODNAME,PRICE*4 FROM PRODUCT;


Q 3:- Consider the following tables : COMPANY and MODEL .
Table : COMPANY

Table : MODEL

( i ) To display details of all models in the Model table in


ascending order of DATEOFMANUFACTURE.
SELECT * FROM MODEL ORDER BY
DATEOFMANUFACTURE;
( ii ) To display details of those models manufactured in 2011 and
whose COST is below 2000.
SELECT * FROM MODEL WHERE YEAR
(DATEOFMANUFACTURE) = 2011 AND COST
( iii ) To display the MODID , COMPID , COST from the table
MODEL , COMPNAME and CONTACTPERSON from COMPANY
table , with their corresponding COMPID .
SELECT MODID,COMPID,COST , COMPNAME
CONTACTPERSON FROM MODEL , COMAPNY WHERE
MODEL . COMPID = COMPANY . COMPID;
( iv ) To decrease the cost of all the models in Model table by
15%.
UPDATE MODEL SET COST - COST - 0.15 * COST ;
( v ) SELECT COUNT(DISTINCT COMPHO) FROM COMPANY;

(vi) SELECT COMPNAME, 'MR.', CONTACTPERSON FROM


COMPANY WHERE COMPNAME LIKE '%a';

Q 4:- Consider the following two tables : STATIONERY and


CONSUMER .
Table : STATIONERY

Table : CONSUMER
( i ) To display details of all the Stationery items in the Stationery table in
descending order of STOCKDATE.
SELECT * FROM STATIONERY ORDER BY STOCKDATE DESC ;0020
( ii ) To display details of that Stationery item whose company is XYZ and
price is below 10.
SELECT * FROM STATIONERY WHERE COMPANY = ' XYZ ' AND
PRICE < 10 ;
( iii ) To display CONSUMERNAME, ADDRESS from the table
CONSUMER and COMPANY and PRICE from STATIONERY table, with
their corresponding SID.
SELECT CONSUMERNAME , ADDRESS , COMPANY, PRICE FROM
CONSUMER , STATIONERY WHERE CONSUMER.PID =
STATIONERY.SID ;
( iv ) To increase the price of all the stationery items in STATIONERY table
by Rs.2 .
UPDATE STATIONERY SET PRICE = PRICE + 2 ;
( v ) SELECT COUNT (DISTINCT ADDRESS) FROM CONSUMER;

( vi ) SELECT STATIONERYNAME , price *3 from STATIONERY WHERE


COMPANY=' CAM ';
Q 5 :- CONSIDER THE FOLLOWING TABLES : STOCK AND DEALER.
Table: STOCK

Table: DEALER

( i ) To display details of all the Items in the STOCK table in


ascending order of STOCKDATES.
SELECT * FROM STOCK ORDER BY STOCKDATE;
( ii ) To display details of those Items in STOCK table whose
Dealer Code ( DCODE ) is 102 or quantity in STOCK ( QTY ) is
more than 100.
SELECT * FROM STOCK WHERE DCODE=102 OR QTY>100;
( iii ) Insert a record in the STOCK table with the values : ( 5010 , '
PENCIL HB ' ,102,500,10,' 2010-01-26 ' )
INSERT INTO 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 )
SELECT DEALER.DCODE , DNAME , ITEM , UNITPRICE
FROM DEALER LEFT JOIN STOCK ON DEALER . DCODE =
STOCK.DCODE;
( v ) SELECT COUNT (DISTINCT DCODE) FROM STOCK;

(vi) SELECT QTY*UNITPRICE FROM STOCK WHERE


ITEMNO=5006;
INTERFACE PYTHON WITH SQL

IMPLEMANTATION-1
Input:

Output:
IMPLEMANTATION-2
Input:

Output:
IMPLEMANTATION-3

Input:

Output:
IMPLEMANTATION-4
Input:

Output:
IMPLEMANTATION-5
Input:

Output:
IMPLEMANTATION-6

IMPLEMANTATION-7
Input:

Output:

You might also like