Files
fortern-sql-data/MySQL/person/person.sql
2025-08-29 12:36:30 +08:00

24 lines
1.2 KiB
SQL

-- 描述一个人的身份证号和其他个人信息
create table person
(
id int not null auto_increment,
address1 tinyint not null comment 'address1',
address2 tinyint not null comment 'address2',
address3 tinyint not null comment 'address3',
birthday date not null comment 'birthday',
sequence_number tinyint not null comment 'sequence number',
gender_code tinyint not null comment 'gender code',
check_code tinyint not null comment 'check code',
gender bit not null comment 'gender',
name varchar(20) not null comment 'name',
name_initials varchar(50) not null comment 'name initials',
address varchar(150) not null comment 'full address text',
phone_number varchar(50) null comment 'phone number',
update_time timestamp not null,
primary key (id),
unique index person_id_code_index (address1, address2, address3, birthday, sequence_number, gender_code),
index person_birthday_index (birthday),
index person_gender_index (gender),
index person_name_initials_index (name_initials)
) engine = InnoDB;