CSA Assignment Questions(b)
CSA Assignment Questions(b)
2311178
A university database contains information about professors
(identified by social security number, or SSN) and courses 2311215
(identified by courseid). Professors teach courses; each of the 2311216
following situations concerns the Teaches relationship set. For
each situation, draw an ER diagram that describes it (assuming no 2311217
1 further constraints hold). 2311218
1. Professors can teach the same course in several semesters, and each 2311219
offering must be recorded.
G1
2. Professors can teach the same course in several semesters, and only
the most recent such offering needs to be recorded. (Assume this
condition applies in all subsequent questions.)
5. Every professor teaches exactly one course (no more, no less), and
every course must be taught by some professor.
1
DEPARTMENT OF COMPUTER APPLICATIONS
D – Deposit, W – Withdrawal
Question (A)
Question (B)
Question (C)
Develop a SQL query to list the details of customers who
Question (E)
Develop a SQL query to list the details of branches where the number
of accounts is less than the average number of accounts in all
branches.
Question (F) Develop a SQL query to list the details of customers who
have performed three transaction on a day. Question (G)
Create a view that will keep track of branch details and the number of
accounts in each branch.
2
DEPARTMENT OF COMPUTER APPLICATIONS
2311226
Question 3
2311227
Consider the following relations for an Order 2311228
3 Processing Database application in a Company. 2311230
Customer (Customerno varchar2 (5), Cname varchar2
2311231
2311233
(50));
Key is underlined.
Questions
Question (A)
Question (C)
3
DEPARTMENT OF COMPUTER APPLICATIONS
Question (D)
Develop a SQL query to list details of items whose price is less than
Develop a SQL query to list the orderno and number of items in each
order.
Question (F)
(G)
Question (H)
Create a view that keeps track of detail of each customer and number
of Order placed.
4 2311234
2311235 G4
Study and usage of backup and recovery features of Database
Management software. Create queries for how to create and
recover your lost data. 2311237
2311238
2311241
5 2311242 G5
Question 5: Study and usage of Query Optimization Techniques of
Database Management software.
4
DEPARTMENT OF COMPUTER APPLICATIONS
2311244
2311248
2311249
2311253
2311254
6 2311255 G6
. Question 6: The questions are based on the following relational
schema: Emp(eid: integer, ename: string, age: integer, salary: 2311257
real) Works(eid: integer, did: integer, pcttime: integer) Dept(did:
integer, dname: string, budget: real, managerid: integer) 2311258
percent raise.
7 2311263 G7
Question 1 :Consider the following relations containing airline
flight information: Flights(flno: integer, from: string, to: string, 2311264
distance: integer, departs: time, arrives: time) Aircraft(aid:
integer, aname: string, cruisingrange: integer) Certified(eid: 2311267
integer, aid: integer) Employees(eid: integer, ename: string, 2311268
salary: integer) Note that the Employees relation describes pilots
and other kinds of employees as well; every pilot is certified for 2311269
some aircraft (otherwise, he or she would not qualify as a pilot),
5
DEPARTMENT OF COMPUTER APPLICATIONS
5. Find the names of pilots who can operate planes with a range greater
than 3,000 miles but are not certified on any Boeing aircraft.
7. Find the eids of employees who make the second highest salary.
8. Find the eids of employees who are certified for the largest number
of aircraft.
9. Find the eids of employees who are certified for exactly three
aircraft.
8 2311271 G9
Question 2:Consider the following relations: Student(snum:
integer, sname: string, major: string, level: string, age: integer) 2311275
Class(name: string, meets at: string, room: string, fid: integer)
Enrolled(snum: integer, cname: string) Faculty(fid: integer, 2311277
fname: string, deptid: integer) The meaning of these relations is 2311278
straightforward; for example, Enrolled has one record per
student-class pair such that the student is enrolled in the class. 2311280
2311281
6
DEPARTMENT OF COMPUTER APPLICATIONS
classes that either meet in room R128 or have five or more students
enrolled. 4. Find the names of all students who are enrolled in two
7. For each level, print the level and the average age of students for
that level.
8. For all levels except JR, print the level and the average age of
students for that level.
9. For each faculty member that has taught classes only in room R128,
print the faculty member’s name and the total number of classes she or
he has taught.
9 . 2311282 G10
2311285
Question 3:The following relations keep track of airline flight 2311286
information: Flights(flno: integer, from: string, to: string,
distance: integer, departs: time, arrives: time, price: real) 2311287
Aircraft(aid: integer, aname: string, cruisingrange: integer) 2311288
7
DEPARTMENT OF COMPUTER APPLICATIONS
1. Find the names of aircraft such that all pilots certified to operate
them have salaries more than $80,000.
2. For each pilot who is certified for more than three aircraft, find the
eid and the maximum cruisingrange of the aircraft for which she or he
is certified.
3. Find the names of pilots whose salary is less than the price of the
cheapest route from Los Angeles to Honolulu.
4. For all aircraft with cruisingrange over 1000 miles, find the name of
the aircraft and the average salary of all pilots certified for this
aircraft.
8. Print the enames of pilots who can operate planes with cruisingrange
greater than 3000 miles but are not certified on any Boeing aircraft.
9. Compute the difference between the average salary of a pilot and the
average salary of all employees (including pilots).
10. Print the name and salary of every nonpilot whose salary is
10 2311290 G11
Question 4 Consider the following relational schema for a
2311292
banking database application. Customer (Cid, Cname);
2311293
8
DEPARTMENT OF COMPUTER APPLICATIONS
D – Deposit, W – Withdrawal
Questions
Question (A)
Question (B)
Question (C)
Develop a SQL query to list the details of branches and the number of
accounts in each branch.
Question (E)
Develop a SQL query to list the details of branches where the number
of accounts is less than the average number of accounts in all
branches.
9
DEPARTMENT OF COMPUTER APPLICATIONS
Question (F)
11 2311304 G12
10