第一个数据表

来源:互联网 发布:java中的访问修饰符 编辑:程序博客网 时间:2024/05/22 12:36
CREATE DATaBASE wry;SHOW DATABASEs;use wry;/*创建表*/create table t1(id int,username varchar(20),passwords varchar(20),address varchar(20),phone varchar(20),score int);DESC t1;alter table t1 add birthday date;insert into t1 value(1,'张三','123','河南','1234',67,'1997-10-23'),(2,'王静','234','山西','234',77,'1996-08-26'),(3,'李四','444','广东','1111',88,'1995-11-12');insert into t1 value(4,'张洁','333','山东','5678',58,'1995-03-13');alter table t1 modify score int;/*修改*/select * from t1 order by score asc;/*升序排列*/select id,username,passwords,address,phone,score,birthday from t1where score>60;update t1 set score=80 where id=3;delete from t1where username='张洁';drop table t1;drop database wry;

0 0