DBMS Iat1 - S1
DBMS Iat1 - S1
7. (a)State and explain the command DDL, DCL, DML with suitable example Justify the need of
embedded SQL.
Consider the relation student (Reg No, nam e, mark, and grade).Write embedded dynamic SQL
program in C language to retrieve all the students‘ records whose mark is more than 90 (13)
(OR)
(b) List and Describe the features and purpose of database System.
PART C (1×14=14)
Employee (Eno,Name,Sex,Dob,Doj,Designation,Basic_Pay,Deptno)
Department (Dept_no,Name)
Project (Proj_no,Name,Dept_no)
Worksfor (Eno,Proj_no,Date,Hours)
The attributes specified for each relation is self-explanatory. However the business rules are stated as
follows. A department can control any number of projects. But only one 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 keys are underlined.
(i) Identify the foreign keys. Develop DDL to implement the above schema. (3)
(ii) Develop an SQL query to list the department number and the number of employees in each department.(4)
(iii) Develop a view that will keep track of the department number, the number of employees in the department,
and the total basis pay expenditure for each department. (4)
(iv) Develop an SQL query to list the details of employees who have marked in more than three projects on a
day (4)