Data dictionary 10-11

22
DATA DICTIONARY COURSE INSTRUCTOR: MUNAWAR AHMAD Database Management Systems

description

 

Transcript of Data dictionary 10-11

Page 1: Data dictionary 10-11

DATA DICTIONARY

COURSE INSTRUCTOR: MUNAWAR AHMAD

Database Management Systems

Page 2: Data dictionary 10-11

Data Dictionary

Data dictionary (also called information repositories) are mini database management systems that manages metadata. It is a repository of information about a database that documents data elements of a database. The data dictionary is an integral part of the database management systems (DBMSs) and stores metadata, or information about the database, attribute names and definitions for each table in the database.

Page 3: Data dictionary 10-11

Data Dictionary

The most general structure of a data dictionary is shown

Page 4: Data dictionary 10-11

Data Dictionary

It contains descriptions of the database structure and database use. The data in the data dictionary are maintained by several programs and produce diverse reports on demand. Most data dictionary systems are stand-alone systems, and their database is maintained independently of the DBMS, thereby enabling inconsistencies between the database and the data dictionary. To prevent them, the data dictionary is integrated with DBMSs in which the schema and user view definitions are controlled through the data dictionary and are made available to the DBMS software.

Page 5: Data dictionary 10-11

Types of Information stored in DD

Data dictionary is usually a part of the system catalog that is generated for each database. A useful data dictionary system usually stores and manages the following types of information:

•Descriptions of the schema of the database.•Detailed information on physical database design, such as storage structures, access paths and file and record sizes.

Page 6: Data dictionary 10-11

Cont….•Description of the database users, their responsibilities and their access rights.•High-level descriptions of the database transactions and applications and of the relationships of users to transactions.•The relationship between database transactions and the data items referenced by them. This is useful in determining which transactions are affected when certain data definitions are changed.•Usage statistics such as frequencies of queries and transactions and access counts to different portions of the database.

Page 7: Data dictionary 10-11

Components of Data Dictionaries

Some of the typical components of a data dictionary entry are:• Name of the table/entity• Name of the fields in each table/entity• Data type of the field (integer, date, text…)• Brief description of the expected data for each field• Length of the field• Default value for that field• Is the field Nullable or Not Nullable?

Page 8: Data dictionary 10-11

Dictionary's function in database design

A good data dictionary provides a precise description of the characteristics of all the entities and attributes found within the database.

DATABASE INITIAL STUDYThe basic data dictionary components are developed as the entities and attributes are defined during this phase.

Page 9: Data dictionary 10-11

DATABASE DESIGNThe data dictionary contents are used to verify the database design components: entities, attributes, and their relationships. The designer also uses the data dictionary to check the database design for homonyms and synonyms and verifies that the entities and attributes will support all required query and report requirements.IMPLEMENTATION AND LOADINGThe DBMS's data dictionary helps to resolve any remaining attribute definition inconsistencies.

Page 10: Data dictionary 10-11

TESTING AND EVALUATIONIf problems develop during this phase, the data dictionary contents may be used to help restructure the basic design components to make sure that they support all required operations.OPERATIONIf the database design still yields (the almost inevitable) operational glitches, the data dictionary may be used as a quality control device to ensure that operational modifications to the database do not conflict with existing components.

Page 11: Data dictionary 10-11

MAINTENANCE AND EVOLUTIONAs users face inevitable changes in information needs, the database may be modified to support those needs. Perhaps entities, attributes, and relationships must be added, or relationships must be changed. If new database components are fit into the design, their introduction may produce conflict with existing components. The data dictionary turns out to be a very useful tool to check whether a suggested change invites conflicts within the database design and, if so, how such conflicts may be resolved.

Page 12: Data dictionary 10-11

Active and Passive Data Dictionaries

Data dictionary may be either active or passive. An active data dictionary (also called integrated data dictionary) is managed automatically by the database management software. Since active data dictionaries are maintained by the system itself, they are always consistent with the current structure and definition of the database. Most of the relational database management systems contain active data dictionaries that can be derived from their system catalog.

Page 13: Data dictionary 10-11

Active and Passive Data Dictionaries

The passive data dictionary (also called non-integrated data dictionary) is the one used only for documentation purposes. Data about fields, files, people and so on, in the data processing environment are entered into the dictionary and cross-referenced. Passive dictionary is simply a self-contained application and a set of files is used for documenting the data processing environment. It is managed by the users of the system and is modified whenever the structure of the database is changed.

Page 14: Data dictionary 10-11

Keys

Super Key A combination of one or more columns in a table which can be used to identify a record in a table uniquely, a table can have any number of super keys.

Page 15: Data dictionary 10-11

Keys

Candidate Key A Column (or) Combination of columns which can help uniquely identify a record in a table without the need of any external data is called a Candidate Key. Depending on the need and situation a Table may have one or more candidate keys and one of them can be used as a Primary Key of the table.A candidate key is a sub set of a Super Keys.For Example, In an Employee Table, we may have columns like Employee ID, Employee Name, and Employee SSN. We can consider either Employee ID or Employee SSN as Candidate Key’s

Page 16: Data dictionary 10-11

Keys

Compound KeyA Combination of more than one column identifying records of a table uniquely, all the columns that take part in the combination process are Simple Key’s.We can represent this buy taking a table which has the combined information of Department to Employees, Employee ID + Department ID – here both of them define a record in this table, but both can make sense separately as well.

Page 17: Data dictionary 10-11

Keys

Primary KeyA Column in a table (which is a Simple Key) which is a Candidate Key (Uniquely identify a records in a table) and has the Constraint NOT NULL attached to it is known as a Primary Key.

Page 18: Data dictionary 10-11

Keys

Composite Primary Key (Composite Key)When we have a Primary Key of a table defined using more than one columns then it is known as a Composite Key, each columns data can be duplicated, but combined values cannot be. The columns which are participating in a composite primary key are not simple keys.For Example, we can have a situation where there is a need to define the key using first Name + last Name.

Page 19: Data dictionary 10-11

Keys

Alternate KeyWe cannot define the Alternate Key Separately from a Candidate Key, for a table, if there are two Candidate Key’s and one is chosen as a Primary Key the other Candidate Key is known as the Alternate Key of that table.In Example, we can consider the Employee SSN as Alternate Key as we have taken Employee ID as our Primary Key

Page 20: Data dictionary 10-11

Keys

Unique KeyA column (or) combination of columns which can be used to uniquely identify a record in a table, it can have one NULL Value.Primary Key can be considered a special case of unique key with a Not Null Constraint.

Page 21: Data dictionary 10-11

Keys

Foreign KeyA column of one table points to the Primary Key column of another table to implement referential data integrity.For Example, we can have a department id column in the employee table which is pointing to department id column in a department table where it a primary key.

Page 22: Data dictionary 10-11

Thanks