Teradata 简明教程
Teradata - Relational Concepts
关系数据库管理系统 (RDBMS) 是一种 DBMS 软件,有助于与数据库交互。它们使用结构化查询语言 (SQL) 与存储在表中的数据交互。
Relational Database Management System (RDBMS) is a DBMS software that helps to interact with databases. They use Structured Query Language (SQL) to interact with the data stored in tables.
Database
数据库是逻辑相关数据的集合。许多用户出于不同的目的对其进行访问。例如,销售数据库包含存储在许多表中的整个销售信息。
Database is a collection of logically related data. They are accessed by many users for different purposes. For example, a sales database contains entire information about sales which is stored in many tables.
Tables
表是 RDBMS 中存储数据的基本单位。表是行和列的集合。以下是 employee 表的示例。
Tables is the basic unit in RDBMS where the data is stored. A table is a collection of rows and columns. Following is an example of employee table.
EmployeeNo |
FirstName |
LastName |
BirthDate |
101 |
Mike |
James |
1/5/1980 |
104 |
Alex |
Stuart |
11/6/1984 |
102 |
Robert |
Williams |
3/5/1983 |
105 |
Robert |
James |
12/1/1984 |
103 |
Peter |
Paul |
4/1/1983 |
Columns
一列中包含类似的数据。例如,Employee 表中的列 BirthDate 包含所有员工的 birth_date 信息。
A column contains similar data. For example, the column BirthDate in Employee table contains birth_date information for all employees.
BirthDate |
1/5/1980 |
11/6/1984 |
3/5/1983 |
12/1/1984 |
4/1/1983 |
Row
行是所有列的一个实例。例如,在 employee 表中,一行包含关于单个员工的信息。
Row is one instance of all the columns. For example, in employee table one row contains information about single employee.
EmployeeNo |
FirstName |
LastName |
BirthDate |
101 |
Mike |
James |
1/5/1980 |
Primary Key
主键用于唯一标识表中的行。主键列中不允许重复的值,并且它们不能接受 NULL 值。它是表中的一个必填字段。
Primary key is used to uniquely identify a row in a table. No duplicate values are allowed in a primary key column and they cannot accept NULL values. It is a mandatory field in a table.
Foreign Key
外键用于建立表之间的关系。子表中的外键被定义为主表中的主键。一个表可以有多个外键。它可以接受重复值和空值。外键在表中是可选的。
Foreign keys are used to build a relationship between the tables. A foreign key in a child table is defined as the primary key in the parent table. A table can have more than one foreign key. It can accept duplicate values and also null values. Foreign keys are optional in a table.