cs lab questions
cs lab questions
Q-1 a) Write a menu driven program to perform following operations into a binary file (8)
shoes.dat
Q-1 b) Write SQL command and output for the following queries using the Relation- STU
(4)
Rollno Name Gender Age Dept DOA Fees
a) Write a query to list the names of those students whose name have second
alphabet 'n' in their names.
b) Write a Query to delete the details of Roll number is 8.
c) Write a Query to add a new column Area of type varchar in table STU.
d) Display max price and min price of each company
Set 2
Q-1 a)Write a menu driven python program to create a stack of a student's record which
contains [admo, marks ]. (8)
i)Write function PUSH to add record in to the stack and
ii)Write a function DISPLAY to display those students whose marks greater than 70..
Q-1 b)Write SQL command and output for the following queries using the Relation- STU (4)
Rollno Name Gender Age Dept DOA Fees
d) write a mysql query to add a new column Area of type varchar in table
STU.
SET-3
Q-1 a) Write a program to count a total number of lines and count the total number of
lines starting with 'A', 'B', and 'C' from the file myfile.txt.
Example:
File Contents as given below
Python is super and trending language.
Allows to store the output in the files.
A text file stores textual data.
Binary files can handle binary data.
Binary files use pickle module to store data.
CSV files can handle tabular data.
CSV files can be read easily using CSV reader object.
Program output must be as follows
Total Number of lines are: 7
Total Number of lines starting with A are: 2
Total Number of lines starting with B are: 2
Total Number of lines starting with C are: 2
Q.1 b).Write SQL command and output for the following queries using the Relation- STU (4)
Rollno Name Gender Age Dept DOA Fees
a) Write a Query to insert all the rows of above table into Info table.
b) Write a Query to display all the details of the Employees from the above table 'STU'.
c) Write a query to display Rollno, Name and Department of the students from
STUtable.
d)Implement python interface with mysql to show all information about students of
History department.
SET-4
Q-1 a) Write a program to add students details in CSV file students.csv as mentioned in below
table format , and print them with tab delimiter. Ignore first row header to print in tabular
form.
Field 1 Data Type
StudentID Integer
StudentName String
Score Integer
Q.1 b).Write SQL command and output for the following queries using the Relation- STU
(4)
Rollno Name Gender Age Dept DOA Fees
a) Write a Query to insert all the rows of above table into Info table.
b) Write a Query to display all the details of the Employees from the above table 'STU'.
c) Write a query to display Rollno, Name and Department of the students from
STUtable.
d)Implement python interface with mysql to show all information about students of
History department.