DBMS Lab-4
DBMS Lab-4
Neeraj Rahul
23bcs085
1. Perform the following tasks using SQL
commands:
Aim: Create a database ‘COMPANY’ which will have a set of relations, namely,
EMPLOYEE, DEPARTMENT, DEPT_LOCATIONS, PROJECT, WORKS_ON,
DEPENDENT.
See the following figure to understand the conceptual view of relations and relationship
in the COMPANY database.
he underlined attributes represent primary keys. There is one more figure added in the
next page that gives you information that needs to be filled in each relation.
Exercises:
1. Write a SELECT query to get the birth date and address of the employee(s) whose
name is ‘John B. Smith’.
2. Write a SELECT query to retrieve the name and address of all employees who work
for the ‘Research’ department.
3. For every project located in ‘Stafford’, list the project number, the controlling
department number, and the department manager’s last name, address, and birth date.
4. For each employee, retrieve the employee’s first and last name.
ANSWERS
CREATE DATABASE COMPANY;
USE COMPANY;