This section contains carefully selected MCQs and Previous Year Questions with explanations to help students understand concepts and prepare effectively for examinations, interviews, and competitive tests.
Q: 1How many entities are associated in the quaternary relationship in E—R modelling?
Option C
In E–R (Entity–Relationship) modelling, a relationship represents an association among entities. Relationships are classified according to the number of participating entities.
| Relationship Type | Number of Entities |
|---|---|
| Unary Relationship | 1 |
| Binary Relationship | 2 |
| Ternary Relationship | 3 |
| Quaternary Relationship | 4 |
A quaternary relationship involves four different entities participating together in a single relationship.
For example, if we have four entities such as Student, Teacher, Subject, and Classroom, and all four entities participate together in a single relationship, then it is called a quaternary relationship.
Q: 2Let A and B be two entities in and E—R diagram with simple single value attributes. R1 and R2 are two relationships between M and N. R1 is one-to-many from A to B. R2 is many-to-many from A to B. What is the minimum number of tables required to represent A, B, R1 and R2 in the relational mode?
Option D
In ER-to-relational mapping, each entity set becomes a separate table. Therefore, entities A and B require two tables.
For relationships:
A one-to-many (1:N) relationship (R1) can be implemented by adding the primary key of entity A as a foreign key in table B, so no separate table is required.
A many-to-many (M:N) relationship (R2) cannot be represented using a foreign key alone, so it requires a separate relation, containing the primary keys of A and B.
Thus, total 3 tables required:
Q: 3In ER Model, which of the following relationship is correct for a condition that a person in INDIA has an Aadhaar Card?
Option A
In India, each person has only one Aadhaar Card, and each Aadhaar number belongs to only one person.
This is a One-to-One (1:1) relationship in the ER Model.
Q: 4Assume a one-to-many relationship from table named “authors” to the table named “books”. Where should the foreign key reside in an optimal design for this relationship?
Option A
In a one-to-many relationship, one record in the parent table can be associated with multiple records in the child table. The foreign key is placed in the child table to reference the primary key of the parent table.
In this case, one author can write many books, so the authors table is the parent table and the books table is the child table. Therefore, the foreign key referencing the author’s primary key should be stored in the “books” table.
Q: 5Which of the following is suitable for a derived attribute?
Option C
A derived attribute is an attribute whose value can be calculated from other stored attributes.
Q: 6If an entity appears in not more than 5 relationships then it is a
Option B
In E-R modeling, cardinality defines how many instances of one entity can be associated with instances of another entity.
The statement says, “an entity appears in not more than 5 relationships” this means, one instance of an entity can be related to maximum 5 instances of another entity. This represents a 1:5 relationship.
| Relationship Type | Meaning |
|---|---|
| 1:1 | One Entity : One related Entity |
| 1:N | One Entity : Many Entities |
| N:1 | Many Entities : One Entity |
| M:N | Many Entities : Many Entities |
Q: 7Which of the following is an example of a composite attribute?
Option A
A composite attribute is an attribute that can be divided into smaller sub-attributes.
Address can be broken into House No, Street, City, State, and PIN Code, so it is a composite attribute.
Age, City and State are the simple attributes and cannot be meaningfully divided further.
Q: 8Which of the following is a bottom-up approach?
Option B
Generalization is a bottom-up approach where lower-level entities are combined to form a higher-level, more general entity.
Specialization is a top-down approach, where a higher-level entity is divided into lower-level entities.
Q: 9The E-R (Entity-Relationship) modeling technique follows which approach?
Option A
E-R modeling is primarily a Top-Down approach to database design. It starts with identifying high-level entities and relationships in the real world and then gradually breaks them down into attributes and detailed structures.
Q: 10When an E-R model is converted to a relational database
Option C
When an E-R model is converted into a relational database, the goal is to represent all data and relationships in the form of tables while maintaining data integrity.
Entities are directly mapped to tables, where:
Relationships are handled based on their type:
Note:
Q: 11The number of occurrences of objects in a given relationship is called _____________.
Option D
In data modeling and databases, when two or more objects or entities are related, we care not only about that they are related, but also how many instances of one object can be associated with instances of another.
The number of occurrences of objects (entities) in a relationship is called Cardinality. It defines how many instances of one entity can be associated with instances of another entity.
For example, in a student-course relationship, one student can enroll in many courses, which represents one-to-many cardinality.
Q: 12When E-R diagram is mapped to tables, the representation is redundant for
Option B
In database design, an E-R (Entity-Relationship) diagram visually represents entities ("Student", “Employee” or "Course"), their attributes, and relationships between them. Converting this diagram into tables follows specific mapping rules to avoid data redundancy and ensure integrity.
ER-to-Relational Mapping Rules:
When converting an Entity-Relationship (ER) diagram into relational tables, specific rules ensure efficient storage without unnecessary data duplication.
Strong Entity Sets are independent entities that possess their own primary key. Each strong entity set maps to a single table containing all its attributes, with the primary key underlined to indicate uniqueness. This mapping introduces no redundancy since the table stands alone.
Weak Entity Sets represent dependent entities lacking a complete primary key on their own. These map to one table that combines the strong entity's primary key as a foreign key, the weak entity's attributes, and its discriminator.
Any attributes from the identifying relationship also merge directly into this table, eliminating the need for a separate relationship table.
Strong (Regular) Relationship Sets connect strong entities in many-to-many relationships. These require a dedicated junction table containing the primary keys of both participating entities as foreign keys, along with any relationship-specific attributes.
Weak (Identifying) Relationship Sets establish the ownership link between a weak entity and its parent strong entity. No independent table is created for these, instead, their details, including primary keys and attributes are fully integrated into the weak entity's table.
Creating a separate table here would be redundant, as the weak entity table already incorporates the owner's primary key to enforce dependency.
Q: 13In ER Model constructs, which type of attribute is most suitable to represent the skill(s) of an employee for an organization?
Option D
In an ER (Entity–Relationship) Model, an attribute is a property or characteristic of an entity. It tells us something about the entity. Attributes describe the entity with the help of values.
For example, for entity Employee the Name, Age, Salary, Skills and for entity Student the Roll No, Course, Address are attributes.
| Attribute Type | Description | Example |
|---|---|---|
| Simple or Atomic Attribute | This type of attribute cannot be divided into smaller meaningful parts. It contains a single, indivisible value that represents one property of the entity. | Age of an employee or salary of an employee. |
| Composite Attribute | This type of attribute can be broken down into smaller sub-parts, and each sub-part represents a more detailed level of information. It is useful when an attribute naturally consists of multiple components. | An address can be divided into street, city, and state. Similarly, the name can be divided into first_name, middle_name, and last_name. |
| Derived Attribute | This type of attribute does not store its value permanently. Instead, its value can be calculated from other attributes whenever needed. It is not physically saved in the database but can be obtained through computation. | Age can be calculated from date of birth. |
| Multivalued Attribute | This type of attribute can hold more than one value for the same entity. It is used when the number of possible values is not fixed, meaning an entity may have zero, one, or many such values. | An employee can have multiple skills or multiple phone numbers. |
| Key Attribute | This attribute uniquely identifies each record in an entity set. No two entities share the same value for a key attribute. | Roll number for a student or employee ID for an employee. |
| Single-Valued Attribute | This attribute holds only one value at a time for an entity. It cannot contain multiple values simultaneously. | A person's gender or a student's blood group. |
Because an employee can have multiple skills, and ER models represent such attributes as Multivalued Attributes.
Q: 14Which of the following is an example of a composite attribute?
Option A
A composite attribute is an attribute that can be divided into smaller sub-attributes.
The attribute Name can be broken into First Name, Middle Name, and Last Name, so it is a composite attribute.
Age, City and State are simple attribute and cannot be meaningfully divided further.
Q: 15In context of ER diagram, the relationship set connecting the weak entity set to the identifying strong entity set is depicted by a ___________ and double lines are used to connect weak entity set to the relationship to indicate ___________ of weak entity set.
Option A
In an ER diagram, a Weak Entity Set cannot be uniquely identified by its own attributes and relies on a Strong (Identifying) Entity Set for uniqueness. The relationship that connects a weak entity to its identifying strong entity is known as the identifying relationship. This relationship is depicted using a Double Diamond symbol.
Since every weak entity must be associated with a strong entity, there is Total Participation, which is represented by Double Lines connecting the weak entity set to the identifying relationship.
Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.