1select name from student
select name,math from student
2、select * from student where + 条件
条件:
(1)class =1833
(2)class=1833 or class=1834
(3)class=1833 and sex=1/ age>=25 and age<=27
(4)class is null class is not null
(5)name like '%ao%'
(6) id limit 8
id limit 2,5 (取3-7行)
3、备份
备份表:
create table student1 like student
insert into student1 selsct * from student
insert into student1(name,age) select name,age from student
eae备份数据库:
linux界面备份sql脚本:mysqldump -uroot -p123456 dcs8>/dcs8.sql
数据库界面创建新库:create database dcs8_back
linux界面将脚本还原到新库:mysql -uroot -p123456 dcs8_back</dcs8.sql
|
|