Sie sind auf Seite 1von 10

Instructions

1. Execute the C++ program on computer. Take its printout with output.
2. Write the SQL query answers on the sheet after checking them on the computer.

Set-1

Q.1 Write SQL command for the queries given from (a) to (e) based on a
relation CLUB:
Relation : CLUB
Mcode Mname Sex Age Fees Type
1 Ashish Male 35 7000 Monthly
2 Anannya Female 25 8000 Monthly
3 Gitika Female 42 24000 Yearly
(a) To display Mname, Age, Fees of those members of the CLUB whose
Fees is between 6000 to 10000.
(b) To display Mcode, Mname, Age of all female members of the CLUB
with Age in descending order.
(c) To display Mname, Age, Type of members of the CLUB with Mname in
ascending order.
(d) To display Mname, Fees of all those members of the CLUB whose Age
< 40 and are Monthly Type members of the CLUB.
(e) To insert a new tuple in the table CLUB with the following data :
11, “Keshav”, “Male”, 27, 600, “Guest”

Q.2 Declare a class containing


- Eno
- Name
- Salary
- And required functions
Write a menu driven program
- To create an array of 10 employees
- To display the record in ascending order of salary

1
Instructions

1. Execute the C++ program on computer. Take its printout with output.
2. Write the SQL query answers on the sheet after checking them on the computer.

Set-2

Q.1 Write SQL commands for the queries for the questions given from (a)
to (e )
Relation : TRAIN
No. TNo Name Class SeatNo Age Fare
1 S0001 ANU I 11 16 700
2 S0002 SAGAR AC-CHAIR 34 43 1300
3 S0003 SAMIR AC-I 2 78 9000

(a)To display the Name and Seat No. where Class is II.
(b)To display TNo and SeatNo where the Fare is > 1300.
(c) To display list of passengers having Name starting with ‘A’ in ascending
order of TNo
(d)To display the highest amount paid as Fare .
(e)To display the distinct TNo.

Q.2 Declare a class containing


- Name
- Address
- Telephone no
Write a menu driven program to
- append record in a file
- display the name and address for a given telephone number
- display the tabular list of the customers

2
Instructions

1. Execute the C++ program on computer. Take its printout with output.
2. Write the SQL query answers on the sheet after checking them on the computer.

Set-3
Q.1 Write SQL commands for the queries (a) to (e ) based on a relation
SHOP shown below
Relation : SHOP
No. Shop_name Sale Area Cust_Percent Rating City
1. S. M. Sons 250000 West 68.6 C Delhi
2. Dharohar 500000 South 81.8 A Mumbai
3. Kriti Art 300000 North 79.8 B Kolkata

(a) To display the names of all shops which are in the South.
(b) To display name and Customer Percentage of all the shops having
cust_percent > 80
(c) To display list of all the shops with sale > 300000 in ascending order of
Shop_Name.
(d) To display a report with Shop_name, Area and Rating for each shop in
the table, for only those shops whose sale is between 350000 and
400000 (including both 350000 and 400000).
(e) To display the distinct cities.

Q,2 A class student has three data members and few member
functions
- Name
- Rollno
- Marks
Write a menu driven program
- to create a file
- to print the stream according to the total marks of the
student
o 96 or more computer sc.
o 91-95 Electronics
o 86-90 Mechanical
o 81-85 Electrical
o 76-80 Chemical
- to print the tabular list of students

3
Instructions

1. Execute the C++ program on computer. Take its printout with output.
2. Write the SQL query answers on the sheet after checking them on the computer.

Set-4

Q.1 Write SQL commands for the queries (a) to (e ) based on a relation
STUDENT
Relation : STUDENT
No. Name Stipend Stream AvgMark Grade Class
1 Neha 450.00 Medical 89.2 A 11C
2 Damini 400.00 Commerce 78.5 B 12B
3 Gaurav 250.00 Humanities 64.4 C 11A

(a)To display the names of all students who are in Medical Stream.
(b)To display name and average of all the students having AvgMark < 70.0.
(c) To display list of all the students with Stipend > 350.00 in ascending order
of Name.
(d)To display Name, Marks for all the students having Name started with N.
(e)To display the Stream and stipend in the descending order of stipend.

Q.2 Declare a class Sports having


- sno
- sname
- fees
- required functions
Write a menu driven program
- to append record in a file
- delete the record of given sno
- print the tabular list of the member

4
Instructions

1. Execute the C++ program on computer. Take its printout with output.
2. Write the SQL query answers on the sheet after checking them on the computer.

Set-5

Q.1 Write SQL commands for the queries given from (a) to (e ) based on
a relation LIBRARY
Relation : LIBRARY
No Title Author Subject Publisher Quantity Price
1 Data Structure Lipschute DS McGraw 4 217.00
2 DOS Guide NORTRON OS PHI 3 175.00
3 Turboc C++ Robort Lafore Prog Galgotia 5 270.00

(a)To display the title of all books with Price between 100 and 300.
(b)To display Title and Author of all the books having type Prog and publisher
by BPB.
(c) To display list of all the books with price more than 130 in ascending order
of Qty.
(d)To display Title, Author for each book in the table whose author name start
with N..
(e)To display the publishers and and author in the ascending order of the price.

Q.2 Each node of STACK contain


- Empno
- name
- Pointer field
TOP is the first node of STACK.
Write a menu driven program
- To push
To pop

5
Instructions

1. Execute the C++ program on computer. Take its printout with output.
2. Write the SQL query answers on the sheet after checking them on the computer.

Set-6

Q.1 Write SQL commands for the queries for the questions given from (a)
to (e )
Relation : TRAIN
No. TNo Name Class SeatNo Age Fare
1 S0001 ANU I 11 16 700
2 S0002 SAGAR AC-CHAIR 34 43 1300
3 S0003 SAMIR AC-I 2 78 9000

(a)To display the Name and Seat No. where Class is II.
(b)To display TNo and SeatNo where the Fare is > 1300.
(c) To display list of passengers having Name starting with ‘A’ in ascending
order of TNo
(d)To display the highest amount paid as Fare .
(e)To display the distinct TNo.

Q.2 Each node of STACK contain


- Rollno
- Age
- Pointer field
TOP is the first node of STACK.
Write a menu driven program
- To push
To pop

6
Instructions

1. Execute the C++ program on computer. Take its printout with output.
2. Write the SQL query answers on the sheet after checking them on the computer.

Set-7

Q.1 Write SQL commands for the queries (a) to (e ) based on a relation SHOP
shown below :
Relation : SHOP
No. Shop_name Sale Area Cust_Percent Rating City
1. S. M. Sons 250000 West 68.6 C Delhi
2. Dharohar 500000 South 81.8 A Mumbai
3. Kriti Art 300000 North 79.8 B Kolkata
(a)To display the names of all shops which are in the South.
(b)To display name and Customer Percentage of all the shops having
cust_percent > 80
(c) To display list of all the shops with sale > 300000 in ascending order of
Shop_Name.
(d)To display a report with Shop_name, Area and Rating for each shop in the
table, for only those shops whose sale is between 350000 and 400000
(including both 350000 and 400000).
(e)To display the distinct cities.

Q.2 A blood bank maintains the record of donor: name, address, blood
group. Write a menu driven program
- create file of donor
- print the name of all the donors having given blood group
- print the tabular list of donors.

7
Instructions

1. Execute the C++ program on computer. Take its printout with output.
2. Write the SQL query answers on the sheet after checking them on the computer.

Set-8

Q.1 Write the SQL for (a) to (e) on the basis of the table HOSPITAL.
TABLE : HOSPITAL
No. Name Age Department Dateofadm Charges Sex
1 Sandeep 65 Surgery 23/02/98 300 M
2 Ravina 24 Orthopaedics 20/01/98 200 F
3 Karan 45 Orthopaedics 19/02/98 200 M

(a)To show all information about the patients of cardiology department.


(b)To list the name of female patients who are in orthopaedic department.
(c) To list names of all patients with their date of admission in ascending order.
(d)The display Patient’s Name, charges, age for male patients only.
(e)To count the number of patients with age>20.

Q.2 Declare a class item containing


- Bno
- Bname
- Price
- And required functions
Write a menu driven program
- to add record in a file
- to modify the price of the given Bno
- to print the tabular list if the items

8
Instructions

1. Execute the C++ program on computer. Take its printout with output.
2. Write the SQL query answers on the sheet after checking them on the computer.

Set-9

Q.1 Write the SQL commands for delete (a) to (e )


TABLE : STUDENT
No. Name Age Department Dateofadm Fees Sex
1 Pankaj 24 Computer 10/01/97 120 M
2 Shalini 21 History 24/03/98 200 F
3 Sanjay 22 Hindi 12/12/96 300 M

(a)To show all information about the students of history department.


(b)To list the name of female students who are in Hindi department.
(c) To list names of all students with their date of admission in ascending order.
(d)To display Student’s Name, charges, age for male students only.
(e)To count the number of students with age>23.

Q.2 Write a program to display the report card of any student and also
print the tabular reportof the whole class in ascending order of total marks.
(Use Class: Roll, Name , Mark1, Mark2, Mark3, Total)

9
Instructions

1. Execute the C++ program on computer. Take its printout with output.
2. Write the SQL query answers on the sheet after checking them on the computer.

Set-10

Q.1 Write SQL commands for the queries for the questions given from (a)
to (e ) based on a relation TRAIN below :
Relation : TRAIN
No. TNo Name Class SeatNo Age Fare
1 S0001 ANU I 11 16 700
2 S0002 SAGAR AC-CHAIR 34 43 1300
3 S0003 SAMIR AC-I 2 78 9000

(a)To display the Name and Seat No. where Class is II.
(b)To display TNo and SeatNo where the Fare is > 1300.
(c) To display list of passengers having Name starting with ‘A’ in ascending
order of TNo
(d)To display the highest amount paid as Fare .
(e)To display the distinct TNo.

Q.2 A bank maintains the record of donor: name, address, current balance.
Write a menu driven
program
- create file of customer
- print the tabular list of all the customer
- Print the address of giuven customer name

10

Das könnte Ihnen auch gefallen