0% found this document useful (0 votes)
161 views4 pages

Dbms Paper Open Ended 1 02122021 090519am

The document contains instructions for an open-ended lab exam on database management systems. It includes two questions: 1. Construct an ERD and database based on given records and perform SQL queries to retrieve employee data ordered and filtered in various ways. 2. Construct a school management database with Teachers and Students tables. Modify the database structure by adding, altering, and dropping columns and constraints as specified in the question.

Uploaded by

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

Dbms Paper Open Ended 1 02122021 090519am

The document contains instructions for an open-ended lab exam on database management systems. It includes two questions: 1. Construct an ERD and database based on given records and perform SQL queries to retrieve employee data ordered and filtered in various ways. 2. Construct a school management database with Teachers and Students tables. Modify the database structure by adding, altering, and dropping columns and constraints as specified in the question.

Uploaded by

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

BAHRIA UNIVERSITY,

(Karachi Campus)
Department of Computer Engineering
OPEN ENDED LAB EXAM 1(A) – Fall 2021

COURSE TITLE: Data base Management System COURSE CODE: CSL-220


Class: BCE-5(A) Shift: Morning
Lab Instructor: Engr. Sidra Mudassar Course Instructor: Engr. Naveera Sami

Date: 1st December 2021 Time Allowed: 90 min


Max. Marks: 20 Points Marks Obtained:

[CLO 1: Mechanism]

Name: Reg No:

Instructions:
 Create word document with your name and registration no.
 Copy queries and take screenshot of your output.
 If found cheating, the paper will be cancelled and will be marked ZERO
 Submit your lab exam on time.

Question1 :Construct datebase for given ERD and insert record ? [6 marks ]
Record to be inserted in database :
Perform following tasks using SQL commands: [10 Marks]

1. Write a SQL query to find the employees in the ascending order of their annual
salary. Return employee ID, employee name, monthly salary, salary/30 as
Daily_Salary, and 12*salary as Anual_Salary.

2. Write a SQL query to find the location of all the employees working in FINANCE
or AUDIT department. Sort the result-set in ascending order by department ID.
Return complete information about the employees.

3. Write a SQL query to find the employees along with grades in ascending order.
Return complete information about the employees.

4. Write a SQL query to find those departments where at least two employees work
as a SALESMAN in each grade. Return department name, grade and number of
employees
5. Write a SQL query to find those employees whose names contain the character
set 'LA' together. Return complete information about the employees

QUESTION#02:

1. Construct a database” School Management System”. Create Teacher and Student tables
in it having following columns and their appropriate data types: [01 Marks]

Table-Teachers
employee_id (PRIMARY KEY)
first_name
City
Address
hire_date
salary
S_id (INT NOT NULL)

Table-Student
S_id PRIMARY KEY,
S_name

2. Use DDL (Data Definition Language) to modify above database: [03 Marks]
a. Alter students table by adding a new column email data type VARCHAR length 200
b. Alter teachers table by adding two new columns as MIN_SALARY and
MAX_SALARY with data type DECIMAL
c. Alter students and drop email column from this table.
d.Alter Student table to add regno cnic no.
e. Alter Student table to add constraint unique on column regno

You might also like