DBMS CAT-1
DBMS CAT-1
12a Summarize Procedural Query Language? Explain the various operations CO1 K2
Performed using relational operators.
OR
12 b Explain the use of Dynamic SQL in DBMS in detail. CO1 K2
PART C
(Answer all the Questions 1 x 14 = 14 Marks
13a . Construct the following relations for a company database Application. CO1 K3
Employee (Eno, Name, Sex, DOB, Doj, Designation, Basic_Pay,Dept_No)
Department (DeptNo, Name)
Project (ProjNo, Name, Dept_No)
Works for (Eno,ProjNo,Date, Hours)
The attributes specified for each relation is self-explanatory. However the business
rules are stated as follows. A department can control a project. An employee can work
on any number of projects on a day.
However an employee cannot work more than once on a project he/she
worked on that day. The primary key are underlined.
(i). Identify the foreign keys, Develop DDL to implement the above
Page 1 of 2
schema.
(ii) Develop an SQL query to list the department number and the number
of Employee in each department.
(iii)Develop a View that will keep track of the department number, the
number of employees in the department, and the total basic pay
expenditure for each department.
(iv)Develop an SQL query to list the details of employees who have
worked in more than three projects on a day.
OR
13b Develop the following table CO1 K3
Degree(degcode, name, subject)
Candidate(seatno, degcode, semester, month, year, result)
Marks(seatno, degcode, semester, month, year, papcode, marks)
Degcode-degree code, Name-name of the degree (MSc, MCOM)
Perform various query operations using SQL:
(i) Write a SELECT statement to display all the degree codes which are
there in the candidat table but not present in degree table in the order of
degcode.
(ii) Write a SELECT statement to display the name of all the candidates
who have got less than 40 marks in exactly 2 subjects.
(iii)Write a SELECT statement to display the name, subject and number
of candidates for all degrees in which there are less than 5 candidates.
(iv) Write a SELECT statement to display the names of all the
candidates who have got highest total marks in MSc.,(Maths)
Page 2 of 2