首页 > 代码库 > sql常用语句
sql常用语句
select * from personselect distinct name from personselect * from person where name=‘huangcongcong‘select * from person where year>1991select * from person order by idselect * from person limit 5select * from person name like "%cong%"select * from person name like "[!hc]%"select * from person where name in(‘huangcongcong‘,‘huangbingbing‘)select * from person where name between ‘huangbingbing‘ and ‘huangcongcong‘select name as xingming from personselect * from person where name is nullselect * into person_back from personinsert into person (name,year) values(‘huangbingbing‘,1992)update person set year=1990 where name=‘huangbingbing‘delete from person where name=‘huangcongcong‘delete * from persondelete from personcreate database my_dbcreate table person( id int not null primary key check(id>0) auto_increment, name varchar(50) not null, address varchar(50) default ‘shanghai‘, city varchar(50), foreign key (id) references order(id))alter table personadd unique (id)alter table persondrop index idalter table personadd primary key(id)alter table persondrop primary keyalter table personadd foreign key (id) references order(id)alter table persondrop foreign keyalter table personadd check(id>0)alter table persondrop constraint checkalter table personadd constraint chk_person check(id>0)alter table persondrop constraint chk_personalter table personalter city set default ‘shenzhen‘alter table personalter city drop defaultcreate index personIndexon person namealter table persondrop index personIndexalter table personauto_increment=100create view personViewselect * from person
sql常用语句
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。