Database Review ⑤

Source: Internet
Author: User

Database Review ⑤

June 15, 2016

22:01

Main Relation Table & Relational Algebra Relational Tables

1. Cartesian product

2. features of the relational table

The tuple in the relational table is a subset of the Cartesian product;

Tuples do not allow a single row of identical values;

The order in which the tuples are stored is irrelevant;

Each property value under the same property name should be from the same domain and be the same numeric type;

Each attribute name is not the same;

Different attributes can have the same domain value;

Attributes are atomic and non-detachable, which means that small tables cannot be nested in large tables

3. Convert the ER diagram to a relational table

Each entity in the ER diagram is converted into a table;

The attribute columns for each table are made up of the properties of two related entities, including all properties of an entity and the primary key of another entity.

The following examples illustrate:

4. Integrity Constraints

Domain value constraints (domains Integrity Constraints) Each attribute has its type and range of values, such as the student's age between 0~150岁.

Entity integrity constraints (entities Integrity Constraints) primary key is non-empty, a table has at most one primary key, a table can exist without a primary key, and a primary key is used to specify a unique attribute column for that table.

Referential integrity constraints (referential Integrity constraints) are used to maintain referential integrity in a relational database, and any field in a table that declares a key can contain only the values of the parent table's primary key or candidate key

Custom integrity constraints;

5. null value null values

Null values can exist with relational tables, and null values are given to those indeterminate attributes or to indeterminate values for existence.

6. Relational algebra

Five basic relational operations: projection projection, selection of selection, Cartesian product Cartesian product, union, and difference difference.

7. and OP Union

8. differential Operation difference

9. Select operation Selection

projection operation Projection

Cartesian product operations Certesian product

intersection operation intersection

Natural Connection Operations

Connection Operation

Division operations

Database Review ⑤

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.