A · Compressed recap
An entity is a distinguishable thing (Asha); its entity type (STUDENT) is part of the schema and its entity set is the current collection. Attributes describe entities and take values from a domain. Chen notation: rectangle = entity type, ellipse = attribute.
Attribute kinds: composite (parts, e.g. name(first, last)) vs simple; multivalued (several values, double ellipse) vs single-valued; derived (computed, dashed ellipse) vs stored; NULL = not applicable or unknown. A key attribute (underlined) is unique for every entity in every possible state; it may be composite, and a type may have several keys.
B · Merged rule card
1.1.1 Entity, entity set, attribute, domain
- Entity = distinguishable thing we store data about. Entity type = category (schema); entity set = current collection (instance).
- Attribute = property of an entity; domain (value set) = allowed values.
- Chen: rectangle = entity type; ellipse = attribute.
- Make it an entity if several facts are kept about it or other things link to it.
1.1.2 Attribute types: simple/composite, single/multivalued, stored/derived, NULL-able, key attribute
- Simple vs composite (has parts); single-valued vs multivalued (set of values, double ellipse); stored vs derived (computed, dashed ellipse).
- NULL = no value: not applicable or unknown. Not 0, not "".
- Key attribute: unique for every entity in every possible state; underlined; may be composite; an entity type may have several keys.
- Store dob, derive age.
C · Interleaved GATE-style questions
Q1 · MCQ · 1 mark(s) — Entity vs attribute
The college records each department's building and head, and links students and courses to departments. DEPARTMENT should be:
- (A) an entity type
- (B) a multivalued attribute of STUDENT
- (C) a domain
- (D) a derived attribute
Q2 · MCQ · 1 mark(s) — Notation
Which pairing is wrong?
- (A) dashed ellipse – derived attribute
- (B) underlined attribute – key
- (C) rectangle – attribute
- (D) double ellipse – multivalued attribute
Q3 · MSQ · 2 mark(s) — Attribute kinds
Which attributes are derived?
- (A) number_of_courses_taken (when enrolments are stored)
- (B) dob
- (C) age (when dob is stored)
- (D) roll
Q4 · MCQ · 1 mark(s) — Keys
Library books have copy numbers 1, 2, 3, … per title (each ISBN). The key of COPY is:
- (A) isbn
- (B) (isbn, copy_no)
- (C) title
- (D) copy_no
Q5 · MCQ · 1 mark(s) — Entity set
Which changes when a student leaves the college?
- (A) The attribute list of STUDENT
- (B) The domain of roll
- (C) The entity type STUDENT
- (D) The entity set of STUDENT
Q6 · MCQ · 2 mark(s) — NULL
A student's phone number exists but the college has not recorded it. Storing NULL here means:
- (A) not applicable
- (B) zero
- (C) the student has no phone
- (D) unknown
Q7 · MCQ · 1 mark(s) — Composite
Which is composite but single-valued?
- (A) phone (several per student)
- (B) roll
- (C) age
- (D) name(first, last)
Q8 · MSQ · 2 mark(s) — Keys
STUDENT has attributes roll, aadhaar_no, name, email (each student has one email, unique to that student). Which can be keys?
- (A) name
- (B) roll
- (C) aadhaar_no
- (D) email
D · Answer Vault
Reveal answers when you’re ready
Q1 Answer: (A) · 1 mark(s)
Several facts about it and links to it.
- (B) is wrong: Would repeat department facts.
- (C) is wrong: Not a set of values.
- (D) is wrong: Not computed.
Re-read: Lesson 1.1.1 — Entity, entity set, attribute, domain
Q2 Answer: (C) · 1 mark(s)
Rectangles are entity types.
- (A) is wrong: Correct pairing.
- (B) is wrong: Correct pairing.
- (D) is wrong: Correct pairing.
Re-read: Lesson 1.1.2 — Attribute types: simple/composite, single/multivalued, stored/derived, NULL-able, key attribute
Q3 Answer: (A) (C) · 2 mark(s)
Both can be computed from stored data.
- (B) is wrong: Stored.
- (D) is wrong: Stored key.
Re-read: Lesson 1.1.2 — Attribute types: simple/composite, single/multivalued, stored/derived, NULL-able, key attribute
Q4 Answer: (B) · 1 mark(s)
Copy numbers repeat across titles; only the pair is unique.
- (A) is wrong: Repeats across copies.
- (C) is wrong: Not unique.
- (D) is wrong: Repeats across titles.
Re-read: Lesson 1.1.2 — Attribute types: simple/composite, single/multivalued, stored/derived, NULL-able, key attribute
Q5 Answer: (D) · 1 mark(s)
The set is the instance.
- (A) is wrong: Schema.
- (B) is wrong: Allowed values do not change.
- (C) is wrong: The type is schema.
Re-read: Lesson 1.1.1 — Entity, entity set, attribute, domain
Q6 Answer: (D) · 2 mark(s)
Exists but not known.
- (A) is wrong: The value does apply.
- (B) is wrong: NULL is not zero.
- (C) is wrong: That would be "not applicable".
Re-read: Lesson 1.1.2 — Attribute types: simple/composite, single/multivalued, stored/derived, NULL-able, key attribute
Q7 Answer: (D) · 1 mark(s)
One name with two parts.
- (A) is wrong: Multivalued.
- (B) is wrong: Simple.
- (C) is wrong: Derived, simple.
Re-read: Lesson 1.1.2 — Attribute types: simple/composite, single/multivalued, stored/derived, NULL-able, key attribute
Q8 Answer: (B) (C) (D) · 2 mark(s)
Each is guaranteed unique per student; names can repeat.
- (A) is wrong: Two students can share a name.
Re-read: Lesson 1.1.2 — Attribute types: simple/composite, single/multivalued, stored/derived, NULL-able, key attribute