0% found this document useful (0 votes)
6 views10 pages

DBMS Assignment1 January 2025

The document outlines an assignment for a Database Management System course, consisting of 10 multiple-choice questions with a total of 20 marks. Each question covers various aspects of database concepts, including SQL statements, primary keys, relational algebra, and operations on relations. Answers and explanations are provided for each question to clarify the correct choices.

Uploaded by

manya9305
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views10 pages

DBMS Assignment1 January 2025

The document outlines an assignment for a Database Management System course, consisting of 10 multiple-choice questions with a total of 20 marks. Each question covers various aspects of database concepts, including SQL statements, primary keys, relational algebra, and operations on relations. Answers and explanations are provided for each question to clarify the correct choices.

Uploaded by

manya9305
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Course Name: Database Management System

Assignment 1 - Week 1 (Jan 2025)


TYPE OF QUESTION: MCQ/MSQ

Number of questions: 10 Total mark: 10 X 2 = 20

Question 1
Which of the following statements is (are) incorrect?

a) Logical level abstraction defines the physical storage of data.

b) View level abstraction provides a user-friendly interface for end users.

c) Physical level abstraction focuses on the relationships among data.

d) Logical level abstraction focuses on the relationships among data.

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:

INSERT INTO employees(emp_id, emp_name, dept)


VALUES (101, ‘Alice’, ‘HR’);

S2:

ALTER TABLE employees ADD COLUMN salary number(8, 2);

Identify the correct statement.

a) Both S1 and S2 are Data Manipulation (DML) Queries

b) S1 is a Data Manipulation (DML) Query, and S2 is a Data Definition (DDL) Query

c) Both S1 and S2 are Data Definition (DDL) Queries

d) S1 is a Data Control Query, and S2 is a Data Definition (DDL) Query

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

b) event id, registration date

c) participant id, event id

d) event id, status

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.

a) Employee(empID, empName) is an instance of a relation schema.

b) Employee(empID, empName) is an example of a physical schema.

c) (101, John) is an instance of a relation schema.

d) (101, John) is an example of a logical schema.

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}.

Select the possible candidate key(s).

a) {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)

Consider the following Relational Algebras:


RA1 : ΠEmployee.eid, ename (Employee 1 Department)
RA2 : ΠEmployee.eid, ename (Employee × Department)

Which of the following is correct?

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

If CourseID is the foreign key in the relational schema StudentEnrollments(EnrollmentID, CourseID,


StudentName), which of the following is a valid instance of StudentEnrollments?

EnrollmentID CourseID StudentName


a) E001 C101 Amit
E002 C105 Raj

EnrollmentID CourseID StudentName


b) E001 C101 Amit
E001 C102 Raj

EnrollmentID CourseID StudentName


c) NULL C102 Amit
E003 C102 Raj

EnrollmentID CourseID StudentName


d) E001 C101 Amit
E002 C102 Raj

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:

CityName Population StateName


Mumbai 20000 Maharashtra
Delhi 19000 Delhi
Bengaluru 12000 Karnataka

a) σ(Population>=12000) (CityDetails)

b) σ(Population>10000) ∧ (StateName=‘Maharashtra’) (CityDetails)

c) σ(Population>=12000) ∨ (StateName=‘Delhi’) (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:

CityName Population StateName


Mumbai 20000 Maharashtra
Ahmedabad 8000 Gujarat

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

a) σ(CityName, StateName) (CityDetails)

b) σ(Population >= 12000) (CityDetails)


Q
c) (CityName, StateName) (σ(Population >= 12000) (CityDetails))
Q
d) (CityName, StateName) (CityDetails)

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

You might also like