chapter

    Relational Model, Er Design and Schema Architecture Short Notes for Gate Cs

    Relational Model, Er Design and Schema Architecture short notes for GATE CS: 3 study cards covering concepts, formulas, shortcuts and exam traps, plus solved

    Relational Model Er Design and Schema Architecture short notes

    Quick Revision: ER Modeling Essentials

    Quick Revision Checklist

    Symbols

    • Rect: Entity (Double = Weak)
    • Diamond: Relationship (Double = Identifying)
    • Oval: Attribute (Double = Multi-valued)
    • Double Line: Total Participation

    Weak Entity Rules

    • Total participation in identifying relationship
    • Identifying relationship is many-to-one
    • Complete ID = (Owner PK, Partial Key)

    Is it a Weak Entity?

    Cannot exist without owner?
    Cannot be uniquely identified without owner's key?
    Represents a component/part of owner?
    If all yes → Weak Entity
    Avoid These Mistakes
    • Calling every dependent entity "weak"
    • Forgetting total participation for weak entities
    • Using many-to-many for identifying relationships

    Quick Revision: Keys and Constraints

    Essential Facts

    Structure

    • Degree: Number of Attributes (Columns)
    • Cardinality: Number of Tuples (Rows)

    Keys

    • Super Key: Uniquely identifies tuple (may have redundancy).
    • Candidate Key: Minimal Super Key (no redundancy).
    • Primary Key: Chosen Candidate Key (Unique + Not Null).
    • Foreign Key: References PK of another table (Can be Null/Duplicate).

    Integrity Constraints

    1. Domain: Atomic, correct data type.
    2. Entity: PK NULL.
    3. Referential: FK matches PK or is NULL.
    4. Key: PK is Unique.
    Common Traps
    • FK must be Unique.
    • Only one FK per table.
    • FK cannot reference same table.
    • Degree = Number of Rows.

    Three-Schema Architecture: Quick Revision

    Three-Schema Architecture: Quick Revision

    Component Description Key Property
    External Schema User-specific views of the data. Hides the rest of the database.
    Logical Schema Global structure of the entire database. Defines relations, attributes, constraints.
    Physical Schema Actual storage details on disk. Defines files, indexes, compression.
    Physical Independence Modify physical without changing logical. Easy to achieve.
    Logical Independence Modify logical without changing external. Hard to achieve.

    Try a question

    Answer it here to see how it works. Nothing is recorded until you sign in.

    Question 1
    Level 1: Warm-up

    Consider the specification: "Each Project is managed by exactly one Department. Each Department manages at least one Project." Which one of the following statements about the ER diagram for this specification is TRUE?

    Question 2
    Level 1: Warm-up

    A relation Employee has attributes EmpID (Primary Key) and ManagerID (Foreign Key referencing EmpID). If there are $10$ employees in the relation, and every employee except the CEO has a manager, what is the minimum number of distinct ManagerID values that must exist in the table?

    Question 3
    Level 1: Warm-up

    An ER diagram contains $6$ weak entity sets. Each weak entity set has a distinct owner entity set (no two weak entities share the same owner). According to standard ER modeling rules, what is the minimum number of relationships that must show total participation (represented by a double line) from at least one side?

    Question 4
    Level 1: Warm-up

    An ER diagram contains exactly $5$ weak entity sets, and no two weak entity sets share the same owner entity set. According to standard ER modeling rules, what is the minimum number of relationships in this ER diagram that must exhibit total participation from at least one participating entity set?

    Question 5
    Level 1: Warm-up

    Which of the following represent the minimum necessary components to correctly model and uniquely identify an instance of a weak entity set in an ER diagram?

    Question 6
    Level 1: Warm-up

    Which of the following represent the minimum necessary conditions to classify an entity set as a weak entity set in an ER model?

    Question 7
    Level 1: Warm-up

    A relationship connects entity sets and with cardinality (one to many ). There are $6$ instances of and $15$ instances of . Each instance of is related to exactly one instance of , and participation of in is partial. What is the minimum number of instances that must participate in ?

    Question 8
    Level 1: Warm-up

    Consider the following statements about foreign keys in the relational model:

    S1: A relation can have more than one foreign key.

    S2: A foreign key must always reference a primary key in a different relation.

    Which one of the following choices is correct?

    Question 9
    Level 1: Warm-up

    A relation Employee has attributes EmpID, SSN, Name, Dept. It is given that EmpID is unique and SSN is also unique. Name and Dept are not unique. What is the exact number of candidate keys this relation can have?

    Question 10
    Level 1: Warm-up

    Consider the following statements about a relational schema:

    S1: A relation can have zero foreign keys.

    S2: A foreign key in a relation can reference the primary key of the same relation.

    Which one of the following choices is correct?

    Free preview ends here

    Login to view the complete short notes

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Explore complete test series, official past papers, and chapter-wise study tools.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    Relational Model, Er Design and Schema Architecture Short Notes for GATE CS

    Relational Model, Er Design and Schema Architecture short notes for GATE CS: 3 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practice questions.

    Quick Revision: ER Modeling Essentials

    Quick Revision Checklist

    Symbols

    • Rect: Entity (Double = Weak)
    • Diamond: Relationship (Double = Identifying)
    • Oval: Attribute (Double = Multi-valued)
    • Double Line: Total Participation

    Weak Entity Rules

    • Total participation in identifying relationship
    • Identifying relationship is many-to-one
    • Complete ID = (Owner PK, Partial Key)

    Is it a Weak Entity?

    Cannot exist without owner?
    Cannot be uniquely identified without owner's key?
    Represents a component/part of owner?
    If all yes → Weak Entity
    Avoid These Mistakes
    • Calling every dependent entity "weak"
    • Forgetting total participation for weak entities
    • Using many-to-many for identifying relationships

    Quick Revision: Keys and Constraints

    Essential Facts

    Structure

    • Degree: Number of Attributes (Columns)
    • Cardinality: Number of Tuples (Rows)

    Keys

    • Super Key: Uniquely identifies tuple (may have redundancy).
    • Candidate Key: Minimal Super Key (no redundancy).
    • Primary Key: Chosen Candidate Key (Unique + Not Null).
    • Foreign Key: References PK of another table (Can be Null/Duplicate).

    Integrity Constraints

    1. Domain: Atomic, correct data type.
    2. Entity: PK NULL.
    3. Referential: FK matches PK or is NULL.
    4. Key: PK is Unique.
    Common Traps
    • FK must be Unique.
    • Only one FK per table.
    • FK cannot reference same table.
    • Degree = Number of Rows.

    Three-Schema Architecture: Quick Revision

    Three-Schema Architecture: Quick Revision

    Component Description Key Property
    External Schema User-specific views of the data. Hides the rest of the database.
    Logical Schema Global structure of the entire database. Defines relations, attributes, constraints.
    Physical Schema Actual storage details on disk. Defines files, indexes, compression.
    Physical Independence Modify physical without changing logical. Easy to achieve.
    Logical Independence Modify logical without changing external. Hard to achieve.

    Relational Model, Er Design and Schema Architecture: Solved Questions with Step-by-Step Explanations (10 Problems)

    Question 1 · Databases MCQ

    Consider the specification: "Each Project is managed by exactly one Department. Each Department manages at least one Project." Which one of the following statements about the ER diagram for this specification is TRUE?

    1. A.

      The relationship between Department and Project is many-to-many

    2. B.

      Project is a weak entity set with Department as its owner

    3. C.

      The relationship from Department to Project has cardinality 1:N

    4. D.

      Department has partial participation in the managing relationship

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: Translate the English specification into ER constraints step by step.

    Step 1: "Each Project is managed by exactly one Department" → For each Project, there is exactly one Department. This means from Project to Department, it is N:1, or equivalently, from Department to Project, it is 1:N.

    Step 2: "Each Department manages at least one Project" → Every Department must manage at least one Project. This means Department has total participation in the relationship.

    Step 3: Evaluate options:

    • A: Many-to-many → False, it is 1:N.
    • B: Project is weak → False, no indication Project depends on Department for identification.
    • C: 1:N from Department to Project → True, matches Step 1.
    • D: Partial participation for Department → False, "at least one" means total participation.

    Answer: C

    Question 2 · Databases MCQ

    A relation Employee has attributes EmpID (Primary Key) and ManagerID (Foreign Key referencing EmpID). If there are $10$ employees in the relation, and every employee except the CEO has a manager, what is the minimum number of distinct ManagerID values that must exist in the table?

    1. A.

      1

    2. B.

      0

    3. C.

      9

    4. D.

      10

    Correct Answer:

    A

    Step-by-Step Solution

    Insight: Minimum distinct managers occurs when all employees who have a manager report to the exact same person.

    Exam route: 9 employees have a manager. They can all report to 1 manager. Minimum = 1.

    Learning route: The relation has 10 employees. The CEO does not have a manager, so the CEO's ManagerID is NULL. The remaining 9 employees must have a valid ManagerID. The question asks for the minimum number of distinct ManagerID values. Since a foreign key can be duplicate, all 9 employees could theoretically report to the same single manager (who is also an employee in the table). Therefore, the minimum number of distinct ManagerID values is 1.

    Tempting wrong path: A student might assume each of the 9 employees has a distinct manager, yielding 9 (option C). This breaks because the question asks for the minimum possible distinct values, not the maximum.

    Generalization: When asked for the minimum number of foreign key values, assume maximum duplication unless constraints forbid it.

    Verification: 1 distinct manager can satisfy the requirement for all 9 employees.

    Question 3 · Databases MCQ

    An ER diagram contains $6$ weak entity sets. Each weak entity set has a distinct owner entity set (no two weak entities share the same owner). According to standard ER modeling rules, what is the minimum number of relationships that must show total participation (represented by a double line) from at least one side?

    1. A.

      0

    2. B.

      6

    3. C.

      12

    4. D.

      3

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: Every weak entity set must have total participation in its identifying relationship.

    Step 1: Recall the rule — a weak entity cannot exist without its owner, so it must participate totally in the identifying relationship. This is shown with a double line on the weak entity side.

    Step 2: Count the identifying relationships. Since there are $6$ weak entity sets and each has a distinct owner, there are exactly $6$ identifying relationships (one per weak entity).

    Step 3: Each identifying relationship must have total participation from the weak entity side. So all $6$ relationships must show total participation.

    Step 4: The owner side can have partial or total participation, but the question asks for the minimum number of relationships with total participation from at least one side. Since all $6$ have it from the weak entity side, the minimum is $6$.

    Answer: 6

    Common trap: Students might think both sides need total participation (giving 12) or forget the rule entirely (giving 0).

    Question 4 · Databases NAT

    An ER diagram contains exactly $5$ weak entity sets, and no two weak entity sets share the same owner entity set. According to standard ER modeling rules, what is the minimum number of relationships in this ER diagram that must exhibit total participation from at least one participating entity set?

    Correct Answer:

    5.00

    Step-by-Step Solution

    Key idea: Every weak entity set must have total participation in its identifying relationship.

    Step 1: Recall the rule — a weak entity cannot exist without its owner, so it must participate totally in the identifying relationship. This is shown with a double line on the weak entity side.

    Step 2: Count the identifying relationships. Since there are $5$ weak entity sets and each has a distinct owner, there are exactly $5$ identifying relationships (one per weak entity).

    Step 3: Each identifying relationship must have total participation from the weak entity side. So all $5$ relationships must show total participation.

    Step 4: The owner side can have partial or total participation, but the question asks for the minimum number of relationships with total participation from at least one side. Since all $5$ have it from the weak entity side, the minimum is $5$.

    Answer: 5.00

    Common trap: Students might think both sides need total participation (giving 10) or forget the rule entirely (giving 0).

    Question 5 · Databases MSQ

    Which of the following represent the minimum necessary components to correctly model and uniquely identify an instance of a weak entity set in an ER diagram?

    1. A.

      A many-to-many identifying relationship

    2. B.

      The primary key of the owner entity set

    3. C.

      The partial key of the weak entity set

    4. D.

      Total participation of the weak entity set in the identifying relationship

    Correct Answer:

    ["B","C","D"]

    Step-by-Step Solution

    Key idea: A weak entity depends entirely on its owner for existence and identification.

    Step 1: The complete identifier of a weak entity is formed by combining the primary key of the owner entity set with the partial key of the weak entity set. (Options B and C are necessary).

    Step 2: Because a weak entity cannot exist without its owner, it must have total participation in the identifying relationship. (Option D is necessary).

    Step 3: The identifying relationship must be many-to-one from the weak entity to the owner, not many-to-many. (Option A is incorrect).

    Answer: B, C, D

    Question 6 · Databases MSQ

    Which of the following represent the minimum necessary conditions to classify an entity set as a weak entity set in an ER model?

    1. A.

      It cannot be uniquely identified without the primary key of an owner entity set.

    2. B.

      It must have total participation in its identifying relationship.

    3. C.

      It is existence-dependent on another entity set.

    4. D.

      It has a many-to-many relationship with its owner entity set.

    Correct Answer:

    ["A","B"]

    Step-by-Step Solution

    Key idea: A weak entity is defined by its identification dependence on an owner, not just existence dependence.

    Step 1: Evaluate A. A weak entity lacks a full primary key and relies on the owner's primary key plus its own partial key for unique identification. (True)

    Step 2: Evaluate B. Because a weak entity cannot exist without its owner, it must have total participation in the identifying relationship. (True)

    Step 3: Evaluate C. Existence dependence alone is not sufficient; a regular entity with a foreign key can be existence-dependent but is not weak. It must be identification-dependent. (False)

    Step 4: Evaluate D. An identifying relationship is strictly many-to-one from the weak entity to the owner, not many-to-many. (False)

    Answer: A, B

    Question 7 · Databases NAT

    A relationship connects entity sets and with cardinality (one to many ). There are $6$ instances of and $15$ instances of . Each instance of is related to exactly one instance of , and participation of in is partial. What is the minimum number of instances that must participate in ?

    Correct Answer:

    1.00

    Step-by-Step Solution

    Key idea: With 1:N cardinality and partial participation of A, one A instance can relate to multiple B instances.

    Step 1: Cardinality 1:N means one A can relate to many B's, but each B relates to exactly one A.

    Step 2: There are 15 B instances, each must relate to some A.

    Step 3: Since participation of A is partial, not all A's need to participate.

    Step 4: One A instance can relate to all 15 B instances (since 1:N allows many B's per A).

    Step 5: Therefore, minimum A instances participating = 1.

    Answer: 1.00

    Question 8 · Databases MCQ

    Consider the following statements about foreign keys in the relational model:

    S1: A relation can have more than one foreign key.

    S2: A foreign key must always reference a primary key in a different relation.

    Which one of the following choices is correct?

    1. A.

      Both S1 and S2 are true

    2. B.

      S1 is true and S2 is false

    3. C.

      S1 is false and S2 is true

    4. D.

      Both S1 and S2 are false

    Correct Answer:

    B

    Step-by-Step Solution

    Insight: Multiple foreign keys are allowed, and self-referencing foreign keys are allowed.

    Exam route: S1 is true, S2 is false. Option B.

    Learning route: Evaluate each statement:

    • S1: A relation can have multiple foreign keys referencing different tables or even the same table. This is true.
    • S2: A foreign key can reference the primary key of its own relation (self-referencing or recursive foreign key). Therefore, it does not must always reference a different relation. This is false.

    Since S1 is true and S2 is false, the correct choice is Option B.

    Tempting wrong path: A student might think S2 is true because foreign keys usually link different tables, leading to option A. This breaks because self-referencing is a valid and common pattern for hierarchical data (e.g., Employee-Manager).

    Generalization: Foreign keys are about references, not just links between distinct tables.

    Verification: S1 is a standard feature; S2 is explicitly debunked by the existence of recursive relationships.

    Question 9 · Databases MCQ

    A relation Employee has attributes EmpID, SSN, Name, Dept. It is given that EmpID is unique and SSN is also unique. Name and Dept are not unique. What is the exact number of candidate keys this relation can have?

    1. A.

      1

    2. B.

      2

    3. C.

      3

    4. D.

      4

    Correct Answer:

    B

    Step-by-Step Solution

    Insight: A candidate key must be unique and minimal.

    Exam route: EmpID and SSN are unique and minimal. Total = 2.

    Learning route:

    Step 1: Identify all unique attributes or combinations. EmpID is unique, and SSN is unique.

    Step 2: Check for minimality. A candidate key cannot have any proper subset that is also a super key.

    • EmpID is unique and minimal Candidate Key.
    • SSN is unique and minimal Candidate Key.
    • EmpID, SSN is unique but NOT minimal, because EmpID alone is sufficient. Thus, it is a super key, not a candidate key.

    Step 3: Count the candidate keys. There are exactly 2.

    Tempting wrong path: A student might include EmpID, SSN as a candidate key, yielding 3. This breaks the minimality rule, as a candidate key cannot contain redundant attributes.

    Generalization: Candidate keys are minimal super keys. If a single attribute is unique, any combination containing it is a super key, but not a candidate key.

    Verification: Only EmpID and SSN satisfy both uniqueness and minimality.

    Question 10 · Databases MCQ

    Consider the following statements about a relational schema:

    S1: A relation can have zero foreign keys.

    S2: A foreign key in a relation can reference the primary key of the same relation.

    Which one of the following choices is correct?

    1. A.

      Both S1 and S2 are true

    2. B.

      S1 is true and S2 is false

    3. C.

      S1 is false and S2 is true

    4. D.

      Both S1 and S2 are false

    Correct Answer:

    A

    Step-by-Step Solution

    Insight: Foreign keys are optional, and self-referencing foreign keys are a standard design pattern.

    Exam route: S1 is true (standalone tables exist). S2 is true (e.g., Employee-Manager hierarchy). Option A.

    Learning route:

    Step 1: Evaluate S1. A relation does not necessarily need to reference another table. For example, a standalone lookup table or a root entity may have no foreign keys. Thus, S1 is true.

    Step 2: Evaluate S2. A foreign key can reference the primary key of its own relation. This is called a self-referencing or recursive foreign key, commonly used for hierarchical data (e.g., an Employee table where ManagerID references EmpID in the same table). Thus, S2 is true.

    Tempting wrong path: A student might think S1 is false, believing every table must link to another, or S2 is false, believing foreign keys must link distinct tables. This breaks because relational theory places no lower bound on the number of foreign keys, and explicitly permits self-reference.

    Generalization: Foreign keys are about references, not mandatory links between distinct tables. Zero or self-references are both valid.

    Verification: Both statements align with the formal rules of the relational model.

    More short notes in this unit