Dbms 2
Dbms 2
Homework: 2
PART-A
Question 1: Under what circumstances, we will use foreign key? Give an example.
Question 2: Differentiate between procedural and non-procedural query languages. Give the
syntax of relational algebra operations.
Question 3: Why do we use indexing? Give a suitable example in support of your answer.
PART-B
Question 4: Can we use a view for security purpose? Justify your answer and give an example to
create a view.
Question 5: Compare DDL, DML and DCL. Write the syntax of all commands of DDL, DML
and DCL.
Question 6: Consider the table EMPLOYEE with following fields:
Emp_id
Emp_name
Dept_no
Dept_name
Location
Salary
Perform the following computations on table data:
a) List all the employees whose location is ‘Pune’ and dept_name is ‘Computer’.
b) Count the total number of departments. Also count the total number of employees whose
dept_name is ‘computer’
c) Add a new department ‘R&D’ in the database.
d) List the names of employees whose salary is greater than 50000.
e) List the names of employees having maximum and minimum salary
f) Now change the department name from ‘computer’ to ‘software design’, wherever
applicable in the table.