DBMS-demo
DBMS-demo
23
Student – Roll_No Difference among Entity, Entity type and Entity
Name set.
Class Entity Entity Type Entity Set
Address A thing in real A category of a Set of all
▪ The instance of an entity is a single occurrence world with particular entities of a
of that entity. In above example the entity independent Entity. particular
student may have multiple instances or Existence. Entity type.
occurrences such as Raj, Mohan, Shiva etc. Any particular The name of a All rows of a
row (a record) relation (table) relation (table)
There are two types of entities may be present –
in a relation in RDBMS is is RDBMS is
Tangible entity – Entities which physically exists
(table) is on Entity type. entity set.
in real world like car, pen, etc.
known as
Intangible entity – Entities which exists logically
entity.
like account.
▪ In an Entity set it is not necessary that
Entity Types :-
entities are stored / recorded in an ascending /
▪ It refers to the category that a particular entity
descending order they can be stored in any
belongs to.
order, but there is a constraint that in an entity
▪ It is represented by the name of the table and
set can have only unique entities that is an
its schema.
entity has a single occurrence in an entity set.
Example -
▪ Entity sets do not need to be disjoint.
➢ Student table in a college database.
Example - It is possible to define the entity set
Entity Set :– of all employees of a bank (Employee) and the
▪ An entity set is a set of entities of the same entity set of all customers of the bank
type that shares the same properties, or (customer). A person entity may be an
attributes. employee entity, a customer entity, both or
▪ In E-R diagram an entity set is represent by a neither.
rectangle and in relational model it is 2.2 Attributes :-
represented by a separate table. ▪ An attribute is a descriptive property. or
Example – characteristic of an entity.
➢ The set of all employees of an organization ▪ An entity is represented by a set of attributes.
called as the entity set Employee. Attributes are descriptive properties possessed
➢ The set of all persons who are customers at by each member of an entity set. Each entity
a given bank, can be called as the Entity set has a value for each of its attributes.
customer. For instance a particular student entity may
So we can say that set of all entities of a have the value 1234 for Roll_No., the value
particular entity type is known as entity set. (In Suresh for Name and etc.
RDBMS all rows of a relation (table) is an entity ▪ Domain – For each attribute, there is a set of
set). permitted values called domain or value set of
24
the attribute. ➢ A person can have more than one mobile no.
▪ Key attribute – The attribute which uniquely ➢ Address of a person may be present /
identifies each entity in the entity set is called permanent.
the key attribute.
C. Stored and Derived Attributes :-
Example - Roll No. in relation student uniquely
Stored attribute – Stored permanently in
identifies each student uniquely so we can say
database.
Roll_no. is key attribute are prime attribute of
Example –
student relation.
➢ DOB of a student.
2.2.1 Types of Attributes :-
Derived attributes – An attribute that can be
➢ Simple and composite
derived from other attribute is derived attribute.
➢ Single value and multivalued
Example –
➢ Stored and derived
➢ Age of a person can be derived from DOB
A. Simple and composite attributes :- attribute.
Simple Attributes – An attribute that cannot be ➢ Total and average marks of a student can be
further subdivided into components is a simple derived from subjects he reads in a semester.
attribute. Complex Attributes :-
Example -
▪ Those attributes which can be formed by the
➢ Roll_no. of a student
nesting of composite and multi-valued
➢ Employee_ID of a Employee.
attributes, are called "Complex Attributes".
Composite Attribute – An attribute that can be ▪ These attributes are rarely used in DBMS, that's
split into components is a composite attribute. why they are not so popular.
Example - ▪ These attributes are the nesting of two or more
➢ Address can be further split into composite and multivalued attributes and these
house_number, street, city, state, Pincode. multi value and composite attributes are called
➢ A person's name can be further split into components of complex attributes.
First_Name, Middle_Name, Last_Name. Example -
B. Single valued and Multivalued Attributes :- Address_Emphone ({E-mail}, {Phone}, address
Single – valued attribute – The attribute which {House No., Street, City, Pincode})
tables up only a single value for each entity Null – Attribute / Values :–
instance is a single value attribute. ▪ This attributes can take Null value when entity
Example – does not have value for it.
➢ DOB of a person ▪ An attribute takes a null value when an entity
➢ Gender of a person does not have a value for it. The null value may
Multivalued attribute – The attribute which indicate "not-applicable” that is the value does
takes up more than a single value for each not exist for the entity.
entity instance is a multivalued attribute. ▪ Null can also designate that an attribute values
Example – is unknown. An unknown value may be either
25
missing (the value does not exist, but we do entities in the real-world enterprise that is
not have that information) or not known (we being modeled.
do not know weather or not the value actually ▪ The function that an entity plays in a
exists) relationship is called that entity's role.
▪ A relationship may also have attribute called
2.3 Relationship :-
descriptive attributes.
▪ A relationship is an association among several
Example –
entities. OR
▪ we can say that A relationship type represents
the association between entity types.
▪ It means "Enrolled In" relationship type exists ▪ In E-R diagram we cann’t represent individual
between entity type student and course. relationship as it is an instance or data.
Example -
2.4 Every relationship type has three components -
▪ Rajesh (student) Enrolled in BCA (Course).
➢ name
Relationship Set :- ➢ degree
▪ A set of relationships of the same type is ➢ structural constraints (cardinality ratio,
known as a relationship set. participation constraint)
▪ Formally, it is a mathematical relation on n>2 i. Name :-
(Possibly non distinct) entity sets. ▪ Every Relation / Relationship have unique Name,
If E1, E2, ------ En are entity sets, then a which identifies that Relation / relationship in
relationship set R is a subset of (e1, e2, ------- database.
------ en) e1∈E, e2∈E2, en∈En} ii. Degree :-
Where (e1, e2, ............. en) is a relationship. ▪ Degree means number of entity set associated
(Participate) in the relationship set. Degree of
relationship can be unary, binary, ternary etc.
Logically we can associate any number Of entity
set in a relationship, called n- ary relationship.
a. Unary relationship – in unary relationship
only one entity set participates in a relationship
Relationship set advisor .
In this example the relationship set advisor denote
Example –
the association between instructors and students.
▪ The association between sets is referred to as
participation; that is the entity sets E1, E2 ----
--- En participate in relationship set R.
▪ A relationship instance in an E-R schema ➢ In this example we can say that one person
represents an association between the named is married to only a person.
26
b. Binary Relationship – in this type of One –To Many – An Entity in A is associated
relationship two entity set participates in a with any number (zero or more) of entities in
relationship. B, an entity in B, however , can be associated
with at most on entity in A.
Example –
27
Representation of total participation is denoted by
double lines.
Weak Entity
Strong Entity
2.4.2 Participation Constraint :-
▪ Participation constraint specifies weather the Relationship Set
existence on an entity depends an its being
relation to another entity via the relationship
Identifying Relationship Set
type.
For Weak Entity Set
▪ These constraints specify the minimum and
Total Participation of
maximum numbers of relationships instance that
each entity can participation in. Entity Set in Relationship
▪ In above example we can say that in Enrolled In 2.6 Strong And Weak Entity :-
relationship participation of student entity is Key :-
total it mean each student in student relation is ▪ A key for an entity is a set of attribute that
enrolled for a course on entity set is partial sufficient enough to distinguish entities from
because there is a possibility that no student is each other.
enroll / opt any course. ▪ key also helps to identify relationships uniquely
28
and thus distinguish relationship from each Rules for conversion –
other. Rule 1 - Every strong entity type becomes a table
Strong Entity :- in database :-
▪ An entity that have sufficient attributes to ▪ A strong entity set that have only simple
form a key (primary key) is called strong attributes directly converted in a table .
entity. this key helps it to identifying uniquely ▪ attributes/ column of the table will be the
▪ A strong entity is not dependent on any other ▪ the primary key of the table will be the key
Example –
Ro//_No
e
First_Nam
e
Last_Nam
Gender
me
House_Na
Street
City
Pincode
29
Rule 3 - For strong entity set with multivalued Table 1 for Employee
attributes :- Emp_id Emp_Name Salary
▪ A strong entity set with a multivalued attributes
will require two tables in relational model .
Schema_Employer (Emp_Id, Emp_Name,
Example –
Salary)
Table 2 for department
Dept_id Dept_Name
This table will contain the primary key and all the
multivalued attributes.
In this case 3 tables will be created like this.
Rule 4- Translating relationship set into a table :-
1. For A (a1, a2)
▪ A relationship set ( that have some attribute
2. For R (a1, b1)
will require one separate table in the relational
3. For B (b1, b2)
model and attribute of the table are -
Case 2 - For binary relationship with cardinality
▪ primary key attribute of the participating entity
ration 1:M
sets.
Example –
▪ it’s own descriptive attribute and set of non-
descriptive attributes will be the primary key.
Example –
30
Example – i. A(a1,R2 )
ii. BR (a1, b1 , b2 )
▪ And because B has total participation so in BR
relation on foreign key a1 not NULL constraint
1. For AR = AR (a1, b1, a2) ▪ Case2 – For binary relationship with cardinality
Example –
In this case we can combine R at any side like an entity set with total participation, then that
31
complex application in a better way. Note – in ER diagram, specialization is depicted
▪ It is a diagrammatic technique for displaying the by a triangle component labeled as ISA
subclass and super class, specialization and
▪ Overlapping specialization – an entity may
generalization, union or category, aggregation
belong to at most one specialization entity
etc.
sets.
Specialization and Generalization :-
▪ Disjoint specialization - an entity must belong
Specialization :–
to at most one specialization entity set.
▪ Specialization is the process of identifying
▪ The specialization relationship may also be
unique attributes and relationships among
referred to as a superclass subclass relationship.
entities and creating subtypes based on these
unique features. Generalization :-
▪ The process of designing subgrouping within an ▪ Generalization is the process of identifying
Constraints On Generalization :-
A. condition defined – in condition defined lower
level entity sets, membership is evaluated on the
basis of whether or not an entity satisfies an
explicit condition or predicate .
32
E. Completeness Constraint - the completeness
constraint on a generalization / specialization,
specifies whether or not an entity in the higher
level entity set must belong to at least one of the
lower level entity sets within the generalization /
specialization. this constraint may be one of the
following.
➢ Total generalization / specialization
➢ Partial generalization /specialization
Aggregation :-
An ER diagram is not capable of representing the
relationship between an entity and a relationship
which may be required in some scenario. In these
cases a relationship with its corresponding entities
is aggregated into a higher level entity. aggregation
is an abstraction through which we can represent a
relationship as higher level entity sets.
Example –
33
Important Question
1. In a company database, if there is a generalization of (A) A software application is composed of various
entities into Employee and Contractor, what would modules.
be an example of a disjoint constraint? (B) Each module has its own attributes and
(A) An employee cannot be both a full-time relationships.
employee and a part-time employee (C) Each module is divided into separate entities for
simultaneously. functions and variables.
(B) An employee must belong to either the (D) Each function has a reference to other functions
Employee or Contractor subclass. within the same module.
(C) An employee can be both an employee and a 5. How does aggregation differ from composition in an
contractor simultaneously. extended ER diagram?
(D) An employee cannot be either an employee or a (A) Aggregation represents a subset relationship
contractor. between entities, while composition represents a
2. Which statement best describes the difference whole-part relationship.
between aggregation and composition? (B) Aggregation allows the parts to exist
(A) Aggregation represents a stronger relationship independently of the whole, while composition
does not.
between the whole and its parts compared to
(C) Aggregation implies a weaker relationship
composition.
between the whole and its parts compared to
(B) Aggregation allows the parts to exist exclusively
composition.
within the whole, while composition does not.
(D) Aggregation allows the parts to exist exclusively
(C) Aggregation implies a subset relationship
within the whole, while composition does not.
between the whole and its parts, while 6. In a generalization hierarchy, what constraint ensures
composition implies a whole-part relationship. that an entity can belong to only one subclass?
(D) Aggregation allows the parts to exist (A) Total constraint (B) Partial constraint
independently of the whole, while composition (C) Disjoint constraint (D) Overlapping constraint
does not. 7. In a specialization hierarchy, what constraint ensures
3. In a generalization hierarchy with an overlapping that every entity in the superclass must belong to at
constraint, what does it mean if an entity participates least one subclass?
in more than one subclass? (A) Total constraint (B) Partial constraint
(A) The entity must participate in at least one (C) Disjoint constraint (D) Overlapping constraint
subclass. 8. What defines specialization in an extended ER
(B) The entity can participate in multiple subclasses diagram?
simultaneously. (A) Specialization involves combining multiple
(C) The entity cannot participate in any subclass. entities into one entity.
(D) The entity must participate exclusively in one (B) Specialization represents a subset relationship
subclass. between entities.
4. In a software system, what would be an example of (C) Specialization defines a subset of entities based
aggregation? on common characteristics.
34
(D) Specialization represents a whole-part (A) A car is composed of various components such
relationship between entities. as engine, wheels, and chassis.
9. In an extended ER diagram, what distinguishes (B) Each component has its own attributes and
specialization from generalization? relationships.
(A) Specialization involves combining multiple (C) Each assembly is divided into separate entities
entities into one entity, while generalization for workers and machines.
involves dividing one entity into multiple (D) Each machine has a maintenance schedule
entities. assigned to it.
(B) Specialization represents a subset relationship, 13. What is the primary difference between
while generalization represents a whole-part specialization and generalization in an extended ER
relationship between entities. diagram?
(C) Specialization defines a subset of entities based (A) Specialization involves combining multiple
on common characteristics, while generalization entities into one entity, while generalization
combines multiple entities into one entity. involves dividing one entity into multiple
(D) Specialization represents a whole-part entities.
relationship between entities, while (B) Specialization represents a subset relationship,
generalization defines a subset of entities based while generalization represents a whole-part
on common characteristics. relationship between entities.
10. In a computer system, what would be an example of (C) Specialization defines a subset of entities based
aggregation? on common characteristics, while generalization
(A) A computer system is composed of various combines multiple entities into one entity.
peripherals such as mouse, keyboard, and (D) Specialization represents a whole-part
monitor. relationship between entities, while
(B) Each peripheral device has its own attributes and generalization defines a subset of entities based
relationships. on common characteristics.
(C) Each component of the computer system is 14. In a music streaming service, what would be an
divided into separate entities for storage and example of aggregation?
(A) A playlist is composed of various songs.
processing.
(B) Each song has its own attributes and
(D) Each storage device has data files assigned to it.
relationships.
11. In a generalization hierarchy with a disjoint
(C) Each artist has albums assigned to them.
constraint, what does it mean if an entity does not
(D) Each album consists of tracks.
participate in any superclass?
15. In a generalization hierarchy with a total constraint,
(A) The entity must participate in at least one what does it mean if an entity participates in more
superclass. than one superclass?
(B) The entity can participate in multiple (A) The entity must participate in at least one
superclasses simultaneously. superclass.
(C) The entity cannot participate in any superclass. (B) The entity can participate in multiple
(D) The entity must participate exclusively in one superclasses simultaneously.
superclass. (C) The entity cannot participate in any superclass.
12. In a manufacturing system, what would be an (D) The entity must participate exclusively in one
example of composition? superclass.
35
16. What distinguishes aggregation from composition (C) Each assembly is divided into separate entities
in terms of the relationship between the whole and for workers and machines.
its parts? (D) Each machine has a maintenance schedule
(A) Aggregation implies a stronger relationship assigned to it.
between the whole and its parts compared to 20. In a specialization hierarchy with a partial
composition. constraint, what does it mean if an entity does not
(B) Aggregation allows the parts to exist participate in any subclass?
independently of the whole, while composition (A) The entity must participate in at least one
does not. subclass.
(C) Aggregation represents a subset relationship,
(B) The entity can participate in multiple subclasses
while composition represents a whole-part
simultaneously.
relationship.
(C) The entity cannot participate in any subclass.
(D) Aggregation implies a weaker relationship
(D) The entity must participate exclusively in one
between the whole and its parts compared to
subclass.
composition.
17. In a specialization hierarchy with a disjoint 21. In a generalization hierarchy, if an entity
constraint, what does it mean if an entity participates participates in more than one subclass due to
in more than one subclass? overlapping constraints, what can be inferred?
(A) The entity must participate in at least one (A) The entity must participate in at least one
subclass. subclass.
(B) The entity can participate in multiple subclasses (B) The entity can participate in multiple subclasses
simultaneously. simultaneously.
(C) The entity cannot participate in any subclass. (C) The entity cannot participate in any subclass.
(D) The entity must participate exclusively in one (D) The entity must participate exclusively in one
subclass subclass.
18. In a generalization hierarchy with a total constraint, 22. In a university database, what would be an example
what does it mean if an entity does not participate in of aggregation?
any superclass? (A) A student is composed of various courses they
(A) The entity must participate in at least one are enrolled in.
superclass. (B) A department is divided into separate entities for
(B) The entity can participate in multiple professors and staff.
superclasses simultaneously. (C) Each course has its own attributes and
(C) The entity cannot participate in any superclass. relationships.
(D) The entity must participate exclusively in one (D) Each professor has a teaching assistant assigned
superclass. to them.
19. In a manufacturing system, what would be an 23. In an extended ER diagram, what differentiates
example of aggregation? specialization from generalization?
(A) A product is composed of various components (A) Specialization involves combining multiple
such as parts and assemblies. entities into one entity, while generalization
(B) Each component has its own attributes and involves dividing one entity into multiple
relationships. entities.
36
(B) Specialization represents a subset relationship, (D) The entity must participate exclusively in one
while generalization represents a whole-part subclass.
relationship between entities. 27. In a specialization hierarchy, what constraint
(C) Specialization defines a subset of entities based ensures that an entity can belong to more than one
on common characteristics, while generalization lower-level entity set?
combines multiple entities into one entity. (A) Disjoint constraint (B) Overlapping constraint
(D) Specialization represents a whole-part (C) Total constraint (D) Partial constraint
relationship between entities, while 28. In an employee database, if there is a generalization
generalization defines a subset of entities based of entities into Full-time and Part-time employees,
on common characteristics. what would be an example of an overlapping
24. What is the key difference between aggregation and constraint?
composition in an extended ER diagram? (A) A full-time employee cannot be a part-time
(A) Aggregation represents a whole-part employee simultaneously.
relationship, while composition represents a (B) A full-time employee must also be a part-time
subset relationship. employee.
(B) Aggregation allows the parts to exist (C) An employee can be both full-time and part-time
independently of the whole, while composition simultaneously.
does not. (D) An employee cannot be either full-time or part-
(C) Aggregation implies a weaker relationship time.
between the whole and its parts compared to 29. In a university database, if there is a specialization
composition. of the entity Student into Undergraduate and
(D) Aggregation implies a stronger relationship Postgraduate, what would be an example of a
between the whole and its parts compared to disjoint constraint?
composition. (A) A student cannot be both an undergraduate and
25. In a generalization hierarchy with a disjoint a postgraduate simultaneously.
constraint, what does it mean if an entity participates (B) A student must be either an undergraduate or a
in more than one superclass? postgraduate.
(A) The entity must participate in at least one (C) A student can be both an undergraduate and a
superclass.
postgraduate simultaneously.
(B) The entity can participate in multiple
(D) A student can be neither an undergraduate nor a
superclasses simultaneously.
postgraduate.
(C) The entity cannot participate in any superclass.
30. In an extended ER diagram, what does aggregation
(D) The entity must participate exclusively in one
represent?
superclass.
26. In a specialization hierarchy with a total constraint, (A) Process of combining multiple entities into one
what does it mean if an entity participates in more entity.
than one subclass? (B) Process of dividing one entity into multiple
(A) The entity must participate in at least one entities based on attributes.
subclass. (C) Process of defining a subset of entities based on
(B) The entity can participate in multiple subclasses common characteristics.
simultaneously. (D) Process of representing a whole-part
(C) The entity cannot participate in any subclass. relationship between entities.
37
31. What does generalization signify in an extended ER (A) Minimum cardinality (B) Maximum cardinality
diagram? (C) ERD (D) Greater Entity Count
(A) Process of combining multiple entities into one 38. Given the basic ER and relational models, which of
entity. the following is INCORRECT?
(B) Process of dividing one entity into multiple (A) An attribute of an entity can have more than one
entities based on attributes. value
(C) Process of defining a subset of entities based on (B) An attribute of an entity can be composite
common characteristics. (C) In a row of a relational table, an attribute can
(D) Process of representing relationships between have more than one value
entities. (D) In a row of a relational table, an attribute can
32. In an extended ER diagram, what does have exactly one value or a NULL value
specialization represent? 39. Let us consider phone_number ,which can take
(A) Process of combining multiple entities into one single or several values . Treating phone_numberas
entity. an _________ permits instructors to have several
(B) Process of dividing one entity into multiple phone numbers (including zero) associated with
entities based on attributes. them.
(C) Process of defining a subset of entities based on (A) Entity (B) Attribute
common characteristics. (C) Relation (D) Value
(D) Process of representing relationships between 40. Scenario: Hospital Patient Management System
entities. Entities:
33. A primary key is combined with a foreign key Patient (PatientID, Name, DOB)
creates Doctor (DoctorID, Name, Specialization)
(A) Parent-Child relation ship between the tables Relationships:
that connect them Attends To (PatientID, DoctorID, AdmissionDate)
(B) Many to many relationship between the tables Cardinality Ratios:
that connect them Patient to Attends To: Many-to-One
(C) Network model between the tables that connect Doctor to Attends To: One-to-Many
them Participation Constraints:
(D) None of the mentioned Partial participation for Attends To from both
34. A window into a portion of a database is Patient and Doctor entities.
(A) Schema (B) View Question: How many tables are required to represent
(C) Query (D) Data dictionary the Hospital Patient Management System?
35. Key to represent relationship between tables is (A) 1 (B) 2
called (C) 3 (D) 4
(A) Primary key (B) Secondary Key 41. Scenario: Employee Management System
(C) Foreign Key (D) None of the mentioned Entities:
36. Which of the following is a low level operator? Employee (EmployeeID, Name, Position)
(A) Insert (B) Update Department (DepartmentID, Name, Location)
(C) Delete (D) Directory Relationships:
37. Which of the following indicates the maximum Works In (EmployeeID, DepartmentID)
number of entities that can be involved in a Cardinality Ratios:
relationship? Employee to Works In: Many-to-One
38
Department to Works In: One-to-Many 44. Scenario: Student Registration System
Participation Constraints: Entities:
Total participation for Works In from Employee Student (StudentID, Name, Email)
entity and partial participation from Department Course (CourseID, Title, Credits)
entity. Relationships:
Question: How many tables are required to represent Enrolls In (StudentID, CourseID)
the Employee Management System? Cardinality Ratios:
(A) 1 (B) 2 Student to Enrolls In: One-to-Many
(C) 3 (D) 4 Course to Enrolls In: One-to-Many
42. Scenario: Online Shopping Platform Participation Constraints:
Entities: Total participation for Enrolls In from both Student
Customer (CustomerID, Name, Email) and Course entities.
Product (ProductID, Name, Price) Question: How many tables are required to represent
Relationships: the Student Registration System?
Places Order (OrderID, CustomerID, ProductID, (A) 1 (B) 2
Quantity) (C) 3 (D) 4
Cardinality Ratios: 45. What is the primary benefit of normalizing a
Customer to Places Order: One-to-Many relational schema during the conversion process
Product to Places Order: One-to-Many from an ER model?
Participation Constraints: (A) Simplifying complex queries.
Total participation for Places Order from both (B) Reducing storage space.
Customer and Product entities. (C) Minimizing redundancy and dependency.
Question: How many tables are required to represent (D) Enhancing data integrity.
the Online Shopping Platform? 46. When converting an ER model to a database
(A) 1 (B) 2 schema, how does normalization contribute to
(C) 3 (D) 4 maintaining data integrity?
43. Scenario: Library Management System (A) By allowing duplicate data in tables.
Entities: (B) By ensuring that each table has a primary key.
Book (ISBN, Title, Author) (C) By minimizing dependency between attributes.
Member (MemberID, Name, Email) (D) By denormalizing the tables.
Relationships: 47. Which normalization form ensures that there are no
Borrows (ISBN, MemberID, DueDate) transitive dependencies in a relational schema?
Cardinality Ratios: (A) First Normal Form (1NF)
Book to Borrows: One-to-Many (B) Second Normal Form (2NF)
Member to Borrows: One-to-Many (C) Third Normal Form (3NF)
Participation Constraints: (D) Boyce-Codd Normal Form (BCNF)
Partial participation for Borrows from both Book 48. In the context of converting an ER model to a
and Member entities. database schema, why is it essential to adhere to
Question: How many tables are required to represent normalization principles?
the Library Management System? (A) To increase redundancy.
(A) 1 (B) 2 (B) To simplify the database design.
(C) 3 (D) 4 (C) To maximize dependency.
39
(D) To improve query performance. 54. When converting an ER model to a database
49. When converting an aggregation relationship from schema, in what scenarios might denormalization be
an ER model to a database schema, what is considered?
represented by a foreign key in the aggregated (A) To increase data integrity.
entity? (B) To simplify complex queries.
(A) It represents a one-to-one relationship. (C) To ensure adherence to normalization principles.
(B) It represents a one-to-many relationship. (D) To minimize storage space.
(C) It represents a many-to-one relationship. 55. In the context of converting an ER model to a
(D) It represents a many-to-many relationship. database schema, why is normalization important?
50. In the process of converting an ER model with (A) It simplifies the database design.
inheritance to a relational schema, how would you (B) It minimizes redundancy and dependency.
handle attributes that are specific to child entities? (C) It speeds up query performance.
(A) Include them in the parent table. (D) It reduces the need for indexing.
(B) Create separate tables for each child entity with 56. How would you represent inheritance from an ER
all attributes. model in a relational database schema?
(C) Include them in a separate table linked to the (A) Use views to represent inheritance.
parent table via a foreign key. (B) Use foreign keys to link child tables to parent
(D) Exclude them from the schema. tables.
51. When converting an ER model to a database (C) Combine all attributes of parent and child
schema, which normal form ensures that all non- entities into one table.
prime attributes are fully functional dependent on (D) Use triggers to handle inheritance.
the primary key? 57. When converting an ER model to a relational
(A) First Normal Form (1NF) schema, how would you handle derived attributes?
(B) Second Normal Form (2NF) (A) Include derived attributes as regular attributes in
(C) Third Normal Form (3NF) the table.
(D) Boyce-Codd Normal Form (BCNF) (B) Calculate derived attributes at runtime.
52. In the process of converting a ternary relationship (C) Exclude derived attributes from the table.
from an ER diagram to a relational schema, how (D) Store derived attributes in a separate table.
many additional tables are required? 58. How would you convert a composite attribute from
(A) One additional table with composite keys. an ER diagram to a relational schema?
(B) Two additional tables with composite keys. (A) Store all parts of the composite attribute in a
(C) Three additional tables with composite keys. single column.
(D) Four additional tables with composite keys. (B) Create separate tables for each part of the
53. When converting an ER model to a relational composite attribute.
schema, how would you represent a multivalued (C) Combine the parts of the composite attribute
attribute in a separate table? into one table.
(A) Store all values in a single column. (D) Create separate columns for each part of the
(B) Create a separate table for each value. composite attribute in the same table.
(C) Create a separate table for the multivalued 59. In the process of converting an ER model to a
attribute with a foreign key reference. database schema, what normalization form should
(D) Implement a nested table structure for each the resulting tables adhere to?
attribute. (A) First Normal Form (1NF)
40
(B) Second Normal Form (2NF) (A) Dotted rectangle (B) Solid rectangle
(C) Third Normal Form (3NF) (C) Double rectangle (D) Oval
(D) Boyce-Codd Normal Form (BCNF) 69. How is a derived attribute represented in an ER
60. In a manufacturing system, how would the diagram?
relationship attribute "Production Cost" be (A) Dashed underline (B) Solid underline
represented in an ER diagram? (C) Dotted underline (D) Double underline
(A) Solid ellipse (B) Dashed ellipse 70. What notation is used to represent a multivalued
(C) Dotted ellipse (D) Double ellipse attribute in an ER diagram?
61. In a financial database for transactions, what does a (A) Dashed underline (B) Solid underline
solid underline indicate for the "TransactionID" (C) Dotted underline (D) Double underline
attribute? 71. In an ER diagram, what notation is used to
(A) Unique attribute (B) Composite attribute represent a key attribute?
(C) Derived attribute (D) Multivalued attribute (A) Dashed underline (B) Solid underline
62. In a healthcare database, how would a composite (C) Dotted underline (D) Double underline
attribute "Diagnosis" containing "Condition" and 72. What symbol is used to represent a relationship
"Severity" be represented in an ER diagram? between two entities in an ER diagram?
(A) Solid underline (B) Dotted underline (A) Circle (B) Rectangle
(C) Double ellipse (D) Dashed ellipse (C) Diamond (D) Oval
63. In a customer feedback system, what does a double 73. Which symbol is used to represent an attribute in an
vertical bar notation represent in attribute entity in an ER diagram?
completeness for "Feedback Rating" attribute? (A) Circle (B) Rectangle
(A) Total completeness (B) Partial completeness (C) Diamond (D) Oval
(C) Weak completeness (D) Strong completeness 74. In an ER diagram, what symbol represents an
64. In a product inventory system, what does a vertical entity?
bar notation represent in attribute disjointness for (A) Circle (B) Rectangle
"Product Type" attribute? (C) Diamond (D) Oval
(A) Disjoint (B) Overlapping 75. In a social media platform, if every user must have
(C) Exclusive (D) Inclusive at least one profile picture, what type of
65. In a company's employee hierarchy system, how participation constraint exists between users and
would inheritance between "Employee" and profile pictures?
"Manager" entities be represented? (A) Partial participation
(A) Solid line (B) Dashed line (B) Total participation
(C) Dotted line (D) Double line (C) Optional participation
66. In ER modeling, what does a vertical bar notation (D) Mandatory participation
represent in attribute disjointness? 76. In a university's student registration system, if every
(A) Disjoint (B) Overlapping student must be enrolled in at least one course, what
(C) Exclusive (D) Inclusive type of participation constraint exists between
67. In ER modeling, how is inheritance represented? students and courses?
(A) Dashed line (B) Solid line (A) Partial participation
(C) Dotted line (D) Double line (B) Total participation
68. How is a weak entity represented in an ER (C) Optional participation
diagram? (D) Mandatory participation
41
77. In an entity-relationship diagram, what does it mean (C) Three (D) Variable
if an entity set has total participation in a 82. What does "optional participation" constraint imply
relationship? in an entity-relationship diagram?
(A) Every entity instance in the entity set must (A) Every entity instance in the entity set must
participate in at least one relationship instance. participate in at least one relationship instance.
(B) Some entity instances in the entity set may not (B) Some entity instances in the entity set may not
participate in any relationship instance. participate in any relationship instance.
(C) Every entity instance in the entity set may (C) Every entity instance in the entity set may
participate in more than one relationship participate in more than one relationship
instance. instance.
(D) The entity set has no participation in any (D) The entity set has no participation in any
relationship instance. relationship instance.
78. In an entity-relationship diagram, what is the 83. What does "many-to-many" cardinality ratio
maximum number of entity sets that can participate indicate?
in a ternary relationship? (A) Each entity instance in one entity set can be
(A) Two (B) Three associated with one or more entity instances in
(C) Four (D) Variable another entity set.
79. What does "many-to-one" cardinality ratio imply in (B) Each entity instance in one entity set is
a relational database? associated with exactly one entity instance in
(A) Each entity instance in one entity set can be another entity set.
associated with one or more entity instances in (C) Each entity instance in one entity set is
another entity set. associated with at most one entity instance in
(B) Each entity instance in one entity set is another entity set.
associated with exactly one entity instance in (D) Each entity instance in one entity set can be
another entity set. associated with one or more entity instances in
(C) Each entity instance in one entity set is another entity set, and vice versa.
associated with at most one entity instance in
84. What does "partial participation" constraint mean in
another entity set.
an entity-relationship diagram?
(D) Each entity instance in one entity set is not
(A) Every entity instance in the entity set must
associated with any entity instance in another
participate in at least one relationship instance.
entity set.
(B) Some entity instances in the entity set may not
80. In a university database, if each student must be
enrolled in at least one course, what type of participate in any relationship instance.
participation constraint exists between students and (C) Every entity instance in the entity set may
courses? participate in more than one relationship
(A) Partial participation instance.
(B) Total participation (D) The entity set has no participation in any
(C) Optional participation relationship instance.
(D) Mandatory participation 85. What does "one-to-many" cardinality ratio indicate?
81. In an n-ary relationship, how many entity sets are (A) Each entity instance in one entity set can be
involved? associated with one or more entity instances in
(A) One (B) Two another entity set.
42
(B) Each entity instance in one entity set is (A) The specific instances of the relationship
associated with exactly one entity instance in between entities.
another entity set. (B) The minimum number of entities that must
(C) Each entity instance in one entity set is participate in the relationship.
associated with at most one entity instance in (C) The maximum number of entities that can
another entity set. participate in the relationship.
(D) Each entity instance in one entity set is not (D) The specific attributes associated with the
associated with any entity instance in another relationship.
entity set. 91. What is the cardinality of a relationship type?
86. What does "total participation" constraint imply in (A) The number of entities participating in the
an entity-relationship diagram? relationship.
(A) Every entity instance in the entity set must (B) The specific instances of the relationship
participate in at least one relationship instance. between entities.
(B) Some entity instances in the entity set may not (C) The maximum number of entities that can
participate in any relationship instance. participate in the relationship.
(C) Every entity instance in the entity set may (D) The minimum number of entities that must
participate in more than one relationship participate in the relationship.
instance. 92. In a social media database, what would represent a
(D) The entity set has no participation in any relationship?
relationship instance. (A) User ID (B) Profile Picture
87. In a university database, if a student can enroll in (C) Friendship (D) Date of Birth
multiple courses and a course can have multiple 93. In an employee database, which attribute would be
students enrolled, what is the degree of relationship considered composite?
between students and courses? (A) Employee ID (B) Salary
(A) Unary (B) Binary (C) Date of Birth (D) Address
(C) Ternary (D) Quaternary 94. Which of the following attributes would NOT be
88. What does the cardinality ratio specify in a considered simple?
relationship type? (A) Age (B) Employee ID
(A) The specific instances of the relationship (C) Address (D) Gender
between entities. 95. In a sales database, which attribute would be
(B) The minimum and maximum number of entities considered derived?
that must participate in the relationship. (A) Product ID (B) Sales Revenue
(C) The number of entities participating in the (C) Sales Date (D) Customer Name
relationship. 96. Which of the following attributes would be
(D) The specific attributes associated with the considered stored in a database?
relationship. (A) Age (calculated based on birthdate)
89. In a movie rental database, what would represent a (B) Date of Birth
relationship? (C) Full Name (composed of first name and last
(A) Movie Title (B) Genre name)
(C) Rental Transaction (D) Release Year (D) Gender
90. What does the participation constraint describe in a 97. In a customer database, which attribute would be
relationship type? considered multi-valued?
43
(A) Customer ID (B) Customer Name (C) An attribute that holds multiple values for a
(C) Email Address (D) Interests single entity
98. Which of the following best describes a simple (D) An attribute that is derived from other attributes
attribute? 99. In a human resources database, what would
(A) An attribute that can be further divided into represent an entity type?
smaller sub-parts (A) Employee ID (B) Salary
(B) An attribute that cannot be divided any further (C) Employee (D) Department
Answer key
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
B D B A B C A C C A C A C A B B B C A C
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
B A C B B B B C B D A C A B C D B C A B
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
B B B C C B C D B B C C C B B B A D C A
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
A C D A D A D C C D B C D B B B A B C B
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
D B D B A A B B C B C C D C B D D B C
44