1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| create database python;
use python;
create table students( ID int primary key auto_increment, Name varchar(20) not null, Python float default 50.0, Java float default 60.0, C float default 0.0 );
insert into students(Name,Python,Java,C) values ("张三",90.5,60,55), ("李四",100,88,66), ("王五",77,58,43) ;
select * from students; select Name,Python from students; select ID,Name,Python from students where Python >=80;
update students set C = 60 where ID=1;
delete from students where id =3;
truncate table students;
|