Computer Science report file questions
Computer Science report file questions
Q 18) Write a function in python Push(Arr),Where Arr is the list of numbers divisible by 5 into a stack
implemented by using a list. Display the stack if it has at least one element, otherwise display
appropriate message.
Table Job
Write SQL queries for the following
(i) To display employee ids, names of employees, job ids with corresponding jobtitles.
(ii) To display names of employees,sales and corresponding job titles who have achieved
sales more than 1300000.
(iii) To display names and corresponding job titles of those employees who have Singh
(anywhere) in there names.
(iv) Identify foreign key in the table.
(v) Write SQL command to change the JOBID to 104 of the Employee with ID as E4 in the table
Employee .
Q 20) In the given table ‘student’ write SQL queries to perform following operations.
Table : Student
(i) Add a new field (column name school_name )of datatype varchar(50)
(ii) Update the table by updating school _name as ‘ABC Public School’
(iii) Display the all the records by increasing order of class
(iv) Delete all the records where game is ‘basketball’
(v) Display total number of students of every game individually
Q 21) Consider the following tables. Write SQL commands for the statements (i) to (v).
Table : SENDER
SenderID SenderName SenderAddress SenderCity
ND01 R Jain 2, ABC Appts New Delhi
MU02 H Sinha 12, Newtown Mumbai
MU15 S Jha 27/A, Park Street Mumbai
ND50 T Prasad 122-K, SDA New Delhi
Table :RECIPIENT
RecID SenderID RecName RecAddress RecCity
KO05 ND01 R Bajpayee 5, Central Avenue Kolkata
ND08 MU02 S Mahajan 116, A Vihar New Delhi
MU19 ND01 H Singh 2A, Andheri East Mumbai
MU32 MU15 P K Swamy B5, C S Terminus Mumba
ND48 ND50 S Tripathi 13, B1 D, New Delhi
Mayur Vihar
Q 22) In the given table ‘student’ write SQL queries to perform following operations.
Table : Student
Q 23) Find output for SQL queries (i) to (iv), which are based on tables TRANSPORT and TRIP.
Table : TRANSPORT
Table : TRIP
(i) SELECT SUM(KM) WHERE TRIP.TCODE>=104;
(ii) SELECT COUNT(*), TCODE FROM TRIP GROUP BY TCODE HAVING count(*)>1;
(iii) SELECT DISTINCT(TCODE) FROM TRIP;
(iv) SELECT A.TCODE,NAME,TTYPE FROM TRIP A, TRANSPORT B WHERE A.TCODE=B.TCODE AND KM<90;
(v) SELECT NAME, KM*PERKM FROM TRIP A, TRANSPORT B WHERE A.TCODE=B.TCODE AND A.TCODE=105;
Q 24) #program to connect Python with MySQL using database connectivity and perform the following
operations:
Display all records or individual record of table STUDENT in Database SCHOOL with following structure
Stu_no int Primary Key
Sname varchar(25)
Percent int
Q 25) #Program to connect python to mysql using database connectivity and update Sname of table
STUDENT in database SCHOOL.
Q 26) #Program to connect python to mysql using database connectivity and delete record of a student
From table STUDENT in database SCHOOL.