You need to fill the remaining five (5) entries in the below-given table with the Reference label of the correct relational database against each Sr. No. of the required information table.
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 attributes are given below:
crossorigin="anonymous">
style="display:block; text-align:center;"
data-ad-layout="in-article"
data-ad-format="fluid"
data-ad-client="ca-pub-7200085558568021"
data-ad-slot="3193586076">
STUDENT | |||
StudentID | StudentName | DegreeProgram | ResidentCity |
… | … | … | … |
… | … | … | … |
… | … | … | … |
COURSE | ||||
CourseCode | CourseTitle | TeacherID | DegreeProgram | CreditHours |
… | … | … | … | … |
… | … | … | … | … |
… | … | … | … | … |
ENROLLMENT | ||
StudentID | CourseID | Semester |
… | … | … |
… | … | … |
… | … | … |
The developer needs to extract the following information given in Table-1 from his defined
database model using the relational database queries that consist of SELECT, PROJECT and JOIN
operators.
Table-1: Required Information
Sr. No. | Information |
1 | Extract all the students from the STUDENT table |
2 | Extract |
3 | Extract |
4 | Extract |
5 | Extract all the courses from the COURSE table having |
6 | Join STUDENT and COURSE tables using the Degree Program |
crossorigin="anonymous">
style="display:block; text-align:center;"
data-ad-layout="in-article"
data-ad-format="fluid"
data-ad-client="ca-pub-7200085558568021"
data-ad-slot="3193586076">
Now, in the below given table (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 | Name of the Resulting Relation (also |
A <- SELECT from STUDENT where ResidentCity='Lahore' | A |
B <- PROJECT from STUDENT where City='Lahore' | B |
C <- PROJECT [CreditHourse>=3] from COURSE | C |
D DegreeProgram=COURSE.DegreeProgram | D |
E <- PROJECT CourseCode, COURSE | E |
F <- SELECT from STUDENT where DegreeProgram = | F |
G <- JOIN COURSE and STUDENT on Column.DegreeProgram | G |
H <- PROJECT from COURSE CreditHours] | H |
I <- PROJECT StudentName, DegreeProgram from STUDENT | I |
J <- SELECT Columns[StudentName, STUDENT | J |
K <- SELECT [DegreeProgram = 'BSCS'] from STUDENT | K |
L <- SELECT from COURSE where CreditHours >=3 | L |
This table (Table-2) contains both syntactically correct and incorrect relational database queries
(referenced as A to N). Out of these twelve (12) queries, six (6) 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 from Table-2: Relational
Queries for each of the “Required Information” entries in Table-1 and mention its reference label
in the 2nd column of the below-given table against the Sr. no. of Required Information. For
example, the answer to the “Sr. no. 1” entry of the “Required Information” column is query “A”
which is solved in the below-given table.
Now, you need to fill the remaining five (5) entries in the below-given table with the Reference
label of the correct relational database against each Sr. No. of the required information table.
crossorigin="anonymous">
style="display:block"
data-ad-format="autorelaxed"
data-ad-client="ca-pub-7200085558568021"
data-ad-slot="6426802817">
(Provide
your Answer only in the below-given Table)
Sr. No. of Required Table-1 | Reference {Out |
1 | A |
2 | K |
3 | I |
4 | E |
5 | L |
6 | G |
No comments