Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
46 views

CS101 Assignment # 2

The document describes a relational database model for an online learning system with tables for students, courses, and course enrollments. It lists 6 information queries and identifies the correct database query to retrieve each piece of information from the tables. The student must identify the matching query label for each of the remaining 5 information queries.

Uploaded by

rizwan haider
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)
46 views

CS101 Assignment # 2

The document describes a relational database model for an online learning system with tables for students, courses, and course enrollments. It lists 6 information queries and identifies the correct database query to retrieve each piece of information from the tables. The student must identify the matching query label for each of the remaining 5 information queries.

Uploaded by

rizwan haider
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/ 3

CS101 Assignment #2

NAME: RIZWAN HAIDER

VUID: BC210420077

Question:

A software developer has built a relational database model for the Learning
Management System of an online learning website. Various relations (tables) are
defined to store data records related to each entity in a separate relation. Three
of the Relations (STUDENT, COURSE, And ENROLLMENT) defined in that database
model along with their attribute are given below:

The developer needs to extract the following information given in Table-1 form
this defined database model using the relation database queries that consist of
SELECT, PROJECT and JOIN operators.

Table-1: Required Information

N0. Information required to be Extracted


1 Extracted all the students form the STUDENT table belonging to a specific
city.
2 Extracted all the student form the STUDENT table who are enrolled in “BSCS”
degree program.
3 Extracted all the records in the columns “Student Name” and “Degree
Program” of the STUDENT table.
4 Extracted all the records in the columns “Course Code”, “Course Title” and
Degree Program” of the COURSE table.
5 Extracted all the course form the COURSE table having three or more credit
hours.
6 Join STUDENT and COURSE tables using the Degree Program attribute.

Now, in the below given (Table-2), some relational database operations (Queries)
related to the above database model are defined along with the name of resulting
new relation. The name of the resulting new relation is also used as reference to
identify that query (i.e. each query is referenced as A,B,C,D,E,F,G,H,I,J,K, and L).

Table-2: Relational Queries

Relational Query (Operation) Name of the


Resulting Relation
(also a Reference
Label)
A <- SELECET form STUDENT where Resident A
City=’Lahore’
B <- PROJECT form STUDENT where B
City=’Lahore’
C <- PROJECT [Credit Hours >=3] form COURSE C
D <- JOIN STUDENT and COURSE where D
STUDENT. Degree Program=COURSE. Degree
Program
E <- PROJECT Course Code, Course Title, Degree E
Program form COURSE
F <- SELECET form STUDENT where Degree F
Program = ‘BSCS’
G <- JOIN COURSE and STUDENT on Columns. G
Degree Program
H <- PROJECT form COURSE Columns[Corse H
Code, Course Title, Credit Hours]
I <- PROJECT Student Name. Degree Program I
form STUDENT
J <- SELECT Columns [Student Name, Degree J
Program ] form STUDENT
K <- SELECET [Degree Program = ‘BSCS’] form K
STUDENT
L <- SELECET form COURSE where Credit Hours L
>=3
This (Table-2) contain both syntactically correct and incorrect relational database
queries (referenced as A to N). Out of these twelve queries six syntactically
correct queries can be used to extract the information required in the table-1.

You are required to identify the correct relational database query form Table-2:
Relational Queries for each of the “Required Information entry in Table-1 and
mention its reference label in the 2nd columns of the below given table against the
sr. no. Required Information for example, the answer to “Sr. no.1” entry of
“Required Information” columns is query “A” which is solved in the below given
table.

Now, you need to fill the remaining five entries in the below given table with the
reference label of correct relational database against each Sr. No. of the required
information table.

(Provide your Answer only in the below given Table)

Sr. No. of Required Information given in Reference label of the correct Relational
Table-1 query
{out of A,B,C,D,E,F,G,H,I,J,K,L} Table-2
1 A

2 F

3 J

4 E

5 L

6 G

You might also like