123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- select DATABASE();
- USE db1;
- show tables ;
- create table person (
- id int,
- name varchar(20),
- age int
- );
- show tables ;
- Desc person;
- alter table person rename to person01;
- desc person01;
- show tables;
- alter table person01 add password varchar(10);
- alter table person01 modify password varchar(50);
- alter table person01 change password pass varchar(50) ;
- desc person01;
- alter table person01 drop age;
- desc person01;
- drop table if exists person01;
- show tables ;
- create table studetn(
- id int ,
- username varchar(20),
- password varchar(50),
- age int,
- address varchar(100),
- score int ,
- weight decimal(5,2)
- );
- show tables ;
- alter table studetn rename to student;
- insert into student (id,username,password) values ( 1,'zs','123456' );
- select * from student;
- insert into student values (2,'ls','123456',22,'北京',60,70.8);
- insert into student values (3,'ls','123456',22,'北京',60,70.8)
- ,(4,'ls','123456',22,'北京',60,70.8),(5,'ls','123456',22,'北京',60,70.8)
- ,(6,'ls','123456',22,'北京',60,70.8),(7,'ls','123456',22,'北京',60,70.8);
- update student set address = '哈尔滨' , score = 90 , weight = 200 where username = 'zs';
- update student set address = '上海';
- select * from student;
- delete from student where score = 90;
- select * from student;
- delete from student
|