当前位置:网站首页>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;
边栏推荐
- 正则表达式:判断是否符合USD格式
- [untitled]
- Maximum common substring & regularity problem
- 1、 Redis data structure
- TypeScript版Snowflake主键生成器
- The lessons of 2000. Web3 = the third industrial revolution?
- Foundry教程:使用多种方式编写可升级的智能合约(上)
- Oracle 19C OCP 1z0-082 certification examination question bank (51-60)
- In the first year of L2, the upgrade of arbitrum nitro brought a more compatible and efficient development experience
- Web3 Games: current situation and future
猜你喜欢
Transfer guide printing system based on C language design
One click deployment of lamp and LNMP scripts is worth having
Leetcode and query question summary
at、crontab
Hegong sky team vision training Day6 - traditional vision, image processing
MySQL 8.0 OCP (1z0-908) has a Chinese exam
数据库操作 技能6
Solve the problem of C # calling form controls across threads
Memory management based on C language - Simulation of dynamic partition allocation
海内外媒体宣发自媒体发稿要严格把握内容关
随机推荐
【加密周报】加密市场有所回温?寒冬仍未解冻 盘点上周加密市场发生的重大事件
Recurrence of SQL injection vulnerability in the foreground of a 60 terminal security management system
SSH,NFS,FTP
What are the differences in the performance of different usages such as count (*), count (primary key ID), count (field) and count (1)? That's more efficient
[suggestions collection] summary of MySQL 30000 word essence - locking mechanism and performance tuning (IV) [suggestions collection]
Oracle 19C OCP 1z0-083 question bank (1-6)
[freeswitch development practice] user defined module creation and use
Uni app simple mall production
C#入门系列(三十一) -- 运算符重载
P3743 kotori的设备
数据库操作 技能6
23.9 application exit application exit
Oracle 19C OCP 1z0-082 certification examination question bank 1
解决C#跨线程调用窗体控件的问题
Xshell batch send command to multiple sessions
Spark scheduling analysis
day06 作业--技能题1
Learning notes of automatic control principle --- linear discrete system
Cve-2021-21975 VMware SSRF vulnerability recurrence
Maximum common substring & regularity problem