Assignment Week 1
Assignment Week 1
Total Marks : 20
Question 1
Identify the correct statement(s) from the following. Marks: 2 MSQ
b) The actual content of the database at a particular point in time is called an instance.
d) Physical schema describes how data is stored in the database and the relationships among
the data.
Answer: a), b)
Explanation: Data dictionary contains database schema, Integrity constraints, etc. and
Logical schema describes how data is stored in the database and the relationships among
them. So, these two statements are incorrect.
Hence, options a) and b) are correct.
1
Question 2
Consider the following instance:
MLDatabase
Model Accuracy Dataset TrainingData
M1 98 DA 11280
M2 100 DB 29650
M2 NULL DC 148
M2 100 DA 11280
M3 45 DC 148
Answer: a)
Explanation: Option (b) and (c) are incorrect because the marked key attributes cannot
uniquely identify all tuples. Hence, these are not the primary keys. Option (d) is incorrect as
the marked primary key is not minimal (it is a superkey). {Model, Dataset} is unique and
non-null.
Hence, option (a) is correct.
2
Question 3
Identify the incorrect statement(s). Marks: 2 MCQ
a) A Super Key is a set of one or more attributes that, taken collectively, allows us to uniquely
identify an entity in the entity set.
c) The minimal set of attributes that allows us to uniquely identify an entity in the entity set
is called a candidate key.
Answer: b)
Explanation: As per the definition of keys, option b) is the answer.
3
Question 4
Consider two relations below. The primary keys are underlined. Identify all possible foreign
key(s) from the options.
Employee(EmpID, Ename, Salary) where EmpID is of type integer, Ename is of type string,
and Salary is of type decimal number.
Project(EmpID, Pnumber) where EmpID is of type integer, and Pnumber is of type string.
Marks: 2 MCQ
a) Ename
b) EmpID
c) Pnumber
d) EmpID, Pnumber
Answer: b)
Explanation: EmpID references Employee. Hence, it is the foreign key for the Project
table.
4
Question 5
Consider the following instance of ImageRec(Sl, DepthImage, Coord1, Coord2).
a) {Sl, DepthImage}.
b) {Coord1, Coord2}.
c) {Coord2, DepthImage}.
d) {Coord1, DepthImage}.
Answer: c)
Explanation: A secondary key is formed when a superkey is minimal, but has not been chosen
as a primary key. {Coord2, DepthImage} can uniquely identify all tuples, but is not a primary
key (Sl). Also, no proper subset of {Coord2, DepthImage} can be a key. Hence, option (c) is
correct.
5
Question 6
Consider the following instances:
Game1
Game2
Player Score
Gamer Attempt
P1 20
P1 1
P1 50
P2 2
P1 80
P3 6
P2 90
How many tuples will be selected by σPlayer=Gamer (Game1 × Game2)? Marks: 2 MCQ
a) 3
b) 4
c) 8
d) 9
Answer: b)
Explanation: The following tuples will be selected:
6
Question 7
Consider the two tables given below:
Student Teacher
Roll Name course FID FName FCourse
101 Sheema French 152 Sunita Hindi
112 Mala English 613 Abir English
213 Sita French 275 Darshik French
c) There will be three tuples in the result of the natural join between Student and Teacher.
Answer: d)
Explanation: For natural join, there must be a common column name between two tables.
But Student and Teacher do not have any column with the same name. Therefore, natural
join between Student and Teacher is not possible.
Hence, option d) is the answer.
7
Question 8
Consider the following table:
EmployeeDetails
EmpName Branch Address Salary
Raja Kolkata Kolkata 10000
Priyanka Mumbai Hyderabad 12000
Arindam Bangalore Kolkata 15000
Rumki Hyderabad Hyderabad 20000
Sumit Hyderabad Bangalore 10000
Sandip Mumbai Mumbai 15000
Identify the correct operation(s) which produces the following output from the above relation.
Marks: 2 MCQ
EmployeeDetails
EmpName Branch Address Salary
Rumki Hyderabad Hyderabad 20000
Sandip Mumbai Mumbai 15000
Q
a) (Branch=Address) ∧ (Salary>10000) (EmployeeDetails)
Q
b) (Branch=Address) ∨ (Salary>10000) (EmployeeDetails)
c) σ(Branch=Address) ∧ (Salary>10000) (EmployeeDetails)
d) σ(Branch=Address) ∨ (Salary>10000) (EmployeeDetails)
Answer: c)
Explanation: As per Relational Operators syntax and semantics, option c) is correct.
8
Question 9
Consider the following tables:
R1
R2
StateName TotalCases
StateName TotalCases
Telangana 58906
Gujarat 59126
Uttar Pradesh 77334
Bihar 39176
West Bengal 65258
Kerala 21797
Kerala 21797
Maharashtra 400651
Maharashtra 400651
Identify the correct operation(s) which will produce the following output from the above two
relations. Marks: 2 MCQ
StateName TotalCases
Kerala 21797
Maharashtra 400651
a) R1 − R2
b) R2 − R1
c) (R1 ∪ R2 ) ∩ (R1 ∩ R2 )
d) (R1 − R2 ) ∪ (R2 − R1 )
Answer: c)
Explanation: As per Relational Operators syntax and semantics, options c) is correct.
9
Question 10
Which of the following can be a candidate key for the following instance? Marks: 2 MCQ
EmployeeDetails
EmpName Branch Address Salary
Raja Kolkata Kolkata 10000
Priyanka Mumbai Hyderabad 12000
Raja Bangalore Kolkata 10000
Rumki Hyderabad Hyderabad 20000
Sumit Hyderabad Bangalore 10000
Sandip Mumbai Mumbai 15000
a) {EmpName}
b) {Branch}
c) {EmpName, Address}
d) {EmpName, Branch}
Answer: d)
Explanation: In the above instance, each row can be uniquely identified by using {EmpName, Branch}
set of attributes only.
Hence, (d) is the correct option.
10