Design patterns (first paradigm, the second paradigm, the third paradigm)
so-called first paradigm (1NF) means for each column of a database table are indivisible basic data items, the same column can not have multiple values, i.e. entities a property value can not have or can not have multiple duplicate attribute.
create table student(
id int(4) primary key auto_increment,
name varchar(10) not null,
sn varchar(10) not null,
class varchar(10)
);
insert into student values (1, "Ruo" "1906030001", "Information Institute -1 class");
The second paradigm (2NF) is established on the basis of a first paradigm (1NF) on. The second paradigm (2NF) requires each instance or a database table row must be uniquely distinguished. (Redundant data in the table)
Third normal form (3NF) must satisfy the second paradigm (2NF). Briefly, a third paradigm (3NF) requires a database table comprising a non-primary key information is not already contained in other tables. (Redundancy, redundant field between the tables) of
create table student(
id int(4) primary key auto_increment,
name varchar(10) not null,
sn varchar(10) not null,
class varchar(10)
);
create table score(
id int(4) primary key auto_increment,
subject varchar(10) not null,
grade varchar(10) not null
);