Codd's rules Codd's 12 rules are a set of thirteen rules (numbered zero to twelve) proposed by Edgar F. Codd, a pioneer of the relational model for databases, designed to define what is required from a database management system in order for it to be considered relational, i.e., a relational database management system RDBMS
• Rule 0: The system must qualify as relational, as a database, and as a management system. For a system to qualify as a relational database management system ( RDBMS), that system must use its relational facilities (exclusively) to manage the database.
• Rule 1: The information rule: All information in the database is to be represented in one and only one way, namely by values in column positions within rows of tables.
• Rule 2: The guaranteed access rule: All data must be accessible. This rule is essentially a restatement of the fundamental requirement for primary keys. It says that every individual scalar value in the database must be logically addressable by specifying the name of the containing table, the name of the containing column and the primary key value of the containing row.
• Rule 3: Systematic treatment of null values: The DBMS must allow each field to remain null (or empty). Specifically, it must support a representation of "missing information and inapplicable information" that is systematic, distinct from all regular values (for example, "distinct from zero or any other number", in the case of numeric values), and independent of data type. It is also implied that such representations must be manipulated by the DBMS in a systematic way.
• Rule 4: Active online catalog based on the relational model: The system must support an online, inline, relational catalog that is accessible to authorized users by means of their regular query language. That is, users must be able to access the database's structure (catalog) using the same query language that they use to access the database's data.
• Rule 5: The comprehensive data sublanguage rule: The system must support at least one relational language that • Has a linear syntax • Can be used both interactively and within application programs, • Supports data definition operations (including view definitions), data manipulation operations (update as well as retrieval), security and integrity constraints, and transaction management operations (begin, commit, and rollback).
• Rule 6: The view updating rule: All views that are theoretically updatable must be updatable by the system.
• A view in a database is essentially a virtual table that is derived from a query on one or more base tables or other views. It does not store data itself; instead, it provides a way to access and manipulate data from the underlying tables through a predefined query.
• Rule 7: High-level insert, update, and delete: The system must support set-at-a-time insert, update, and delete operators. This means that data can be retrieved from a relational database in sets constructed of data from multiple rows and/or multiple tables. This rule states that insert, update, and delete operations should be supported for any retrievable set rather than just for a single row in a single table.
• Rule 8: Physical data independence: Changes to the physical level (how the data is stored, whether in arrays or linked lists etc.) must not require a change to an application based on the structure.
• Rule 9: Logical data independence: Changes to the logical level (tables, columns, rows, and so on) must not require a change to an application based on the structure. Logical data independence is more difficult to achieve than physical data independence.
• Rule 10: Integrity independence: Integrity constraints must be specified separately from application programs and stored in the catalog. It must be possible to change such constraints as and when appropriate without unnecessarily affecting existing applications.
• Rule 11: Distribution independence: The distribution of portions of the database to various locations should be invisible to users of the database. Existing applications should continue to operate successfully : • when a distributed version of the DBMS is first introduced; and • when existing distributed data are redistributed around the system.
• Rule 12: The nonsubversion rule: If the system provides a low-level (record-at-a-time) interface, then that interface cannot be used to subvert the system, for example, bypassing a relational security or integrity constraint.
• If the system provides low-level (physical or procedural) access to the database, that access must not bypass the integrity constraints or security mechanisms that are enforced at the relational level. • .
• Why is it important? • High-level language: Relational databases are typically accessed and manipulated using a high-level relational language (like SQL), which ensures that all operations follow the rules of the relational model, including integrity constraints like foreign keys, uniqueness, and security constraints
• Low-level access: In some systems, administrators or programs might have low-level access to the data (e.g., direct file or memory access). The nonsubversion rule ensures that even when this low-level access is used, it must still respect the same rules and constraints that would apply at the higher level.
Data dictionary • A data dictionary in a Database Management System (DBMS) is a centralized repository that stores metadata, or information about the structure, organization, and characteristics of the data within the database..
• It acts as a reference for database administrators (DBAs), developers, and users to understand and manage the database effectively. The data dictionary holds critical details that describe how data is stored, what types of data exist, and how they interrelate within the system
Key Components of a Data Dictionary: • Metadata: It stores information about the data itself (data about data), including: • Tables: Names, structures (columns, types), and relationships between tables. • Columns/Fields: Data types (e.g., integer, varchar), constraints, default values, and size. • Indexes: Information on how the data is indexed for faster retrieval. • Constraints: Primary keys, foreign keys, and other rules (e.g., unique constraints).
• Views: Definitions of views, or virtual tables created by queries. • Relationships: Foreign key relationships and dependencies between tables. • Triggers: Rules or operations automatically performed in response to specific events on a table. • Stored Procedures: Details on procedures or functions stored in the database.
• User Information: It stores details on database users and their privileges, helping to manage who has access to specific parts of the database. • Integrity Constraints: The data dictionary helps enforce rules such as unique constraints, data validation rules, referential integrity, and more. • Access Paths and Performance Information: It may store information about the database's indexing schemes, query performance statistics, and more to help optimize performance.
Types of Data Dictionary: • Active Data Dictionary: Automatically updated by the DBMS itself whenever any change is made in the database schema. • Provides real-time information about the structure and constraints of the database.
• Passive Data Dictionary: Needs to be manually updated by database administrators whenever the database structure changes. • It might lag behind the actual database state if not kept up to date.
Example Consider a table employees in a relational database. The data dictionary would contain: •Table name: employees •Columns: emp_id (INT, PRIMARY KEY), name (VARCHAR), salary (DECIMAL), etc. •Constraints: PRIMARY KEY on emp_id, NOT NULL constraint on name •Indexes: Index on emp_id •Relationships: FOREIGN KEY relationship to another table like departments

coddsrules in dbms using different -.ppt

  • 1.
    Codd's rules Codd's 12rules are a set of thirteen rules (numbered zero to twelve) proposed by Edgar F. Codd, a pioneer of the relational model for databases, designed to define what is required from a database management system in order for it to be considered relational, i.e., a relational database management system RDBMS
  • 2.
    • Rule 0:The system must qualify as relational, as a database, and as a management system. For a system to qualify as a relational database management system ( RDBMS), that system must use its relational facilities (exclusively) to manage the database.
  • 3.
    • Rule 1:The information rule: All information in the database is to be represented in one and only one way, namely by values in column positions within rows of tables.
  • 4.
    • Rule 2:The guaranteed access rule: All data must be accessible. This rule is essentially a restatement of the fundamental requirement for primary keys. It says that every individual scalar value in the database must be logically addressable by specifying the name of the containing table, the name of the containing column and the primary key value of the containing row.
  • 5.
    • Rule 3:Systematic treatment of null values: The DBMS must allow each field to remain null (or empty). Specifically, it must support a representation of "missing information and inapplicable information" that is systematic, distinct from all regular values (for example, "distinct from zero or any other number", in the case of numeric values), and independent of data type. It is also implied that such representations must be manipulated by the DBMS in a systematic way.
  • 6.
    • Rule 4:Active online catalog based on the relational model: The system must support an online, inline, relational catalog that is accessible to authorized users by means of their regular query language. That is, users must be able to access the database's structure (catalog) using the same query language that they use to access the database's data.
  • 7.
    • Rule 5:The comprehensive data sublanguage rule: The system must support at least one relational language that • Has a linear syntax • Can be used both interactively and within application programs, • Supports data definition operations (including view definitions), data manipulation operations (update as well as retrieval), security and integrity constraints, and transaction management operations (begin, commit, and rollback).
  • 8.
    • Rule 6:The view updating rule: All views that are theoretically updatable must be updatable by the system.
  • 9.
    • A viewin a database is essentially a virtual table that is derived from a query on one or more base tables or other views. It does not store data itself; instead, it provides a way to access and manipulate data from the underlying tables through a predefined query.
  • 10.
    • Rule 7:High-level insert, update, and delete: The system must support set-at-a-time insert, update, and delete operators. This means that data can be retrieved from a relational database in sets constructed of data from multiple rows and/or multiple tables. This rule states that insert, update, and delete operations should be supported for any retrievable set rather than just for a single row in a single table.
  • 11.
    • Rule 8:Physical data independence: Changes to the physical level (how the data is stored, whether in arrays or linked lists etc.) must not require a change to an application based on the structure.
  • 12.
    • Rule 9:Logical data independence: Changes to the logical level (tables, columns, rows, and so on) must not require a change to an application based on the structure. Logical data independence is more difficult to achieve than physical data independence.
  • 13.
    • Rule 10:Integrity independence: Integrity constraints must be specified separately from application programs and stored in the catalog. It must be possible to change such constraints as and when appropriate without unnecessarily affecting existing applications.
  • 14.
    • Rule 11:Distribution independence: The distribution of portions of the database to various locations should be invisible to users of the database. Existing applications should continue to operate successfully : • when a distributed version of the DBMS is first introduced; and • when existing distributed data are redistributed around the system.
  • 15.
    • Rule 12:The nonsubversion rule: If the system provides a low-level (record-at-a-time) interface, then that interface cannot be used to subvert the system, for example, bypassing a relational security or integrity constraint.
  • 16.
    • If thesystem provides low-level (physical or procedural) access to the database, that access must not bypass the integrity constraints or security mechanisms that are enforced at the relational level. • .
  • 17.
    • Why isit important? • High-level language: Relational databases are typically accessed and manipulated using a high-level relational language (like SQL), which ensures that all operations follow the rules of the relational model, including integrity constraints like foreign keys, uniqueness, and security constraints
  • 18.
    • Low-level access:In some systems, administrators or programs might have low-level access to the data (e.g., direct file or memory access). The nonsubversion rule ensures that even when this low-level access is used, it must still respect the same rules and constraints that would apply at the higher level.
  • 19.
    Data dictionary • Adata dictionary in a Database Management System (DBMS) is a centralized repository that stores metadata, or information about the structure, organization, and characteristics of the data within the database..
  • 20.
    • It actsas a reference for database administrators (DBAs), developers, and users to understand and manage the database effectively. The data dictionary holds critical details that describe how data is stored, what types of data exist, and how they interrelate within the system
  • 21.
    Key Components ofa Data Dictionary: • Metadata: It stores information about the data itself (data about data), including: • Tables: Names, structures (columns, types), and relationships between tables. • Columns/Fields: Data types (e.g., integer, varchar), constraints, default values, and size. • Indexes: Information on how the data is indexed for faster retrieval. • Constraints: Primary keys, foreign keys, and other rules (e.g., unique constraints).
  • 22.
    • Views: Definitionsof views, or virtual tables created by queries. • Relationships: Foreign key relationships and dependencies between tables. • Triggers: Rules or operations automatically performed in response to specific events on a table. • Stored Procedures: Details on procedures or functions stored in the database.
  • 23.
    • User Information:It stores details on database users and their privileges, helping to manage who has access to specific parts of the database. • Integrity Constraints: The data dictionary helps enforce rules such as unique constraints, data validation rules, referential integrity, and more. • Access Paths and Performance Information: It may store information about the database's indexing schemes, query performance statistics, and more to help optimize performance.
  • 24.
    Types of DataDictionary: • Active Data Dictionary: Automatically updated by the DBMS itself whenever any change is made in the database schema. • Provides real-time information about the structure and constraints of the database.
  • 25.
    • Passive DataDictionary: Needs to be manually updated by database administrators whenever the database structure changes. • It might lag behind the actual database state if not kept up to date.
  • 26.
    Example Consider a tableemployees in a relational database. The data dictionary would contain: •Table name: employees •Columns: emp_id (INT, PRIMARY KEY), name (VARCHAR), salary (DECIMAL), etc. •Constraints: PRIMARY KEY on emp_id, NOT NULL constraint on name •Indexes: Index on emp_id •Relationships: FOREIGN KEY relationship to another table like departments