Appendix A: Relational Databases: Some Basic Concepts


This appendix discusses some key concepts of relational databases, including normalization, sets, cursors, and locking.

A relational database is a collection of tables, and a table is a set of columns and rows. A table's columns can be referred to as columns, fields, or attributes, and each column in a table requires a unique name and a data type. The datum in a given row is generally referred to as a record. (The term recordset refers to a set of records, reminding you that relational databases use set-based operations rather than row-at-a-time, pointer-based operations.)

In relational databases, each table needs to have a key, which is associated with a column. There are two important types of keys: primary keys and foreign keys. A primary key is a column of a table with a unique value for each row, which helps ensure data integrity by (theoretically) eliminating duplicate records. A foreign key takes care of the relational in relational databases and provides a link between related data that are contained in more than one table. For example, in a classic parent-child relationship such as customers and orders, if CustomerId is the primary key in the Customers table, it'll need to occur in the Orders table as a foreign key to associate each order with an individual customer. The customer/order relationship is a one-to-many relationship because each one customer can have many orders. That relationship is sometimes depicted as 1:n.


A primary key can also be a combination of several columns of a table, where one of those columns is a foreign key. For example, in an example database table, one table can have a primary key that's a combination of the Path and File columns to avoid duplicate file records. The File column is a foreign key.

A database is a collection of tables, indexes, constraints, and other objects. The definition of these objects is known as the database's schema, which can be represented in a graphical way using various diagrams.

Meta-data refers to the collection of data that describes the content, quality, relations, and other characteristics of data. A database's meta-data includes information that ranges from table definitions to users and their permissions.

Applied ADO. NET(c) Building Data-Driven Solutions
Applied ADO.NET: Building Data-Driven Solutions
ISBN: 1590590732
EAN: 2147483647
Year: 2006
Pages: 214 © 2008-2017.
If you may any questions please contact us: