MySql 常用Sql語句

passport_daizi發表於2012-06-14
create database kali;


use kali;


show tables;


create table students  (
SNO varchar(10) primary key,
SNAME varchar(10) not null,
SEX varchar(2) check(sex in('男','女')),
AGE varchar(3)
);


insert into students values ('1','xiaoming','男','23');
insert into students values ('2','xiaoli','女','43');
insert into students values ('3','xiaohua','男','34');
insert into students values ('4','xiaoxin','男','6');
insert into students values ('5','xiaoma','女','77');

insert into students values ('6','xiaowang','男','54');


select * from students order by sno limit 4;




相關文章