Unit 4 : Relational Database Flashcards
What does relational model enables programer to do?
- To view data logically rather than physically
What is the advantages of a table in the relational model?
- Has the advantage of structural and data independence
What does a table in the relational model resemble from conceptual point of view ?
- A file
What table is easier to understand its hierarchical and network database predecessors?
- Relational Model
- Order
1. Hierarchical
2. Network
3. Relational
4. Entity Relationship
What does table consists? ( 2 )
- Rows
- Columns
What does entity set consists?
- Contains group of related entities
Why does table is also called as relation?
- Because Codd used the term relation as a synonym for table
What can we think table as?
- A persistent relation ( A relation whose contents can be permanently saved for future use )
What does keys consists?
- Consists of one or more attributes that determine other attributes
- The key’s role is based on determination :
- If you know the value of attribute A, you can look up ( determine ) the value of attribute B
What is primary key?
- An attribute ( combination of attributes ) that uniquely identifies any given entity ( row )
What is a foreign key ?
- An attribute whose values match primary key values in the related table
What is secondary key?
- Key used strictly for data retrieval purposes
What is candidate key?
- Any column or a combination of columns that can qualify as unique key in database
What is referential integrity?
- Foreign Keys contains a value that refers to an existing valid tuple ( row ) in another relation
- IT ensures that relationships between tables in a relational database remain consistent. It focuses on maintaining valid connections between primary keys (PK) and foreign keys (FK)
Can we insert multiple candidate key ?
- Yes , it can also qualify as primary key
How to select primary key? ( 3 )
- Select a key that does not contain null
- Select a key that is unique and does not repeat
- Make sure that primary key does not keep changing
What has no data entry, not permitted in primary key and should be avoided in other attributes?
- NULL
What can NULL represent?
- An unknown attribute value
- A known, but missing, attribute value
- A “not applicable” condition
What problems can NULL create?
- Create problems when functions such as COUNT, AVERAGE, and SUM are used
- Can create logical problems when relational tables are linked
What role does controlled redundancy play in a relational database?
- Controlled redundancy makes the relational database work.
How do tables within a relational database share information?
- Tables within the database share common attributes that enable the tables to be linked together.
- Share common attributes that enable tables to be linked together
When is the occurrence of multiple values in a table not considered redundant?
- Multiple occurrences of values in a table are not redundant when they are required to make the relationship work
- When required to make the relationship work
When does redundancy exist in a relational database?
- Redundancy exists only when there is unnecessary duplication of attribute values.
- When unnecessary duplication of attribute values
What is a data dictonary?
- A data dictionary provides detailed accounting of all tables found within the user/designer-created database.
What information does a data dictionary contain?
- It contains at least all the attribute names and characteristics for each table in the system.
What type of data does a data dictionary hold?
- A data dictionary contains metadata—data about data.
Why is the data dictionary sometimes described as “the database designer’s database” ?
- Because it records the design decisions about tables and their structures.
What are the besic building blocks of a relational database
- Tables
List out the types of integrity rules ( 2 )
- Entity Integrity
- Referential Integrity
What is the requirement of entity integrity?
- All primary key entities are unique, and no part of a primary key may be null
What is the purpose of entity integrity?
- Each row will have a unique identity, and foreign key values can properly reference primary key values
What is the requirement of referential integrity?
- A foreign key may have either a null entry - as long as it is not a part of its table’s primary key - or an entry that matches the primary key value in a table to which it is related
What is the purpose of referencial integrity?
- It is possible for an attribute NOT to have a corresponding value, but it will be impossible to have an invalid entry. The enforcement of the referential integrity rule makes it impossible to delete a row in one table whose primary key has mandatory matching foreign key in another table
What is known for each column has a specific range of values ?
- Attributes Domain