0% found this document useful (0 votes)
23 views

Lab Practice2

The document describes tables to track students, courses, and course registrations. It provides sample data for 4 students (Jawad, Ali, Osama, Fahad) registering for various courses and receiving different grades. The tables and data are to be used for writing SQL queries to retrieve and analyze the student, course, and registration information.

Uploaded by

Baron919
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Lab Practice2

The document describes tables to track students, courses, and course registrations. It provides sample data for 4 students (Jawad, Ali, Osama, Fahad) registering for various courses and receiving different grades. The tables and data are to be used for writing SQL queries to retrieve and analyze the student, course, and registration information.

Uploaded by

Baron919
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Lab Practice

Q1) Course Registration System A student can register courses according to his demand. Create three tables which will fulfill this requirement. Student ( stid, SName, Address,City,PhoneNo,DOB,Program) Course (courseId, Title, Crhrs) Registration (stid(fk),coursid(fk),grade) 1) Choose appropriate data types 2) Add referential integrity constraints Q2) Practice the following scenario on above tables Jawad, Ali, Osama andfahad are students. Jawad register Discreate, Englishii, Basic Electronics, Phycology, OOP and Got A,B,C A grades respectively. fahad register Discreate, Englishii, Basic Electronics, Phycology, OOP and Got A,B,C A grades respectively.

Student
Sid 1 10 11 12 13 14 15 2 3 4 5 6 7 Sname jawad Hussain Jamil Hassan Qasim Saad Address 21 y Block DHA 21 Y Block Model Town people colony people colony 11 B Block Blue Area city Lahore Lahore FSD FSD Islamaba d Lahore Lahore Lahore Lahore Lahore Lahore Islamaba d Islamaba d Phone# 03002365896 03338688898 03122365236 03216665845 03122365236 03005632569 03005632569 03232365986 03122365236 03338688898 03005632569 03002563548 03338688898 DOB 10-10-1985 11-08-1889 10-10-1985 10-02-1885 11-08-1889 11-08-1889 11-08-1889 12-06-1992 11-08-1889 10-02-1885 10-02-1885 10-02-1885 10-02-1885 Progr am Bscs Bba Mscs Mba Bscs Mba Mba Bscs Bscs Bba Mba Mscs Bscs Gen der M M M M M M M M M M M M M

21 Ravi Block Iqbal Town Gulraiz 21 Ravi Block Iqbal Town Ali 12 G Block FaisalTown Osama 11 B Block EME Fahad 21 Y Block Model Town Ibrar 21 Ravi Block Iqbal Town Muzamil 11 B Block Blue Area Ismail 11 B Block Blue Area

8 9

Mohsin Kamran

11 B Block Blue Area 21 Ravi Block Iqbal Town

Islamaba d Lahore

03002563548 03216665845

10-02-1885 10-02-1885

Mscs Bscs

M M

Registration Course
Cid Ctitle Crhrs 10 DB 4 20 DSA Programming 4 30 Descret 3 40 DLD 3 50 Project 6 Sid Cid Grade 1 10 A 1 20 C 10 10 C 11 30 C 12 10 C 14 10 B 14 20 C 15 30 A 2 10 D 2 20 B 3 30 C 4 10 B 5 20 A 6 40 B 7 10 A 8 20 B

Q3)Write following query in access. 1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15) 16) 17) 18) 19) 20) 21) 22) 23)

Display all data from table student. Display sid,sname,phone# of all student. Display sid,sname whose live in Lahore. Display all courses of 4crhr. Display students who live in Lahore and study in bscs program. Display students who belong to Islamabad and studyin bba program. Display all students who live in Lahore or Islamabad. Display courses whocrhr are greater than three. Display courses whocrhr are lesser than four. Display sid,sname order by ascending. Display sid,sname order by descending. Display all students whose name start with S. Display all students whose phone# starts with 0300. Display sid,sname of student whose name has sheikh. Display cid,cname of programming courses. Display sid,cid of all students. Display students (sname, sid)who register DB. Display students who get A grade in DB. Display sid,sname,Ctitle,grade of student. Display sid,sname,Ctitle,grade of student Who got A grade. Display minimum crhr course. Display sid,sname of DB students who have grade between A and C. Display how many courses ali registered.

You might also like