Professional Documents
Culture Documents
Components of database
A database system is composed of four components;
• Data
• Relationships
• Constraints
• Schema
1) Data:
Data becomes information when it is processed, turning it into something meaningful.
User Data - It consists of a table(s) of data called Relation(s) where Column(s) are called
fields of attributes and rows are called Records for tables. A Relation must be structured
properly.
Metadata - A description of the structure of the database is known as Metadata. It
basically means "data about data". System Tables store the Metadata which includes.
- Number of Tables and Table Names
- Number of fields and field Names
- Primary Key Fields
Application Metadata - It stores the structure and format of Queries, reports and other
applications components. '
2) Relationship:
Correspondence between the various data elements
3) Constraints:
Are predicates that define correct database items
4) Schema:
The organization of data and relationship within the database
The overall description of the database is called the database schema. It can be
categorized into three parts.
1. Internal Level
2. Conceptual or Logical Level
3. External or View level
Internal Level/Schema
The internal schema defines the physical storage structure of the database.
The internal schema is a very low-level representation of the entire database.
It contains multiple occurrences of multiple types of internal record.
In the ANSI term, it is also called "stored record'.
Conceptual Schema/Level
The conceptual schema describes the Database structure of the whole database
for the community of users.
This schema hides information about the physical storage structures and focuses
on describing data types, entities, relationships, etc.
This logical level comes between the user level and physical storage view.
However, there is only single conceptual view of a single database.
External Schema/Level
An external schema describes the part of the database which specific user is
interested in. It hides the unrelated details of the database from the user. There
may be "n" number of external views for each database.
Each external view is defined using an external schema, which consists of
definitions of various types of external record of that specific view.
An external view is just the content of the database as it is seen by some specific
particular user. For example, a user from the sales department will see only sales
related data.
Database
A Database is a collection of related data organized in a way that data can be easily
accessed, managed and updated. Database can be software based or hardware based, with one
sole purpose, storing data.
Why a database:
It overcomes the deficiencies of pre-database information processing,
They are ,
There are the following important functions and services provided by a DBMS:
In this “Element table” there are 3 candidate keys such that ‘symbol’ ‘Name’ ‘and’ ‘Atomic no’.
Every relation has at least one candidate key.
In case of base relation one candidate key is designated as Primary key and remaining
keys are called alternate keys.
Foreign key is an attribute (or) attribute combination of are relation whose values are
required to match those of the primary key of some other relation (table).
Shipment table
Item Quantity Destination
A1 100 Delhi
Fe 500 Delhi
Au 5 Delhi
‘Item’ of the shipment table matches the ‘symbol’ of the ‘Element table’. Therefore ‘item’ is the
‘foreign key’
Constraints for Relational Model
Relational data model includes several types of constraints to maintain accuracy and
integrity of the data in the database.
i) Domain constraints
A domain is a set of values that may be assigned to an attribute. A domain definition
usually consists of following components: 1.Domain name 2.Meaning 3. Data type 4.Size (or)
Length 5.Allowable values (or) Allowable range.
ii) Entity integrity
Entity integrity rule is designed to assure that every relation has primary key and the
value of primary key is valid.
Entity integrity guarantees that every primary key attribute is non-null.
iii) Referential integrity:
It is a rule that maintains consistency among rows of two tables.
The rule states that the foreign key in one relation, either each foreign key value must
match a primary key value in other table (or) foreign key value must be null.
iv) Operational Constraints
These are the constraints enforced in the database by the business rules (or) real world
limitations.
And: “Age should be less than (or) equal to 60”.
CODD’s Rules:
Relational database is the finite collection of relations and relation in terms of domains,
attribute, associations and tuples. Dr. E.F. Codd, places relational model’s characteristics in three
broad categories.
1. Structural features that support the view of the data. They include relations and their
undergoing components, views and queries.
2. Integrity features such as entity and referential integrity and also application specific
constraints.
3. Data manipulation features for data retrieval, insertion, deletion and update.
Codd provides a set of 12 rules which quality a database product as relation.
1. Information rule:
All information in a relational database including table names, column names is
represent by values in tables.
This view of data speeds design and learning process.
Action can be taken when the constraints are violated.
Access of data can be restricted.
2. Guaranteed Access rule:
Every piece of data in a relational database, can be accessed by using a combination of a
table, a primary key valve that identifies the row and a column name, which identifies a
cell.
User productivity is improved since there is no need to resort to using physical pointers
(or) address.
It is possible to retrieve each individual piece of data stored in database by specifying the
name of the table in which it is stored the column and primary key which identifies the
cell in which it is stored.
3. Systematic Treatment of Nulls Rule:
The RDBMS handles records that have unknown (or) inapplicable valves in predefined
fashion.
Through the set of rules for handling nulls, user can distinguish results of the queries that
involve nulls, zeros and blanks
4. Active on-line catalog Based on the relational model
The description of the database of its contents are database tables, it can queried on-line
via the data manipulation language.
5. Comprehensive Data sub-language rule
RBDMS have several languages. It allows the user to do the following,
o Define tables and views
o Query and update
o Set integrity constraints
o Set authorizations.
o Define transactions.
6. View updating rule
Any view that can be updated theoretically can be updated using the RDBMS.
Data consistency is ensured since the changes made in the view are transmitted to the
base table and vice-versa.
7. High-level insert, update and delete
The RDBMS supports insertion, updating and deletion at a table level.
The performance is improved since the commands act on a set of records rather than on
one record at a time.
8. Physical Data independence
The execution of ad hoc requests and application programs is not affected by changes in
the physical data access and storage methods.
Data base administers can make changes to physical access and storage methods which
improve the performance.
9. Logical data independence
Logical data changes in tables and views such as adding / deleting columns or changing
field need not necessitate modification in the program or format of adhoc requests.
10. Integrity independence
Like table and view, integrity constraints are stored in online catalog and can therefore
changed without changes in the application programs.
11. Distribution independence
Application programs and adhoc request are not affected by changes in the distribution of
physical data.
This improves reliability.
12. Non-subversion rule
If the RDBMS has a language that accesses the information of a record at-time, this
language should not be used to bypass the integrity constraints. This is necessary for data
integrity.