1、 译文题目: 关系数据库的结构 2011 年 12 月 05 日 原文 : Structure of the Relational database Database System Concepts Part1: Relational Databases The relational model is the basis for any relational database management system (RDBMS).A relational model has three core components: a collection of objects or relations,
2、operators that act on the objects or relations, and data integrity methods. In other words, it has a place to store the data, a way to create and retrieve the data, and a way to make sure that the data is logically consistent. A relational database uses relations, or two-dimensional tables, to store
3、 the information needed to support a business. Lets go over the basic components of a traditional relational database system and look at how a relational database is designed. Once you have a solid understanding of what rows, columns, tables, and relationships are, youll be well on your way to lever
4、aging the power of a relational database. Tables, Row, and Columns A table in a relational database, alternatively known as a relation, is a two-dimensional structure used to hold related information. A database consists of one or more related tables. Note: Dont confuse a relation with relationships
5、. A relation is essentially a table, and a relationship is a way to correlate, join, or associate two tables. A row in a table is a collection or instance of one thing, such as one employee or one line item on an invoice. A column contains all the information of a single type, and the piece of data
6、at the intersection of a row and a column, a field, is the smallest piece of information that can be retrieved with the databases query language. For example, a table with information about employees might have a column called LAST_NAME that contains all of the employees last names. Data is retrieve
7、d from a table by filtering on both the row and the column. Primary Keys, Datatypes, and Foreign Keys The examples throughout this article will focus on the hypothetical work of Scott Smith, database developer and entrepreneur. He just started a new widget company and wants to implement a few of the
8、 basic business functions using the relational database to manage his Human Resources (HR) department. Relation: A two-dimensional structure used to hold related information, also known as a table. Note: Most of Scotts employees were hired away from one of his previous employers, some of whom have o
9、ver 20 years of experience in the field. As a hiring incentive, Scott has agreed to keep the new employees original hire date in the new database. Row:A group of one or more data elements in a database table that describes a person, place, or thing. Column:The component of a database table that cont
10、ains all of the data of the same name and type across all rows. Youll learn about database design in the following sections, but lets assume for the moment that the majority of the database design is completed and some tables need to be implemented. Scott creates the EMP table to hold the basic empl
11、oyee information, and it looks something like this: Notice that some fields in the Commission (COMM) and Manager (MGR) columns do not contain a value; they are blank. A relational database can enforce the rule that fields in a column may or may not be empty. In this case, it makes sense for an employee who is not in the Sales department to have a blank Commission field. It also makes sense for the president of the company to have a blank Manager field, since that employee doesnt report to anyone.