use test;
create table student(
id int primary key,
name varchar(100),
age int(2) default 10);
show tables;
describe student;
drop table student;
alter table student add column sex varchar(2) default 1;
alter table student add a int,add b int,add c int;
alter table student add x int default 120,add y int default 121,add z int default 122;
alter table student modify column sex char(4);
alter table student change column a aa int default 9797;
alter table student drop column aa;
alter table student drop column b, drop column c;
alter table student rename to stu;
alter table stu rename to student;
select * from student;
insert into student values(1, '张三', 19, 'boy', 11, 12, 13);
insert into student (id, name, sex) values (2, '哈哈', 'boy');
alter table stdent drop column x,drop column y,drop column z;
alter table student drop column sex;
insert into student
values
(4, '王五', 13),
(5, '王6', 14),
(6, '王7', 12);
alter table student add column class varchar(10);
select * from student;
update student set class = '二班';
update student set age = 15 where id = 4;
update student set age = 1, name = '一', class = '一班' where id = 1;
update student set age = 2 where class = '二班';
delete from student where id = 6;
delete from student;
alter table student drop column class;
insert into student values
(1, '张三', 18),
(2, '李四', 19),
(3, '王五', 18);
alter table student add column class varchar(10);
update student set class = '二班';
select name, class from student;
select name '姓名', class '班级' from student;
select concat(class, '-', name) '班级-姓名' from student;
alter table student add servlet int, add jsp int;
select name '姓名', (servlet + jsp) '总成绩' from student;
select name, age, (servlet + jsp) '总成绩', class, '光明小学' from student
select '常量' from student;
select distinct age from student;
select * from student where name = '张三'
select name, age, class from student where age > 18;
select name, age, class from student where age between 15 and 20;
select * from student where class = '二班' and age < 20;
select * from student;
insert into student (id, name) values (8, '');
select * from student where name = '';
select * from student where name <> '';
select * from student where name is null;
select * from student where name is not null;
select * from student where name like '%张%';
insert into student values (10, '大小张伟', 50, '二班', 9, 9);
select * from student where name like '_张%';
这是哪个课程里的