Database Reference
In-Depth Information
Data modification : A data modification language (DML) can be used to query and
update the database as well as set up indexes and establish constraints such as ref-
erential integrity. A DML consists of the statements that play key roles in inserting,
updating and deleting the data from database tables. INSERT , UPDATE , and DELETE
are prime examples of a DDL.
Database monitoring : As the database begins operation, monitoring indicates
whether performance requirements are being met; if they are not, modifications
should be made to improve database performance. Thus, the database life cycle
continues with monitoring, redesign, and modification.
Mapping Cardinalities
Tables are the fundamental components of a relational database. In fact, both data and relationships are
stored simply as data in tables. Tables are composed of rows and columns. Each column represents a
piece of information.
Mapping cardinalities, or cardinality ratios, express the number of entities to which another entity
can be associated via a relationship set. Cardinality refers to the uniqueness of data values contained in
a particular column of a database table. The term relational database refers to the fact that different
tables quite often contain related data. For example, one sales rep in a company may take many orders,
which were placed by many customers. The products ordered may come from different suppliers, and
chances are that each supplier can supply more than one product. All of these relationships exist in
almost every database and can be classified as follows:
One-to-one (1:1) : For each row in Table A, there is at most only one related row
in Table B, and vice versa. This relationship is typically used to separate data by
frequency of use to optimally organize data physically. For example, one
department can have only one department head.
One-to-many (1:M) : For each row in Table A, there can be zero or more related
rows in Table B; but for each row in Table B, there is at most one row in Table A.
This is the most common relationship. Figure 2-1 shows an example of a one-
to-many relationship of tables in Northwind. Note the Customers table has a
CustomerID field as the primary key (indicated by the key symbol on the left),
which has a relation with the CustomerID field of the Orders table; CustomerID
is considered a foreign key in the Orders table. The link shown between the
Customers and Orders tables indicates a one-to-many relationship, because
many orders can belong to one customer. Here, Customers is referred to as the
parent table, and Orders is the child table in the relationship.
 
Search WWH ::




Custom Search