当前位置:网站首页>Day06 homework -- skill question 2
Day06 homework -- skill question 2
2022-07-26 08:52:00 【Ning Meng】
1. establish test database
create database test character set utf8;2. stay test Create in the database emp surface (id Set as primary key self growth )
create table emp(
empno int not null primary key auto_increment,
ename varchar(50),
job varchar(50),
mgr int,
hiredate date,
sal decimal(7,2),
COMM decimal(7,2),
deptno int
)
desc emp; 
3. towards emp Add records to the table
insert into emp value (1001,' Gan Ning ',' Clerk ',1013,'2000-12-17',8000.00,null,20),
(1002,' Daisy ',' Salesperson ',1006,'2001-02-20',16000.00,3000.00,30),
(1003,' Yin Zhengtian ',' Salesperson ',1006,'2001-02-22',12500.00,5000.00,30),
(1004,' Liu bei ',' The manager ',1009,'2001-04-02',29750.00,null,20),
(1005,' Thank sun ',' Salesperson ',1006,'2001-09-28',12500.00,14000.00,30),
(1006,' Guan yu ',' The manager ',1009,'2001-05-01',28500.00,null,30),
(1007,' Zhang Fei ',' The manager ',1009,'2001-09-01',24500.00,null,10),
(1008,' Zhugeliang ',' analysts ',1004,'2007-04-19',30000.00,null,20),
(1009,' Zeng a Niu ',' Chairman of the board of directors ',null,'2001-11-17',50000.00,null,10),
(1010," Xiangr "," Salesperson ",1006,"2001-09-08",15000.00,0.00,30),
(1011," Zhou Tai "," Clerk ",1008,"2007-05-23",11000.00,null,20),
(1012," Cheng pu "," Clerk ",1006,"2001-12-03",9500.00,null,30),
(1013," Pang Tong "," analysts ",1004,"2001-12-03",30000.00,null,20),
(1014," Huang Gai "," Clerk ",1007,"2002-01-23",13000.00,null,10),
(1015," Zhang San "," Clerk ",1007,"2002-01-23",53000.00,null,50)Use sql Statement completes the following functions ;
(1) Look up everything in the table
select * from emp;
(2) The name in the query table is all the message records of Zhang San
select * from emp where ename=' Zhang San ';
(3) The name in the query table is the name of all employees consisting of three words ename,job,sal The corresponding information of the field
select ename,job,sal from emp where ename like '___';

(4) In the query table empno Fields from 1004 to 1008 Records of all employees
select * from emp where empno between 1004 and 1008;
(5) Query all in the table job All the information of the employee whose field is clerk and whose name is Huang Gai
select * from emp where job=' Clerk ' and ename=' Huang Gai ';
(6) Query table in 2001 Information of employees who have been employed since
select * from emp where hiredate >='2002-01-01';
(7) The bonus in the query table (COMM) yes NULL Employee information
select * from emp where COMM is null;
边栏推荐
- Okaleido launched the fusion mining mode, which is the only way for Oka to verify the current output
- 03异常处理,状态保持,请求钩子---04大型项目结构与蓝图
- uni-app 简易商城制作
- Vision Group Training Day5 - machine learning, image recognition project
- Pxe原理和概念
- My meeting of OA project (query)
- Learn more about the difference between B-tree and b+tree
- 基于C语言设计的换乘指南打印系统
- Set of pl/sql
- Foundry tutorial: writing scalable smart contracts in various ways (Part 1)
猜你喜欢

node-v下载与应用、ES6模块导入与导出
![[freeswitch development practice] use SIP client Yate to connect freeswitch for VoIP calls](/img/8b/d5792a00fc5798d3d960f1f1b1088e.png)
[freeswitch development practice] use SIP client Yate to connect freeswitch for VoIP calls

Grid segmentation

Sklearn machine learning foundation (linear regression, under fitting, over fitting, ridge regression, model loading and saving)

Neo eco technology monthly | help developers play smart contracts

My meeting of OA project (meeting seating & submission for approval)

Poor English, Oracle OCP or MySQL OCP exam can also get a high score of 80 points

day06 作业--技能题1

Foundry tutorial: writing scalable smart contracts in various ways (Part 1)

uni-app 简易商城制作
随机推荐
Xtrabackup appears' flush no '_ WRITE_ TO_ BINLOG TABLES‘: 1205 (HY000) Lock wait timeout exceeded;
基于C#实现的文件管理文件系统
Oracle 19C OCP 1z0-082 certification examination question bank (51-60)
P1825 [USACO11OPEN]Corn Maze S
Oracle 19C OCP 1z0-082 certification examination question bank (24-29)
OA项目之我的会议(会议排座&送审)
23.9 application exit application exit
File management file system based on C #
Alphabetic string
General file upload vulnerability getshell of a digital campus system (penetration test -0day)
12306 ticket system crawling - 1. Saving and reading of city code data
Huffman transformation software based on C language
Set of pl/sql
03异常处理,状态保持,请求钩子---04大型项目结构与蓝图
P3743 Kotori's equipment
Mycat2 sub database and sub table
Winter vacation homework & Stamp cutting
IC's first global hacking bonus is up to US $6million, helping developers venture into web 3!
【FreeSwitch开发实践】自定义模块创建与使用
Poor English, Oracle OCP or MySQL OCP exam can also get a high score of 80 points