DBMS Assignment1 January 2025
DBMS Assignment1 January 2025
Question 1
Which of the following statements is (are) incorrect?
Answer: a), c)
Explanation: Logical level: describes the data stored in the database and the relationships among
them.
Physical level: focuses on how data is stored physically.
View level: provides abstraction for users, hiding the complexities of the database structure.
1
Question 2
Consider the following SQL statement(s):
S1:
S2:
Answer: b)
Explanation: Based on the syntax of the language, option (b) is the correct answer. DDL(Data
Definition Language) includes CREATE, DROP, ALTER, TRUNCATE, RENAME; DML(Data Ma-
nipulation Language) includes INSERT, UPDATE, DELETE. For more details, refer to Module 2.
2
Question 3
Identify the valid primary key for the relation event registration from the given instance.
event registration
participant id event id registration date status
1001 E001 2024-01-10 Confirmed
1002 E002 2024-01-11 Pending
1003 E001 2024-01-10 Confirmed
1001 E003 2024-01-12 Confirmed
1004 E002 2024-01-14 Pending
a) participant id
Answer: c)
Explanation: A composite primary key consists of two or more attributes that together uniquely iden-
tify a record in the table. Option c) is the correct answer because the combination of participant id
and event id ensures uniqueness for each registration. Other options do not guarantee uniqueness
across all rows.
3
Question 4
Identify the correct statement/s.
Answer: c)
Explanation: (101, John) is an instance of the schema Employee(empID, empName). A relation
schema defines the structure of the data, and an instance contains actual data values fitting the schema.
4
Question 5
Consider a relation CityDetails(CityName, Population, CountryName) where the superkeys are as
follows: {CityName}, {CityName, Population}, {CityName, CountryName}, {CityName, Population,
CountryName}.
b) {CityName, Population}
c) {CityName}
d) {CityName, CountryName}
Answer: c)
Explanation: Minimal superkeys are candidate keys. Here, CityName alone is a superkey, so any
superset of CityName will also be a superkey. But only CityName can be a candidate key.
Hence, (c) is the correct option.
5
Question 6
Consider the following relations:
Employee(eid, ename, salary)
Department(did, eid)
a) RA1 = RA2
b) RA1 ⊂ RA2
c) RA2 ⊆ RA1
d) RA1 ⊆ RA2
Answer: d)
Explanation: A natural join only includes tuples where the eid matches, whereas a Cartesian product
includes all possible combinations of tuples. Hence, option (d) is correct.
6
Question 7
Consider the following instance of the CourseDetails(CourseID, CourseName) relation:
CourseID CourseName
C101 Mathematics
C102 Physics
Answer: d)
Explanation: Option (a) is incorrect because CourseID “C105” does not exist in the referenced
relation CourseDetails. Option (b) is incorrect because EnrollmentID cannot have duplicate values,
violating the primary key constraint. Option (c) is incorrect because primary key values cannot be
NULL, as seen in the first tuple. Hence, option (d) is the correct answer.
7
Question 8
Consider the following table:
CityDetails
CityName Population StateName
Mumbai 20000 Maharashtra
Delhi 19000 Delhi
Bengaluru 12000 Karnataka
Hyderabad 10000 Telangana
Ahmedabad 8000 Gujarat
Pune 6000 Maharashtra
Identify the correct operation(s) that produce the following output from the above relation:
a) σ(Population>=12000) (CityDetails)
d) σ(Population>=19000) (CityDetails)
Answer: a), c)
Explanation: As per Relational Operators syntax and semantics, options (a) and (c) correctly
filters cities with a population greater than or equal to 12000 as per the given instance.
8
Question 9
Consider the following tables:
CityDetails1
CityName Population StateName
Mumbai 20000 Maharashtra
Delhi 19000 Delhi
Ahmedabad 8000 Gujarat
Pune 6000 Maharashtra
CityDetails2
CityName Population StateName
Mumbai 20000 Maharashtra
Bengaluru 12000 Karnataka
Ahmedabad 8000 Gujarat
Chennai 10000 Tamil Nadu
Identify the correct operation(s) which produce the following output from the above two relations:
a) CityDetails1 − CityDetails2
b) CityDetails1 ∩ CityDetails2
c) CityDetails2 − CityDetails1
d) CityDetails1 ∪ CityDetails2
Answer: b)
Explanation: As per Relational Operators syntax and semantics, option (b) is correct because
the result is the intersection of CityDetails1 and CityDetails2 .
9
Question 10
Consider the following table:
CityDetails
CityName Population StateName
Mumbai 20000 Maharashtra
Delhi 19000 Delhi
Bengaluru 12000 Karnataka
Hyderabad 10000 Telangana
Ahmedabad 8000 Gujarat
Pune 6000 Maharashtra
Identify the correct operation(s) that produce the following output from the above relation:
FilteredCityDetails
CityName StateName
Mumbai Maharashtra
Delhi Delhi
Bengaluru Karnataka
Answer: c)
Explanation: The operation in option (c) first applies the selection operator (σ(Population >= 12000) )
Q
to filter rows where Population is at least 12000. Then, the projection operator ( (CityName, StateName) )
is applied to retain only the CityName and StateName columns, which matches the desired output.
10