mysql -uroot -proot --default-character-set=gbk
drop database if exists pro_db;
create database pro_db charset utf8 ;
use pro_db ;
drop table if exists projects ;
create table projects (
id int primary key auto_increment ,
name varchar(30) unique not null
);
drop table if exists emp ;
create table emp (
id int primary key auto_increment ,
name varchar(20) not null ,
age int ,
marry char(2) ,
post varchar(20) default '中级程序员',
exp varchar(10)
) ;
drop table if exists project_mapping ;
create table project_mapping (
project_id int ,
emp_id int unique ,
foreign key(project_id) references projects(id),
foreign key(emp_id) references emp(id)
) ;
show tables ;
1. 中山大道brt交通信号系统,小组成员有:
张三,未婚,初级程序员,1年开发经验,25岁
李四,高级程序员,5年开发经验,30岁
2. 科贸园车位管理系统,小组成员:
李四,初级程序员,1年开发经验,25岁
王五,高级程序员,3年开发经验,28岁
insert into projects values(
null ,
'中山大道brt交通信号系统'
),(
null ,
'科贸园车位管理系统'
) ;
insert into emp values (
null,
'张三',
25,
'未婚',
'初级程序员',
'1年开发经验'
)
来源:CSDN
作者:LawssssCat
链接:https://blog.csdn.net/LawssssCat/article/details/103642202