create database fuxi --创建一个名为“fuxi”的数据库
go --连接语句
use fuxi --使用名为“fuxi”的数据库
go
create table hua --创建名为“hua”的表
(
--在表内添加列
gonghao int,
mingzi varchar(10),
gongzi int,
bumen varchar(10),
nianling int,
)
go
--插入数据
insert into hua values(1,'张三',2600,'销售部',26)
insert into hua values(2,'石头',3600,'售后部',21)
insert into hua values(3,'刑宗',6000,'管理部',33)
insert into hua values(4,'雷霆',3800,'维修部',26)
go
--查询数据
select *from hua
select gongzi,mingzi from hua
select bumen,gongzi from hua where mingzi='雷霆'
select *from hua where gongzi between 3800 and 6000
--修改数据
update hua set gonghao=1
update hua set mingzi='雷霆' where gonghao=4
update hua set bumen='维修部' where gongzi between 2600 and 3600
alter table hua add en int
--删除数据
alter table hua drop column en
delete from hua where mingzi='雷霆'
delete from hua
drop table hua
drop database fuxi
相关文章
- tebsorflow2.0 tf.keras猫狗识别(2)—自定义训练
- ConvNeXt V2实战:使用ConvNeXt V2实现图像分类任务(二)
- 黑马在线教育数仓实战2
- SSM框架实战-搭建自己的个人博客2-UEditor编辑器的使用
- DMHS搭建DMDSC 2节点集群同步到单库
- 提速 Spark SQL 2 倍,GLUTEN 向量化引擎原理剖析
- Android 11.0 Camera2退出时屏幕旋转为横屏
- 使用 HertzBeat 5分钟搞定 SpringBoot2 监控告警
- 【230310-4】已知圆心在x轴上的圆C与直线l:x+2倍根号2-10=0切于点E(m,2倍根号2),圆P:x2+(a+2)x+y2-ay+a+1=0 求: 1)c的方程 2)已知a>1,圆P与x轴
- 数据库还原技巧 2章