自学Mysql的一些杂记

mysql


-h localhost -u  -p    


show databases  
drop database test2 
create database php;


use php;
show tables;
drop table tests;


create table class(
stu int,
age int,
area varchar(20)
);


create table score(
stu int,
name varchar(20),
kemu varchar(6)
);




rename table score to tabescore;


desc class;


打错输入\c退出




use php;
show tables;
desc msg;//打开msg表格


insert into msg
(id, title, name,content)
values
(1,'初来乍到',‘张三’, ‘刚来能不能当老大’);


set name gbk;


select *from msg




insert into msg  
(id, title, name ,content)
values
(1,'又来了','李四','千年老二');


update msg  
set 
id = 2, 
content = '偏要当老大'
where 
name = '李四'



select * from msg;
insert into msg
(id, title, name, content)
values,
(3,'3标题','刘备','雌雄双剑',),
(4,'4标题','关羽','青龙偃月刀'),
(5,'5标题','张飞','丈八蛇矛');


select * from msg;


#删除
delete from msg
where id = 2;
;


#查询
select id, title from msg;


select * from msg where id > 2;


select id, content 
from msg
where id >2;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值