2nd IA QB
2nd IA QB
2nd IA QB
Module 1
Module 2
1 Explain primary key , referential integrity and foreign key concepts with the specific
example
2 Explain union, Intersection and Minus Operations of Relational algebra with
examples
3 Describe Selection and Projector Operator in Relational Algebra and mention the
difference between them with examples.
4 Develop the following queries in Using Relational Algebra.
i) Find the names of all the employees whose salary is greater than 30000.
σsalary>30000(Employee)
ii) Retrieve the name and emp id of all employees.
πname, empid(Employee)
iii) Find the fname and lname of employees in department 4 that earn > 50000
πfname, lname(σsalary>30000(Employee))
DROP TABLE:
ALTER TABLE/VIEW-AS:
UPDATE-SET-WHERE:
4. Write the SQL queries for the following:
a) Write the syntax to Create, Alter and Drop table. (REFER ABOVE Qs)
b) Write SQL Query to Create Employee table with the following attributes: eid, ename
and salary.
CREATE TABLE Employee (
eid INT PRIMARY KEY,
ename VARCHAR(100),
salary DECIMAL(10, 2)
);
c) Alter table employee by adding one more attribute called address.
ALTER TABLE Employee
ADD COLUMN address VARCHAR(255);
d) Give syntax to drop table employee and drop column salary.
ALTER TABLE Employee
DROP COLUMN salary;
9. Explain the command used for ordering the query results? Explain with the syntax and an
example
9. Give the minimal cover Algorithm. Find the minimal cover using the minimal cover
algorithm for the following functional dependency.
F = {B->A, D->A,AB->D}
10. Give the minimal cover Algorithm. Find the minimal cover using the minimal cover
algorithm for the following functional dependency.
F = {B->A, D->A,AB->D}
Module 5