--====================簡單的查增刪改===========
--查看學生表的全部數(shù)據(jù)
select * from studio
--插入一個新的學生信息
insert into studio(st_name,st_sex,st_age,st_add,st_tel) values("黃蘭淇",0,36,'南充','13943943334')
--查看class全部數(shù)據(jù)
select * from class
--向class表增加兩條條數(shù)據(jù)
insert into class(cl_class,cl_coding,cl_o_time,cl_remark) values('新電實訓班','GXA-ncs-001','2008-03-11','都是很優(yōu)秀的朋友')
insert into class(cl_class,cl_coding,cl_o_time) values('阿壩師專實訓班','GXA-ABSZ-001','2008-03-11')
--更新一條的數(shù)據(jù) 條件的重要性
update class set cl_remark='真的是不錯' where cl_id=5
--刪除一條數(shù)據(jù) 條件的重要性
delete from class where cl_id=7
--修改列標題
select cl_id as '班級主鍵',cl_class as '班級名稱' from class
select 名字=st_name from studio
--使用文字串
select '名字是:',st_name from studio
--=============條件稍微復雜點的查增刪改============
--主要涉及到 or and not between in like > < = !> !< != <> () <= >= is null is not null
--查詢cl_id 大于 1 的所有信息
select * from class where cl_id>1
--使用 or
select * from class where cl_id<>10 or cl_class='百杰一班'
--使用and
select * from class where cl_id<>10 and cl_class='百杰一班'
--使用like 和 %
select * from class where cl_class like '百杰%'
select * from class where cl_remark like '%上午%'
--使用 between
select * from class where cl_id between 3 and 5
--使用 between 配合上 not
select * from class where cl_id not between 3 and 5
--使用 is not null
select * from class where cl_remark is not null
--使用 in
select * from class where cl_class in('千星一班','百杰二班')
【 1 】 【 2 】 【 3 】 【 4 】 【 5 】