摘要:
多表查询的两种方法 方法1:连表操作 inner join 内连接 select * from emp inner join dep on emp.dep_id=dep.id; 只连接两张表中公有的数据部分 left join 左连接 select * from emp left join dep 阅读全文
摘要:
数据准备 # 数据准备 create table emp( id int primary key auto_increment, name varchar(20) not null, sex enum('male','female') not null default 'male', #大部分是男的 阅读全文
摘要:
约束条件 1.无符号,零填充(unsigned,zerofill) unsigned id int unsigned #只能存正数 zerofill id int(5) zerofill #如果输入的不满5位的话就用0填充 2.非空(not null) create table t1( id int 阅读全文