0% found this document useful (0 votes)
29 views20 pages

Course: CSE2004-DBMSLAB Faculty: Prabhavathy P Submitted By: Aaditya Jha 19BCE2623

1. The document describes creating tables for a company database including tables for employees, departments, dependents, projects, and employee work assignments. 2. It instructs to make specified columns primary keys and insert sample data into each table. 3. Queries are provided to retrieve employee details, dependent names and dates of birth, employees by name, dependents by employee and gender, and projects by location.

Uploaded by

Aaditya Jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views20 pages

Course: CSE2004-DBMSLAB Faculty: Prabhavathy P Submitted By: Aaditya Jha 19BCE2623

1. The document describes creating tables for a company database including tables for employees, departments, dependents, projects, and employee work assignments. 2. It instructs to make specified columns primary keys and insert sample data into each table. 3. Queries are provided to retrieve employee details, dependent names and dates of birth, employees by name, dependents by employee and gender, and projects by location.

Uploaded by

Aaditya Jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Name: Aaditya Jha Reg no: 19BCE2623

Course: CSE2004-DBMSLAB
Faculty: PRABHAVATHY P
Submitted By:
Aaditya Jha
19BCE2623

Create the following tables Company Database


Employee (SSN, Name (fname, Minit, Lname), Sex, Address,salary, DOB,
Department, designation, SupervisorSSN)

Department (Number, Name, ManagerSSN, Manager_DOB, Location)

Dependent (Name, DOB, Sex, Relationship, Employee SSN)

Project (Number, Name, Location, Controlling Department, Budget)

Works_on (SSN, Project Num, Hours)

a. Make the underlined columns as primary key.


b. Insert at least 5 rows to each table. (Apply Interactive insertion.
Check Entity Integrity
Constraint and key Constraintl

Solutions
Name: Aaditya Jha Reg no: 19BCE2623
Name: Aaditya Jha Reg no: 19BCE2623
Name: Aaditya Jha Reg no: 19BCE2623
Name: Aaditya Jha Reg no: 19BCE2623
Name: Aaditya Jha Reg no: 19BCE2623
Name: Aaditya Jha Reg no: 19BCE2623
Name: Aaditya Jha Reg no: 19BCE2623
Name: Aaditya Jha Reg no: 19BCE2623
Name: Aaditya Jha Reg no: 19BCE2623
Name: Aaditya Jha Reg no: 19BCE2623
Name: Aaditya Jha Reg no: 19BCE2623
Name: Aaditya Jha Reg no: 19BCE2623
Name: Aaditya Jha Reg no: 19BCE2623

c. Query the Db to display


1. The employee details.
select * from Employee;
Name: Aaditya Jha Reg no: 19BCE2623

2. Name and DOB of dependent table.

3.Employee names whose name start with “S”.

4.Dependent names who are females and related to Employee no 15678.


Name: Aaditya Jha Reg no: 19BCE2623

5.Project names which are in a particular location

6. Department details which has a manager.

7. Employees who were born during 1970s.

8. Employee names who salary isin the range 12000 to 30000.


Name: Aaditya Jha Reg no: 19BCE2623

II Alter the tables to


1. Add required foreign keys.

2. Insert valuesto see the referential integrity constraints.

2. Make name of Project as Unique and sex of employee as not null.


Name: Aaditya Jha Reg no: 19BCE2623

5. Increase the size of project name.

III Queries on SQL * PLUS function


1. Find the age of an Employee.

2. Print the year 12 yearslater than an employee’s birth year.

3. Print the month of births of all employees

4.

5.
Name: Aaditya Jha Reg no: 19BCE2623

6.

7.

8.
Name: Aaditya Jha Reg no: 19BCE2623

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy