Lab 1 (DBMS)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Lab Report on Database Management System (DBMS)

1. Cover page (p)


2. Introduction to DBMS (H)
3. Define the Term Data, Information, Database, Field, Record, Query,
Candidate Key, Primary Key, Foreign Key. (H)
4. Create a database name Office which contain table employee and salary. The
structure of tables is given below. (P/H)
#employee (empid integer, name character (25), address character (25),
gender character (2), dept_name character (25), post character (25))
#salary(empid integer, bsal integer, allowance numeric(7,2), d_allow
numeric(7,2), gross numeric(7,2), tax numeric(7,2), NET numeric(7,2))
Now run given query.
a. Create employee table with the above-mentioned schema with the
specification of empid as primary key.
b. Create salary table with the above-mentioned schema with the
specification of empid as foreign key with reference to the primary key of
employee table.
c. Insert the records as given below:
Employee TABLE
Empid name address gender dept_name post
E001 RAM K.C. KATHMANDU M ADM OFFICER
E002 SITA SHARMA LALITPUR F ADM ASSISTANT
E003 HARI KARKI BHAKTAPUR M ACC OFFICER
E004 RITA NIRAULA KATHMANDU F ACC MANAGER
E005 REENA SHAKYA LALITPUR F ADM DIRECTOR
E006 KRISHNA YADAV BIRGUNJ M EDP OFFICER
E007 KRITI PANDEY KATHMANDU F ACC ASSISTANT
E008 NAVIN SHRESTHA LALITPUR M SALES MANAGER
E009 GOPAL JHA JANAKPUR M SALES ASSISTANT
E010 RAM DEV SHARMA BHAKTAPUR M SALES OFFICER
SALARY TABLE
Empid bsal
E001 40000
E002 25000
E003 40000
E004 50000
E005 60000
E006 40000
E007 25000
E008 50000
E009 25000
E010 40000

d. Calculate allowance as 15% of basic salary (bsal) for all the employees.
e. Calculate d_allow as 10% of bsal for the employees who are appointed as DIRECTOR
OR MANAGER.
f. Calculate gross salary as sum of bsal, allow and d_allow.
g. Calculate tax as 5% of gross for those who use to draw gross salary above 60000.
h. Calculate net as the difference between gross and tax.
i. Display all the salary details of employees along with their empid, name and post.
j. Display all employees who are appointed as either DIRECTOR, or MANAGER or
OFFICER with their id, name, post and net salary.
k. Display all the employee’s net salary along with their name and post in the order of
department.

5. Conclusion (h)
[Note: every printed document should contain header Containing Lab report on
Database Management System and Footer containing Prepare by: Your name. In point 4
every question must have printed output]
Goldengate International College
Battisputali, Kathmandu

Lab Report
Database Management System

Submitted By: Submitted To


Name: Department of Computer Science
Class: Golden Gate Int’l College

Section:
Date:

You might also like