mysql建表-主键-索引-外键
2012-03-17 11:39
106 查看
create table employees (
id int(5) not null auto_increment ,
name varchar(8) not null,
primary key (id)
)
type=innodb;
create table payroll(
id int(5) not null,
emp_id int(5) not null,
name varchar(8) not null,
payroll float(4,2) not null,
primary key(id),
index emp_id (emp_id),
foreign key (emp_id) references employees (id)
)
type = innodb;
相关文章推荐
- MySQL的几个概念:主键,外键,索引,唯一索引
- MySQL的几个概念:主键,外键,索引,唯一索引
- 【MySQL】数据类型&时间戳&主键&外键&索引
- mysql主键,外键,索引
- mysql建表-主键-索引-外键
- mysql 主键,外键,唯一键,索引的区别
- MySQL的几个概念:主键,外键,索引,唯一索引
- mysql主键,外键,索引
- mysql主键 外键 索引
- mysql 入门基础(2)—外键、主键和索引
- MySQL的几个概念:主键,外键,索引,唯一索引
- MySQL主键、外键、索引
- mysql表的主键、外键、限定、约定、索引、视同、存储过程
- MySQL的几个概念:主键,外键,索引,唯一索引
- MySQL主键,外键,索引,唯一索引
- mysql的主键外键索引的区别
- MySQL的几个概念:主键,外键,索引,唯一索引
- MySQL的几个概念:主键,外键,索引,唯一索引
- mysql建表-主键-索引-外键
- MySQL的几个概念:主键,外键,索引,唯一索引