ASSIGNMENT

ASSIGNMENT
ASSIGNMENT
Q.1 Explain Codd’s Rules.
Answer :-
Codd’s rules, proposed by Dr. Edgar F. Codd in 1985, serve as a benchmark for evaluating whether a database management system (DBMS) is truly relational.
Codd originally defined 12 rules, including a rule 0, which collectively outline the characteristics a system must exhibit to qualify as a relational database.
These rules ensure data integrity, independence, and consistency in relational database management systems (RDBMS).
Rule 0: Foundation Rule :
For a system to qualify as a relational database, it must manage data entirely through its relational capabilities.
The system must use relational techniques for data storage, retrieval, and manipulation without relying on external tools or approaches.
Rule 1: Information Rule :
All information in the database is represented in a single logical way—as values in tables.
Data is stored in tables, with each table consisting of rows (tuples) and columns (attributes).
The database uses these tables as the sole method to represent both the data and its metadata (e.g., table names, column names).
Rule 2: Guaranteed Access Rule
Every data element is accessible by a combination of table name, primary key, and column name.
This rule ensures that every piece of information in the database can be uniquely identified and accessed.
Rule 3: Systematic Treatment of Null Values
Null values are uniformly supported for representing missing or inapplicable data.
Null values must be distinctly handled, separate from zero or an empty string.
Nulls indicate that a value is either unknown, missing, or irrelevant.
Rule 4: Active Online Catalog
The database must have a self-describing nature, storing metadata within the database itself and making it accessible via query.
Metadata (such as table structures, relationships, and constraints) is stored in a format that users can query using the same methods as data.
Rule 5: Comprehensive Data Sub-Language Rule
A single language, such as SQL, must support all tasks, including:
Data Definition Language (DDL) for creating and modifying schemas.
Data Manipulation Language (DML) for querying and updating data.
Data Control Language (DCL) for managing access permissions.
Rule 6: View Updating Rule
Any view that is theoretically updatable must be updatable through the system.
A view (virtual table) provides a filtered or transformed perspective of data.
If a view logically supports updates, the database must allow users to perform updates on the view, which will reflect on the base table.
Rule 7: High-Level Insert, Update, and Delete
The database must support set-level operations for modifying data.
Users should be able to insert, update, or delete multiple rows simultaneously using a single command, rather than operating on rows individually.
Rule 8: Physical Data Independence
Changes to the physical storage structure should not affect how data is accessed at the logical level.
For example, reorganizing data on disk, adding indexes, or changing storage devices should not require modifications to user queries or applications.
Rule 9: Logical Data Independence
Changes to the logical structure (schema) of the database should not affect existing applications.
For instance, adding a new column to a table should not disrupt existing queries that do not use that column.
Rule 10: Integrity Independence
Integrity constraints must be defined in the database and not in application programs.
Constraints such as primary keys, foreign keys, and check conditions should be enforced by the database itself, ensuring data integrity regardless of the application interacting with the database.
Rule 11: Distribution Independence
The database should function as if it were centralized, even if the data is distributed across multiple locations.
Users and applications should not need to know whether the data is stored locally or across various servers.
Rule 12: Non-Subversion Rule
No low-level operation should bypass the integrity rules defined in the database.
If the system provides alternative access methods (e.g., direct file manipulation), they must not compromise the integrity constraints or relational principles.