One of the databases

Source: Internet
Author: User

Talk about the basic concepts of the information world before you talk about specific operations:

1. Entity: An objective and distinguishable thing called entity, such as student Zhang San, worker John Doe, computer Department, Database introduction
2. Attribute (Attribute): An entity has an attribute, an entity can be characterized by a number of attributes, for example, students can be composed of student number, name, age, class, etc.
3. Code: A property that uniquely identifies an entity is called a code (also called a primary key).
4. Domain: The range of values for a property, for example, the Gender field is (male, female), and the Month field is an integer of 1 to 12.
5. Solid type (entity type):

Entity names, together with their collection of attribute names, form an entity type.
Examples, students (school number, name, age, gender, class, place of origin).
Note the difference between the entity type and the entity (value), which is a special case of the former.
such as (9808100, Wang Ping, 21, male, website class, Shandong Dingtao) is an entity.

6. Entity set: A collection of identical entities is called an entity set, such as all students.
7. Contact: (Relationship):

The connection between things within and between things in the real world is reflected in the information world as linkages within entities and between entities, such as the teaching relationship between students and teachers.
Links can also have attributes, such as student-to-curriculum links, and each selection link has a score as its attribute.
Type of contact: one-to-one contact, one-to-many connections, and many-to-many connections.
8. Conceptual Data Model:
In general, more than two entity types also exist between one-to-many, many-to-many links.
A pair of one or one-to-many, many-to-many connections can also exist between entities in the same entity set.

One: relational database theory.

1. Overview of the relational model:

A, the data structure of the relational model.

Basic concepts: Relational patterns, tuples, and relationships.
attribute and range, keyword (key), or master code.
Candidate keyword, primary key, non-primary attribute.
External keywords, primary table, and from table.

• Relationship mode: General representation: The relationship name (attribute 1, attribute 2, ..., attribute N), such as: Student (school number, name, gender, age, Faculty number, department name).

• Tuples and relationships:

• Attributes and ranges.

• Keyword (key) and code.

• Candidate keywords or candidates: If there are multiple attributes (or combinations of attributes) in a relationship that can be used to uniquely identify a tuple of that relationship, these attributes (or combination of attributes) are called candidate keywords or candidate codes for the relationship.

• Primary key or main code (primary key).

• Non-primary or non-code attributes.

• External keywords or foreign keys.

• Main table with from table:

2. Defining relationships in a relational model:

A. Each relationship has only one record type, which is a relational pattern.
B. The number of attributes in each relational pattern is fixed and must be named, and the attributes must be different in the same relationship pattern.
C. Each attribute is non-divided, and duplicate attributes are not allowed.
D. The order of tuples in a relationship is irrelevant.

E. The order of the columns in the relationship is also irrelevant, that is, the order of the columns can be exchanged arbitrarily.
F. Duplicate tuples are not allowed in relationships.

Reproduced

One of the databases

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.