You are on page 1of 1

Bahria University, Islamabad Campus

Department of Computer Sciences


Lab Final Examination
Class/Section: BSIT
Course: DAM Date:29–6– 2022
Faculty’s Name: Sabah-ud-din Waqar Max Marks: 40
Time Allowed: 50Mins Total Pages: 2

Q1: Create three tables to implement trigger: Teacher, User, Audit_Dept. 15 marks
Teacher Tables:
Id int Primary Key,
Name nvarchar(30),
Salary int,
Gender nvarchar(10),
UserID int

User Table:
UserId
Username
Audit Table:
Audit Id:
Audit Data:
a) Insert three rows in each table
b) Create a trigger on insert for table tblTeachers and insert Audit entries like (“User ID=
___ and Name = ____ has inserted data”)
VIVA: How to create an update Trigger?

Q2: Create clustered index IX_tblteacher_salary on tblteacher (Gender DESC, Salary


ASC). Run and display the output. 10 marks

Viva: Difference between views and Indexes. 7.5 marks


Q3: Create Table Store(Id , Name ) as temporary table.
Insert Data into the temporary table:
Insert into #Tablename Values(1, 'Mike')
Insert into # Tablename  Values(2, 'John')
Insert into # Tablename  Values(3, 'Todd')

Viva: Location of Temporary table?

Q4: Create a simple stored procedure on tblTeacher to get teacher data with parameter name and
gender. Execute the procedure by providing values for name and gender on runtime. 7.5 marks

You might also like