relational database Theory ~ ~

Source: Internet
Author: User

Ddl:data definition Language, database schema definitions language;

Dml:data manipulation Language, the Data Manipulation Language command enables the user to query the database and manipulate the data in the existing database;

Relationship Paradigm Learning:

To understand the paradigm, you must first understand the dependencies

1. Data dependencies
Data dependency refers to the relationship between the data that is represented by the equality between attributes in a relationship, the most important of which is function dependency and multivalued dependency.

2. Function dependencies
Set X, Y is a collection of two properties of the relationship R, and when the X attribute values of any two tuples in R are the same at any time, their Y property values are the same, and then they are said to be y, or the Y function depends on X.
3. Trivial function dependencies
When the attribute set Y in the relationship is a subset of the attribute set X (y? X), there is a function dependency x→y, a set of attribute functions that determine all of its subsets, a function dependency called trivial function dependency.
4. Non-trivial function dependencies
When the attribute set Y in a relationship is not a subset of the attribute set X, there is a function dependency x→y, which is called a non-trivial function dependency.
5. Full function dependencies
Set X, Y is a set of two attributes of the relationship R, and the X→Y is the true subset of X, but there is X '!→y for each x ', then the Y full function is dependent on X.
6. Partial function dependencies
Set X, Y is a set of two attributes of the relationship R, there is x→y, if X ' is a true subset of x, there is X ' →y, then the Y function is called X.
7. Transfer function dependencies
X, Y, Z is a different set of attributes in the relationship R, there is x→y (Y!→x), y→z, then the function is said to be dependent on X.

Examples: full dependency and partial dependency, other similar

Relationship SB (school number, name, department name, department head, class number, score), non-main attribute "name" only the function depends on the "number", that is, the "name" part of the function depends on the main code (school number, class number) instead of full dependence; the non-primary attribute "system name" only depends on "school number" Part of the function depends on the main code (school number, class number) instead of full dependence; the non-main attribute "Dean" only functions dependent on "study number", that is, "department director" part of the function depends on the main code (school number, class number) rather than full reliance. The first paradigm (1nf--normal form)--set R is a relational pattern, and if each value in the domain of each attribute a in R is non-biodegradable, then R is the first normal, as R∈1NF; the second paradigm (2NF)---defined if the relationship r∈1nf, and Each non-primary property in R has a full function that relies on either candidate code, then r∈2nf; the third normal form (3NF)---defines if the relationship r∈2nf and every non-primary attribute in R does not have a transfer function dependency on any candidate code, then r∈3nf. Third Paradigm Inverse Example: SD (school number, name, department name, Dean), the existence of the following function dependencies: study number → department name → Department director Department name-\→ No. So, there is a transfer function depends on the "school number → Department director" was established. So this relationship is not a 3NF. The SD is decomposed into SE (school number, name, name) SF (department name, dean) at this time to meet 3NF.

relational database Theory ~ ~

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.