数据库
首页 > 数据库> > 数据库系统 Database System

数据库系统 Database System

作者:互联网

Overview

In this course we mainly learned about:

一、Relational Database

1. Relational Model

Relational Database supports relational model.

Simply put, a relation is a table.

091318_0803_RelationalD1

Row is Tuple. And a column of data is domain.

Normally a relation has a primary key, which can determine a single tuple.

2. Relational Integrity

In relational model, there is a thing called relational integrity, which means the relation has some constraints.

There are there types of integrities:

1) Entity Integrity

The value of the primary key cannot be null.

For example, in relation Student:

Student(ID, name, major_id)

ID is the primary key, it can't be null.

2) Referential Integrity

It means:

For example:

Student(ID, name, major_id)
Major(major_id, major_name)

major_id in Student should be null or exist in Major.

3) User-Defined Integrity

It means, user can define the requirements that the data needs to meet.

Like grade: 0~100.

二、Database Normalization

Database Normalization is used to reduce data redundancy.

In relational model, relation has to meet certain requirements. We call it normal form.

Each normal form has its own requirements.

Normal-Forms-in-DBMS-Point-01

1. 1NF

When no table column has table as values, then the relation is in 1NF.

1NF is the minimum requirement.

2. 2NF

If \(R\in 1NF\),and each non-primary attribute fully functionally depends on any candidate code, then \(R\in2NF\).

3. 3NF

if \(R\in 2NF\),and each non-key attribute of R is a non-transitive dependency of each candidate key of R.

Modern database design meets 3NF at most.

三、Database Conceptual Design

Conceptual design is the key to the entire database design.

Its main task is to establish an independent conceptual model, which reflects the relationships between things in the real world.

Of that we learned about E-R model. E stands for entity, R stands for relation.

We draw E-R diagram to represent the model.

E-R-Diagram

In E-R diagram, rectangle represents entity, ellipse represents attributes of entity, rhombus represents relation.

四、课程设计

The task assigned to me is to make a campus plant management system

For this I need to design a database and at the same time make a user interface.

But I spend too much time on the UI, so the design of the database is a little simple.

标签:Database,database,System,relation,key,Relational,数据库系统,Integrity
来源: https://www.cnblogs.com/danielwong2021/p/15271281.html