Podcast
Questions and Answers
What does the relational database model primarily focus on when viewing data?
What does the relational database model primarily focus on when viewing data?
- Physical storage characteristics
- Data access speed
- Security protocols
- Logical structure (correct)
In the context of relational databases, what is an 'attribute' most accurately described as?
In the context of relational databases, what is an 'attribute' most accurately described as?
- A specific value in a table
- A relationship between tables
- A named column in a relation (correct)
- A row in a table
What is the significance of a 'domain' in a relational database?
What is the significance of a 'domain' in a relational database?
- It determines the access privileges for different users.
- It represents the physical storage location of the data.
- It defines relationships between tables.
- It specifies the allowable values for an attribute. (correct)
Which statement accurately describes a characteristic of a relational table?
Which statement accurately describes a characteristic of a relational table?
In a relational database, why is the order of rows and columns considered immaterial to the DBMS?
In a relational database, why is the order of rows and columns considered immaterial to the DBMS?
What is the primary purpose of requiring each table in a relational database to have an attribute that uniquely identifies each row?
What is the primary purpose of requiring each table in a relational database to have an attribute that uniquely identifies each row?
Which definition accurately describes a 'relation' in the context of relational databases?
Which definition accurately describes a 'relation' in the context of relational databases?
Consider a database table 'Employees' with columns 'EmployeeID', 'FirstName', 'LastName', and 'HireDate'. Which column or combination of columns would best serve as a primary key?
Consider a database table 'Employees' with columns 'EmployeeID', 'FirstName', 'LastName', and 'HireDate'. Which column or combination of columns would best serve as a primary key?
What is 'cardinality' of a relation?
What is 'cardinality' of a relation?
What is 'degree' of a relation?
What is 'degree' of a relation?
What best describes a candidate key?
What best describes a candidate key?
In a database 'Students' table, 'StudentID' and 'Email' could both uniquely identify a student. 'StudentID' is chosen as primary key. What is 'Email' considered in this scenario?
In a database 'Students' table, 'StudentID' and 'Email' could both uniquely identify a student. 'StudentID' is chosen as primary key. What is 'Email' considered in this scenario?
Which of the following accurately describes a 'composite key'?
Which of the following accurately describes a 'composite key'?
In a database with tables 'Orders' (OrderID, CustomerID) and 'Customers' (CustomerID, CustomerName), what role does 'CustomerID' play in the 'Orders' table?
In a database with tables 'Orders' (OrderID, CustomerID) and 'Customers' (CustomerID, CustomerName), what role does 'CustomerID' play in the 'Orders' table?
In a relational database, what does 'functional dependence' between two attributes, A and B mean?
In a relational database, what does 'functional dependence' between two attributes, A and B mean?
Why are nulls often avoided in relational databases?
Why are nulls often avoided in relational databases?
What is the term for the acceptable duplication of primary or foreign keys in a database that is required to make the relationship work?
What is the term for the acceptable duplication of primary or foreign keys in a database that is required to make the relationship work?
In a database where a foreign key exists, what does having a foreign key enable that helps minimize data redundancy?
In a database where a foreign key exists, what does having a foreign key enable that helps minimize data redundancy?
What is the primary purpose of entity integrity in a relational database?
What is the primary purpose of entity integrity in a relational database?
What is the main goal of referential integrity in a relational database?
What is the main goal of referential integrity in a relational database?
Referential integrity states the foreign key can be null or which of the following?
Referential integrity states the foreign key can be null or which of the following?
Under what condition would a relational database have a 1:1 relationship?
Under what condition would a relational database have a 1:1 relationship?
Which of the following most accurately describes a 'data dictionary' in the context of database management?
Which of the following most accurately describes a 'data dictionary' in the context of database management?
What is the main difference between a data dictionary and a system catalog?
What is the main difference between a data dictionary and a system catalog?
What does a database index primarily consist of?
What does a database index primarily consist of?
What is a characteristic of a unique index? What can its key have?
What is a characteristic of a unique index? What can its key have?
In relational database design, which type of relationship is generally considered the ideal and most commonly used?
In relational database design, which type of relationship is generally considered the ideal and most commonly used?
Why are many-to-many relationships difficult to implement directly in a relational model?
Why are many-to-many relationships difficult to implement directly in a relational model?
When a many-to-many relationship exists, how can you still implement a relational model?
When a many-to-many relationship exists, how can you still implement a relational model?
According to Codd's relational database rules, how should all data be stored?
According to Codd's relational database rules, how should all data be stored?
Codd’s rule that access can happen using table, column, and key relates to which of the following?
Codd’s rule that access can happen using table, column, and key relates to which of the following?
According to Codd, metadata must follow which step?
According to Codd, metadata must follow which step?
According to Codd, what independence must follow application programs and ad hoc facilities are logically unaffected when physical access methods and storage structures are changed?
According to Codd, what independence must follow application programs and ad hoc facilities are logically unaffected when physical access methods and storage structures are changed?
According to Codd, what independence includes end users and application programs are unaware and unaffected by the data location between distributed and local databases?
According to Codd, what independence includes end users and application programs are unaware and unaffected by the data location between distributed and local databases?
According to Codd, if the system supports low-level access to the data, there must not be a way to bypass the integrity rules of the database. Which rule is this?
According to Codd, if the system supports low-level access to the data, there must not be a way to bypass the integrity rules of the database. Which rule is this?
How do relational models handle many-to-many relationships?
How do relational models handle many-to-many relationships?
What does the 'systematic treatment of nulls' rule in Codd's 12 rules emphasize?
What does the 'systematic treatment of nulls' rule in Codd's 12 rules emphasize?
A database designer aims to create a table that stores information about employees and their job titles. Each employee can hold multiple titles during their tenure. Which type of relationship would be most appropriate between 'Employees' and 'JobTitles' tables?
A database designer aims to create a table that stores information about employees and their job titles. Each employee can hold multiple titles during their tenure. Which type of relationship would be most appropriate between 'Employees' and 'JobTitles' tables?
What was the primary motivation behind Codd's publication of 12 rules for relational databases?
What was the primary motivation behind Codd's publication of 12 rules for relational databases?
Flashcards
What is a relation?
What is a relation?
A relation is a table with columns and rows, forming the basic structure of a relational database.
What is an attribute?
What is an attribute?
An attribute is a named column of a relation, representing a specific characteristic of the entity.
What is a record?
What is a record?
A record is a logically connected set of one or more fields that describe a person, place, or thing.
What is a domain?
What is a domain?
Signup and view all the flashcards
What does each row represent?
What does each row represent?
Signup and view all the flashcards
Table column represents?
Table column represents?
Signup and view all the flashcards
Content of each cell?
Content of each cell?
Signup and view all the flashcards
Values in a single column?
Values in a single column?
Signup and view all the flashcards
Range of values for each column?
Range of values for each column?
Signup and view all the flashcards
Order of table row and column?
Order of table row and column?
Signup and view all the flashcards
Requirement of each table?
Requirement of each table?
Signup and view all the flashcards
Cardinality of a relation?
Cardinality of a relation?
Signup and view all the flashcards
Degree of a relation?
Degree of a relation?
Signup and view all the flashcards
What do keys consist of?
What do keys consist of?
Signup and view all the flashcards
Candidate key?
Candidate key?
Signup and view all the flashcards
Primary Key (PK)?
Primary Key (PK)?
Signup and view all the flashcards
Composite key?
Composite key?
Signup and view all the flashcards
Foreign Key (FK)?
Foreign Key (FK)?
Signup and view all the flashcards
What is determination in databases?
What is determination in databases?
Signup and view all the flashcards
What is Functional dependence?
What is Functional dependence?
Signup and view all the flashcards
What are Nulls?
What are Nulls?
Signup and view all the flashcards
Controlled redundancy?
Controlled redundancy?
Signup and view all the flashcards
Entity Integrity?
Entity Integrity?
Signup and view all the flashcards
Referential Integrity?
Referential Integrity?
Signup and view all the flashcards
Purpose of a Data Dictionary?
Purpose of a Data Dictionary?
Signup and view all the flashcards
System catalogue definition?
System catalogue definition?
Signup and view all the flashcards
What are Indexes?
What are Indexes?
Signup and view all the flashcards
1:* Relationship?
1:* Relationship?
Signup and view all the flashcards
1:1 Relationship?
1:1 Relationship?
Signup and view all the flashcards
: Relationships?
: Relationships?
Signup and view all the flashcards
Convert : to?
Convert : to?
Signup and view all the flashcards
Study Notes
- The relational database model takes a logical view of data.
- Relations are components in a relational model which are implemented through tables in a relational DBMS.
- Relations tables are made up rows and columns.
Relational Data Structure
- A relation is a table with columns and rows
- An attribute is a named column of a relation
- A record is a logically connected set of one or more fields that describe a person, place, or thing
- A domain is the set of allowable values for one or more attributes.
Characteristics of a Relational Table
- A relational table is perceived as a two-dimensional structure composed of rows and columns.
- Each row (tuple) represents a single entity and must be distinct.
- Each column represents an attribute and has a distinct name.
- Each cell must contain an atomic value—a single cell value.
- All values in a column must conform to the same data format.
- Each column has a specific range of values known as the attribute domain.
- The order of the rows and columns is inconsequential to the DBMS.
- Each table must have an attribute that uniquely identifies each row.
Relational Schema Terminology
- Relational schema is the textual representation of database tables.
- Each table is described by its name followed by a list of its attributes in parentheses.
- Example Schema:
Student(Stud_Num, FirstName, Surname, Age)
- Cardinality of a relation refers to the tally its rows.
- Degree of a relation refers to its attributes/columns.
Keys
- Keys consist of one or more attributes that determine other attributes
- Candidate key is an attribute that determines all the other attributes in the relation; the primary key can be chosen from these.
- Candidate keys can uniquely identify database records without referring to other data. The one unique key is called the primary key, and is usually the best one to use for identification.
- Primary Key (PK) is an attribute that uniquely identifies any given row.
- Composite key is a key composed of more than one attribute.
- Foreign Key (FK) is an attribute whose values match primary key values in the related table.
- Keys' role is based on determination.
- If the value of attribute A is known, attribute B can be determined when applying determination
- Functional dependence signifies that Attribute B is functionally dependent on attribute A if each value in column A determines only one unique value in column B
Null Values
- Nulls signifies no data entry
- Must not be set in a primary key
- Should be avoided in other attributes if possible
- Represents:
- An unknown attribute value
- A known, but missing, attribute value
- Or a "not applicable" condition
- Can create problems when functions such as COUNT, AVERAGE, and SUM are in operation
Controlled Redundancy
- Controlled redundancy is when tables within the database share primary/foreign keys allowing linking the tables together.
- Multiple occurrences of values in a table are not redundant when they are required to make the relationship work. Example: foreign key
- Redundancy exists only when attribute values are duplicated.
- Foreign keys avoid duplicating attributes; in that way, there's redundancy control.
Integrity
- Two types:
- Entity integrity
- Referential integrity
Entity Integrity
- Ensures that each row is uniquely identified by the primary key.
- Ensures that a search will find an existing row will always be successful.
- If no match is found then the record is missing in the table
Referential Integrity
- Referential integrity concerns how tables reference each other.
- This relationship with FK
- FK can EITHER be null or must be a valid entry in the table to which it is related
- FK value must reference an existing primary key value
- It is possible for an attribute to NOT have a corresponding value, but it will be impossible to have an invalid entry
- Example
- A customer may not yet have an assigned sales representative (number)
- It will be impossible to have an invalid sales representative (number).
Data Dictionary
- A data dictionary provides a detailed summary for all tables found within the database
- Contains (at least) all the attribute names and characteristics for each table in the system.
- Data Dictionaries contain “metadata”—data about data.
System Catalog
- System catalogue is a detailed system data dictionary.
- Describes all objects within the database.
- Includes data about table names, the table's creator & creation date, the number of columns in each table, the data type of each column, index filenames, index creators and authorized users and access privileges.
- DBMS only provides a system catalogue from which the database designer can construct his/her data dictionary.
Indexes
- Indexes function as logical arrangements used to logically access rows in a table like finding a book in the library or a topic in a book.
- An index consist of an index key and a set of pointers.
- The index key is an index's reference point like a primary key.
- Pointers are identifiers, e.g. numbers that point to the data location, which is identified by the key.
- A unique index is one in which the index key can have only one pointer value (row) associated with it.
Relationships within the Relational Database
- Three types:
- 1:* relationship
- 1:1 relationship
- : relationships
One-to-Many relationship
- Relational modeling ideal.
- Should be the norm in any relational database design.
One-to- One Relationship
- Should be rare in any relational database design.
Many-to-Many Relationship
- Cannot be implemented as such in the relational model
- Can be changed into two 1:* relationships.
Codd's Relational Database Rules
- In 1985, E F Codd published a list of 12 rules to define a relational database system.
- The list existed because many vendors were marketing products as "relational" even though those products did not meet minimum relational standards.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.