Unit 3 - Relational Model and Database Concepts
Unit 3 - Relational Model and Database Concepts
The relational model is a database model based on the concept of tables, where data is represented in rows and columns. Key
components include:
In the relational model, keys are used to uniquely identify records within a table. Key concepts include:
Super Key: A set of one or more attributes that can uniquely identify a record.
Candidate Key: A minimal super key, i.e., a key with no unnecessary attributes.
Primary Key: A selected candidate key that uniquely identifies each record in a table.
Foreign Key: An attribute in one table that refers to the primary key in another table, establishing a relationship between the
two tables.
Integrity Constraints
Integrity constraints are rules that ensure the accuracy and consistency of data in a database. There are two
types of integrity constraints: Implicit and Explicit Constraints.
Implicit Constraints
Implicit constraints are automatically enforced by the database management system without any user intervention. Common
examples include:
Domain Integrity: Ensures that values in a column satisfy a specified data type or range of values.
Entity Integrity: Requires each row in a table to have a unique identifier, often achieved through a primary key.
Referential Integrity: Maintains consistency between related tables, ensuring that foreign key values match existing
primary key values in the referenced table.
Explicit Constraints
Explicit constraints are rules defined by the user to impose additional business logic or data integrity requirements. Common
examples include:
Check Constraints: Define specific conditions that must be satisfied for data in a column.
Unique Constraints: Ensure that the values in a column or a combination of columns are unique across the table.
Foreign Key Constraints: Establish relationships between tables, where values in one table's column must match values
in another table's primary key.
Entity Integrity Constraint ensures that each row in a table is uniquely identifiable. This is typically achieved through the use of a
primary key. The primary key ensures that no duplicate rows exist in the table and allows for efficient data retrieval based on its
value.
Referential Integrity Constraint maintains consistency between related tables. When a foreign key is established in a table, the
referential integrity constraint ensures that the values in that column match the values of the primary key in the referenced table.
It prevents orphaned records and maintains data relationships.
Secrecy
Secrecy involves safeguarding sensitive data from unauthorized access. This is achieved through encryption, access control
mechanisms, and secure communication protocols. By maintaining secrecy, only authorized users can view or manipulate the
protected data.
Integrity
Integrity ensures that data remains accurate and unaltered throughout its lifecycle, preventing unauthorized modifications or
tampering. Techniques like data hashing and digital signatures are used to verify data integrity, enabling the detection of any
unauthorized changes.
Availability
Availability refers to the accessibility and operational status of computer systems and data when needed. Measures such as
redundancy, load balancing, and disaster recovery plans are implemented to ensure continuous availability and minimize
downtime.
Relational algebra and calculus are formal languages used to manipulate and query relational databases. They are used to perform
operations like selection, projection, join, and set operations on tables.
Operational in nature and uses operators Non-operational and uses expressions Relational algebra focuses on how to
like σ (selection), π (projection), &join; with variables and quantifiers to specify retrieve data, while relational calculus
(join), ∪ (union), etc. the desired result. focuses on what data to retrieve.