MySql 常用语句及单词练习
create database test default character set utf8;
show databases;
Select schema_name,default_character_set_name from information_schema.schemata
Where schema_name ='test';
Drop database test;
create database bjsxt default character set utf8;
use bjsxt;
create table biao(biao_id int,biao_name varchar(8),biao_money float(8,2));
show tables;
drop table biao;
Alter table employees rename emp;
Alter table ccc change column employee_name name varchar(20);
Alter table ccc modify name varchar(40);
Alter table emp add column love text;
Alter table emp drop column love;
alter table emp add primary key (eep_id);
alter table emp modify eep_id int auto_increment;
alter table emp modify ep_id int;
alter table emp drop primary key;
alter table was add constraint was_fk foreign key(dept_id) references ems(ems_id);
alter table rrr drop foreign key rrr_fk;
alter table sw add constraint sw_uk unique(sw_bumen);
alter table jjj drop key jjj_uq;
alter table ks modify love text not null;
alter table jjs modify love text null;
create table emp( emp_id int primary key auto_increment,
emp_name varchar(10) unique,emp_money float(8,3) not null);
insert into bbs(bbs_id,bbs_name,love)values(2,'wangwu','dog');
insert into jjk values (default,'zhang san',5000);
alter table mmp3 add column toy_id int default 14;
update lls set love = ' cat cat cat ' where lls_id =1;
delete from ep where ep_id =1;
select * from outside;
Select sn.student_name as name from student as sn;
Select distinct id,name,subject,score from student_repeat;
select last_name,job_id,department_id from employees where department_id=50;
select last_name,salary from employees where salary>=5000;
show databases;
Select schema_name,default_character_set_name from information_schema.schemata
Where schema_name ='test';
Drop database test;
create database bjsxt default character set utf8;
use bjsxt;
create table biao(biao_id int,biao_name varchar(8),biao_money float(8,2));
show tables;
drop table biao;
Alter table employees rename emp;
Alter table ccc change column employee_name name varchar(20);
Alter table ccc modify name varchar(40);
Alter table emp add column love text;
Alter table emp drop column love;
alter table emp add primary key (eep_id);
alter table emp modify eep_id int auto_increment;
alter table emp modify ep_id int;
alter table emp drop primary key;
alter table was add constraint was_fk foreign key(dept_id) references ems(ems_id);
alter table rrr drop foreign key rrr_fk;
alter table sw add constraint sw_uk unique(sw_bumen);
alter table jjj drop key jjj_uq;
alter table ks modify love text not null;
alter table jjs modify love text null;
create table emp( emp_id int primary key auto_increment,
emp_name varchar(10) unique,emp_money float(8,3) not null);
insert into bbs(bbs_id,bbs_name,love)values(2,'wangwu','dog');
insert into jjk values (default,'zhang san',5000);
alter table mmp3 add column toy_id int default 14;
update lls set love = ' cat cat cat ' where lls_id =1;
delete from ep where ep_id =1;
select * from outside;
Select sn.student_name as name from student as sn;
Select distinct id,name,subject,score from student_repeat;
select last_name,job_id,department_id from employees where department_id=50;
select last_name,salary from employees where salary>=5000;
下一篇:我们都一样
声明:以上文章均为用户自行添加,仅供打字交流使用,不代表本站观点,本站不承担任何法律责任,特此声明!如果有侵犯到您的权利,请及时联系我们删除。
文章热度:☆☆☆☆☆
文章难度:☆☆☆☆☆
文章质量:☆☆☆☆☆
说明:系统根据文章的热度、难度、质量自动认证,已认证的文章将参与打字排名!
本文打字排名TOP20
登录后可见
