Relational Model Flashcards
What is the definition of Data Model?
Data Model allows us to translate real world into structures that a computer can store
What does a relational model contain?
Rows and Columns (Tuples/records and Attributes /fields)
What is the definition of relational database?
a set of relations
What is the definition of relation?
Relations are made up of Schema and Instance
What is a schema?
It specifies name or relation, plus name and type of each column (attribute)
What is an instance?
A table, with rows and columns
rows = cardinality
fields = degree(or arity)
What are the steps in the entire design cycle?
- Conceptual
- Logical
- Physical
- Implementation
- Instance
How to create relations in SQL?
CREATE TABLE RelationName (entity1 CHAR(20), entity2 FLOAT, entity3 INTEGER etc etc entityN Type)
What is the definition of primary key?
A set of fields is a superkey if no two distinct tuples can have same values in all key fields
Example: Student id
What is a candidate key?
All the other keys that isn’t the primary key
What is the definition of Foreign Key?
A set of fields in one relation that is used to ‘refer’ to a tuple in another relation
What is the definition of IC(Integrity Constraints)?
condition that must be true for any instance of the database; e.g domain constraints
SAMPLE QUESTION 1:
Every Subject has exactly one professor. Not all professors have teaching, but they only teach one subject if they do.
Pick the CORRECT answer
a. Arrows are used in the diagram
b. Only thin (optional) lines are used
c. There exists a weak entity
d. A mandatory many notation was used
a. Arrows are used in the diagram
Why do we use, say, a multivalued attribute ‘phone number’ in the first place in Chen’s diagrams?
Depending on the business rules/design specs. Sometimes it makes sense to have just two phones (and skip the handling multivalued attributes step) in the first place
a. Sometimes it makes more sense to make ‘phone’ its own entity