当前位置:网站首页>day06 作业---技能题7
day06 作业---技能题7
2022-07-26 08:41:00 【宁氓】
1.创建db_test数据库
create database db_test character set utf8;2.创建yuangong表
create table yuangong(
empno int not null primary key,
ename varchar(50),
job varchar(50),
mgr int,
hiredate date,
sal decimal(7,2),
COMM decimal(7,2),
deptno int
)
desc yuangong;
3.向yuangong表中添加记录
insert into yuangong value
(1001,'甘宁','文员',1013,'2000-12-17',8000.00,null,20),
(1002,'黛绮丝','销售员',1006,'2001-02-20',16000.00,3000.00,30),
(1003,'殷正天','销售员',1006,'2001-02-22',12500.00,5000.00,30),
(1004,'刘备','经理',1009,'2001-04-02',29750.00,null,20),
(1005,'谢逊','销售员',1006,'2001-09-28',12500.00,14000.00,30),
(1006,'关羽','经理',1009,'2001-05-01',28500.00,null,30),
(1007,'张飞','经理',1009,'2001-09-01',24500.00,null,10),
(1008,'诸葛亮','分析师',1004,'2007-04-19',30000.00,null,20),
(1009,'曾阿牛','董事长',null,'2001-11-17',50000.00,null,10),
(1010,"韦一笑","销售员",1006,"2001-09-08",15000.00,0.00,30),
(1011,"周泰","文员",1008,"2007-05-23",11000.00,null,20),
(1012,"程普","文员",1006,"2001-12-03",9500.00,null,30),
(1013,"庞统","分析师",1004,"2001-12-03",30000.00,null,20),
(1014,"黄盖","文员",1007,"2002-01-23",13000.00,null,10),
(1015,"张三","文员",1007,"2002-01-23",53000.00,null,50)
使用sql语句完成以下功能:
(1)查询表中所有内容
select * from student;
(2)修改表名为”emp”
alter table yuangong rename emp;(3)修改ename字段的类型为varchar(40)
alter table emp MODIFY COLUMN ename varchar(40);
desc emp;
(4)删除表中empno是1014并且ename是黄盖的员工信息
delete from emp where empno=1014 and ename='黄盖';
select * from emp;
(5)查询表中empno字段的值是1007,1009或1011员工的所有记录
select * from emp where empno in(1007,1009,1011);
(6)查询表中所有job字段是文员并且姓名是张三的员工的所有信息
select * from emp where job='文员' and ename='张三';
(7)查询表中在2001年以后入职的员工信息
select * from emp where hiredate >'2001-12-31';
边栏推荐
- sklearn 机器学习基础(线性回归、欠拟合、过拟合、岭回归、模型加载保存)
- Run file command
- Study notes of automatic control principle --- stability analysis of control system
- Flutter WebView three fingers rush or freeze the screen
- Transfer guide printing system based on C language design
- Flutter compilation fails
- Deploy prometheus+grafana monitoring platform
- Flutter custom player progress bar
- Dear teachers, how can sqlserver get DDL in flinkcdc?
- Registration of finite element learning knowledge points
猜你喜欢

【搜索专题】看完必会的搜索问题之洪水覆盖

Memory management based on C language - Simulation of dynamic partition allocation

【C语言】程序员筑基功法——《函数栈帧的创建与销毁》

pl/sql之集合-2

Arbitrum launched the anytrust chain to meet the diverse needs of ecological projects

What are the contents of Oracle OCP and MySQL OCP certification exams?
![[search topics] flood coverage of search questions after reading the inevitable meeting](/img/54/ce672d21a4a67110ee629dde3cb9dc.png)
[search topics] flood coverage of search questions after reading the inevitable meeting

利用模m的原根存在性判断以及求解

Memory management - dynamic partition allocation simulation

OA项目之我的会议(会议排座&送审)
随机推荐
Cve-2021-3156 duplicate of sudo heap overflow privilege raising vulnerability
Flitter imitates wechat long press pop-up copy recall paste collection and other custom customization
MySQL 8.0 OCP (1z0-908) has a Chinese exam
Flutter WebView jitter
Cadence(十)走线技巧与注意事项
Oracle 19C OCP 1z0-082 certification examination question bank (42-50)
Cve-2021-26295 Apache OFBiz deserialization Remote Code Execution Vulnerability recurrence
Arbitrum Nova release! Create a low-cost and high-speed dedicated chain in the game social field
Poor English, Oracle OCP or MySQL OCP exam can also get a high score of 80 points
Redis advanced
基于C语言实现的人机交互软件
IC's first global hacking bonus is up to US $6million, helping developers venture into web 3!
Please tell me if there is any way to increase the write out rate when the Flink SQL client is in the sink table. When synchronizing through sink table
【数据库 】GBase 8a MPP Cluster V95 安装和卸载
Pan micro e-cology8 foreground SQL injection POC
Mycat2 sub database and sub table
03异常处理,状态保持,请求钩子---04大型项目结构与蓝图
Logic of data warehouse zipper table
Kept dual machine hot standby
Kotlin function