Lab 5 Part 2 Adb
Lab 5 Part 2 Adb
SUBMITTED BY:
Ozaira Hameed
SEMESTER:
BSCS-5 B
REGISTERATION NO:
22-ARID-706
SUBMITTED TO:
Mam Saba-un-Nisa
COURSE TITLE & COURSE CODE:
1
LAB TASKS
Write a stored procedure which takes an integer value as argument from user
and displays its table up to 10 in given format.
Write a stored procedure which takes two arguments from user, display table of
first argument from 1 to value of second argument.
Consider Following Tables.
Student ( regNo, sName, sCity, sCGPA, sAge)
Course ( cCode, cName, credit_hours)
Enrollment (regNo, cCode, semester, Grade)
2
Write a stored procedure which insert values in Student table and make sure
following constraints must not violate. (do not apply constraint using SQL server
management studio)
a. regNo must not repeat
b.sCGPA must be between 0.0 and 4.0
c. sAge must be between 18 and 25
3
Write a stored procedure which inserts values in Enrollment table and make sure
following constraint must not violate.
a. regNo and cCode combines form primary key. Primary key rule must not
violate.
b.regNo and cCode are also foreign keys from Student and Course tables
respectively,
make sure foreign key constraint must not violate. Only those values must be
entered which exists in parent tables.
4
Write a Stored procedure which takes regno from user as an argument and
displays name of student and grades of student in each course he/she has
enrolled.
5
6