You are on page 1of 6

AISSCE 2013-14

COMPUTER SCIENCE PRACTICAL 083

List of C++ Programs


P1: Program do display the working of nested structure
P2: Program to process the result of a student using structure having array
inside
P3: Program to store the details of Items in an array and find the sum of all
prices and maximum
price using class and objects.
P4: Program to calculate Simple Interest by function overloading
P5: Program to display the working of Constructor and Destructor in Multiple
Inheritance
P6: Program to exchange the position of strings using array of pointers.
P7: Program to read and write class objects on a binary file
P8: Program to update records in a binary file
P9: Program to search for a record in a binary file
P10: Program to delete records from a binary file
P11: Program to perform various operations on a Text file.
P12: Program to sort an array using Insertion sort methods.
P13: Program to sort an Array using either Selection sort or Bubble sort
P14: Program to perform Linear or Binary Search on an Array.
P15: Program to perform push and pop operation on a Linked Stack.
P16: Program to perform push and pop operation on a Array Stack.
P17: Program to perform insertion and deletion operation on a Linked Queue.
P18: Program to perform insertion and deletion operation on a Array Queue.

P19: Program to perform insertion and deletion operations on a Circular


Queue.

List of SQL Questions


Q1. Write the SQL queries and outputs for the APPLICANTS and COURSES table:
Table: APPLICANTS
Table: Courses
GENDE
R

C_I
D

NO

NAME

FEE

JOINYEAR

101
2
1102
1103
1049
1025
1106
1017
1108
2109
1101

Amandeep
Avisha
Ekant
Arun
Amber
Ela
Nikita
Arleena
Shakti
Kirat

30000
25000
30000
30000
40000
40000
35000
30000
35000
25000

a)

To display name, fee, gender, joinyear about the applicants, who have joined before

M
A01
2012
F
A02
2009
M
A02
2011
M
A03
2009
COURSE
M C_ID A02
2011
A01
FASHION
DESIGN
F
A05
2010
A02
NETWORKING
F
A03
2012
A03
HOTEL
F
A03 MANAGEMENT
2012
A04
EVENT
M
A04 MANAGEMENT
2011
A05
OFFICE
M
A01 MANAGEMENT
2012

2010.
b)

To display the names of applicants in descending order, who are paying fee more

than 30000.
c)

To display names of all applicants in ascending order of their joinyear.

d)

To display the year and the total number of applicants joined in each YEAR from the
table APPLICANTS.

e)

To display the C_ID (i.e. Course ID) and the number of applicants registered in the
course from the APPLICANTS table.

f)

To display the applicants name with their respective courses name from the tables
APPLICANTS and COURSES.

g)

Give the output of following SQL statements:


i)

SELECT name, joinyear FROM APPLICANTS


WHERE gender= F AND c_id= A02;

ii)

SELECT min(joinyear) FROM APPLICANTS


WHERE gender= M;

iii)

SELECT avg(fee) FROM APPLICANTS


WHERE c_id = A01 OR c_id = A05;

iv)

SELECT sum(fee), c_id FROM APPLICANTS


GROUP BY c_id
HAVING count(*) = 2;

Q2. Write the SQL queries and outputs for the EMPLOYEES and EMPSALARY table:
Table: EMPLOYEES
Empi
d
Firstname Lastname Address
City
10
Ravi
Kumar
Raj nagar
GZB
105
Harry
Waltor
Gandhi nagar
GZB
152
Sam
Tones
33 Elm St.
Paris
215
Sarah
Ackerman
440 U.S. 110
Upton
244
Manila
Sengupta
24 Friends street
New Delhi
300
Robert
Samuel
9 Fifth Cross
Washington
335
Ritu
Tondon
Shastri Nagar
GZB
400
Rachel
Lee
121 Harrison St.
New York
441
Peter
Thompson
11 Red Road
Paris
Table: EMPSALARY
Empi
d
10
105
152
215
244
300
335
400
441

Salary
75000
65000
80000
75000
50000
45000
40000
32000
28000

Benefits
15000
15000
25000
12500
12000
10000
10000
7500
7500

Designation
Manager
Manager
Director
Manager
Clerk
Clerk
Clerk
Salesman
Salesman

a)

To show firstname, lastname, address and city of all employees living in Paris.

b)

To display the content of those employees whose Firstname contain t as third letter in
descending order of Firstname.

c)

To display the Firstname, Lastname and total salary of all managers from the tables
Employees and Empsalary, where total salary is calculated as Salary + Benefits

d)

To display the maximum salary among managers and clerk from the table Empsalary.

e)

To display the number of Clerks working in the company.

f)

To display the Firstname, Lastname and respective Designation from Employee and
Empsalary table.

g)

Give the output of following SQL statements:


i)

SELECT Firstname, Salary FROM Employees, Empsalary

WHERE Designation = Salesman AND Employees.Empno =


Empsalary.Empno;
ii)

SELECT count(DISTINCT Designation) FROM Empsalary;

iii)

SELECT Designation, sum(Salary) FROM Empsalary


GROUP BY Designation
HAVING count(*) > 2;

iv)

SELECT sum(Benefits) FROM Empsalary


WHERE Designation = Clerk;

Q3. Write the SQL queries and outputs for the CARDEN and CUSTOMER table:
Table: CARDEN
Ccod
e
501
503
502
509
510

Charges
CarName
A-Star
Indigo
Innova
SX4
C Class

Make
Suzuki
Tata
Toyota
Suzuki
Mercedes

Color
Red
Silver
White
Silver
Red

Capacity
3
3
7
4
4

14
12
15
14
35

Table: CUSTOMER
CustCo
de
1001
1002
1003
1004

Cname
Hemant Sahu
Raj Lal
Feroza Shah
Ketan Dhal

Ccode
501
509
503
502

a)

To display the names of all the silver colored cars.

b)

To display name of car, make and capacity of cars in descending order of their sitting
capacity.

c)

To display the highest charges at which a vehicle can be hired from CARDEN.

d)

To display the customer name and the corresponding name of the cars hired by them.

e)

To display the records of those cars whose Make is ending with a.

f)

To display the name of car hired by Ketan Dhal.

g)

Give the output of following SQL statements:


i)

SELECT Count(Distinct Make)


FROM Carden;

ii)

SELECT Max(Charges), Min(Charges)


From Carden;

iii)

SELECT Count(*), Make

FROM Carden
GROUP BY Make;
iv)

SELECT CarName
FROM Carden
WHERE Capacity = 4;

You might also like