当前位置:网站首页>Day06 homework - skill question 7
Day06 homework - skill question 7
2022-07-26 08:52:00 【Ning Meng】
1. establish db_test database
create database db_test character set utf8;2. establish yuangong surface
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. towards yuangong Add records to the table
insert into yuangong 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 student;
(2) Change the table name to ”emp”
alter table yuangong rename emp;(3) modify ename The type of field is varchar(40)
alter table emp MODIFY COLUMN ename varchar(40);
desc emp;
(4) Delete... From the table empno yes 1014 also ename It's Huang Gai's employee information
delete from emp where empno=1014 and ename=' Huang Gai ';
select * from emp;
(5) In the query table empno The value of the field is 1007,1009 or 1011 All records of employees
select * from emp where empno in(1007,1009,1011);
(6) Query all in the table job All the information of the employee whose field is clerk and whose name is Zhang San
select * from emp where job=' Clerk ' and ename=' Zhang San ';
(7) Query table in 2001 Information of employees who have been employed since
select * from emp where hiredate >'2001-12-31';
边栏推荐
- Pan micro e-cology8 foreground SQL injection POC
- 【搜索专题】看完必会的搜索问题之洪水覆盖
- Store a group of positive and negative numbers respectively, and count the number of 0 -- assembly language implementation
- OA项目之我的会议(查询)
- Ueditot_ JSP SSRF vulnerability recurrence
- Number of briquettes & Birthday Candles & building blocks
- Oracle 19C OCP 1z0-083 question bank (7-12)
- Cadence(十)走线技巧与注意事项
- JDBC数据库连接池(Druid技术)
- C Entry series (31) -- operator overloading
猜你喜欢
随机推荐
Excel delete blank lines
Overview of motion recognition evaluation
Web概述和B/S架构
day06 作业--技能题6
day06 作业--技能题2
General file upload vulnerability getshell of a digital campus system (penetration test -0day)
Pytoch learning - from tensor to LR
TypeScript版Snowflake主键生成器
基于C#实现的文件管理文件系统
Kotlin属性与字段
Dynamic SQL and exceptions of pl/sql
Review notes of Microcomputer Principles -- zoufengxing
Regular expression: judge whether it conforms to USD format
Arbitrum Nova release! Create a low-cost and high-speed dedicated chain in the game social field
[database] gbase 8A MPP cluster v95 installation and uninstall
The lessons of 2000. Web3 = the third industrial revolution?
数据库操作 题目二
MySQL 8.0 OCP (1z0-908) has a Chinese exam
Using the primitive root of module m to judge and solve
Spark SQL common date functions









