当前位置:网站首页>SQL statement exercise
SQL statement exercise
2022-07-26 00:44:00 【lookout99】
One 、
1. establish test database


2. stay test Create in the database student surface , The table structure is shown in the following figure (id Set as primary key self growth )



![]()
3. towards student Add records to the table as shown in the following figure



4. Use sql Statement to query all contents in the table

5. Use sql Statement to query all score>70 Of my classmates id,name,score

6. change name The data type of the field is varchar(50)

7. Add a field to the table , The field name is “pingjia”, Field type is varchar(20)

8. Change the score of the classmate whose name is Zhang San to 88

9. If 80 It's a passing line , Find out the details of all qualified students

10. Use keywords in, Inquire about id The value is 1 or 5 or 7 Basic information of students

11. Inquire about id Values in 5 to 8 Basic information of all students

12. The query name is Xiaohong and the score is greater than 60 Basic information of students

13. The query name is Xiao Hong or the score is greater than 90 Basic information of students

Two 、
1. establish test database
![]()
2. stay test Create in the database emp surface , The table structure is shown in the following figure (id Set as primary key self growth )



3. towards emp Add records to the table as shown in the following figure



4. Look up everything in the table

5. The name in the query table is all the message records of Zhang San

6. 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

7. In the query table empno Fields from 1004 to 1008 Records of all employees

8. Query all in the table job All the information of the employee whose field is clerk and whose name is Huang Gai

9. Query table in 2001 Information of employees who have been employed since

10. The bonus in the query table (COMM) yes NULL Employee information

3、 ... and 、
1. establish test database
![]()
2. stay test Create in the database student surface , The table structure is shown in the following figure (id Set as primary key self growth )
![]() |

3. towards student Add records to the table as shown in the following figure


4. Use sql Statement to query the table id,name, and address All the contents of the field
5. Use sql Statement to query all students in the table id,name,score

6. change useremail The data type of the field is varchar(50)

7. Add a field to the table , The field name is “pingjia”, Field type is varchar(20)

8. Change the score of the classmate whose name is Zhang San to 92

9. If 80 It's a passing line , Find out the details of all the students who failed

10. Name is “ Xiaohong ” Students' scores are on the original basis +20

11. Use keywords in, Inquire about id The value is 1 or 5 or 7 Basic information of students

12. Inquire about id Values in 4 to 9 Basic information of all students 、

13. The query name is Xiaohong and the score is greater than 60 Basic information of students

14. The query name is Xiao Hong or the score is greater than 90 Basic information of students

15. Inquire about score The field value is NULL Basic information of students

16. Inquire about name Not Zhang San's classmate id,name, and score

17. Ascending by address , The grades are in descending order

18. De duplicate the city

Four 、
1. establish db_test database

2. stay test Create in the database yuangong surface , The table structure is shown in the following figure (id Set as primary key self growth )


3. towards yuangong Add records to the table as shown in the following figure


4. Look up everything in the table

5. Change the table name to ”emp”
6. modify ename The type of field is varchar(40)

7. Delete... From the table empno yes 1014 also ename It's Huang Gai's employee information

8. In the query table empno The value of the field is 1007,1009 or 1011 All records of employees

9. Query all in the table job All the information of the employee whose field is clerk and whose name is Zhang San

10. Query table in 2001 Information of employees who have been employed since

5、 ... and 、

1: Check the name and average score of each student
|
2: Check the names of students who failed in the exam
|
3: Query the top three data with the highest scores
|
4: Add a new one rose My math score is 50 Minute data |
5: modify jack My math score is 85
|
6: Delete susanla Biological performance data
|
7: The query name contains c The data of
|
边栏推荐
- 分布式事务和Seata的AT模式原理
- P4047 [jsoi2010] tribal Division
- 从另一个角度告诉你单元测试的意义
- PC website realizes wechat code scanning login function (II)
- HOOPS Exchange助力混合计算流体动力学软件搭建3D格式导入读取功能 | 客户案例
- Getting started with D3D calculation shaders
- 2022/7/24 examination summary
- Leetcode notes 20. valid parentheses
- 8个小妙招调整数据库性能优化,yyds
- Mwec: a new Chinese word discovery method based on multi semantic word vector
猜你喜欢

Hnoi2012 mine construction

开放下载!《阿里巴巴 DevOps 实践手册》

Super super super realistic digital people! Keep you on the air 24 hours a day

Verilog语法基础HDL Bits训练 05

Jmeter之用户自定义变量和抽离公共变量

Database tools duel: heidisql and Navicat
![[plaything determination scratch children programming] ride a small motorcycle (dynamic background + camera control operation)](/img/35/5fe27d3f61b41bf4b9434cd4d7d1b1.png)
[plaything determination scratch children programming] ride a small motorcycle (dynamic background + camera control operation)

你还在掐表算时间复杂度?

Modeling and simulation analysis of online medical crowdfunding communication based on SEIR model

南姐的糗事
随机推荐
BGP comprehensive experiment
Leetcode 笔记 20. 有效的括号
[untitled] how to realize pluggable configuration?
[plaything determination scratch children programming] ride a small motorcycle (dynamic background + camera control operation)
What is the difference between request forwarding and request redirection?
GOM and GEE engine black screen does not display the interface, and the solution of equipping map monsters
Getting started with D3D calculation shaders
Jmeter之用户自定义变量和抽离公共变量
2022/7/25 考试总结
[contents] mqtt, nodejs projects
Verilog grammar basics HDL bits training 06
8个小妙招调整数据库性能优化,yyds
Tarjan finds the strongly connected component o (n+m), shrinking point
你还在掐表算时间复杂度?
解决背景图设置100%铺满时,缩放浏览器出现水平滚动条时,滚动条超出的部分背景图没有铺满的问题
Research on the integrated data quality management system and technical framework under the scenario of data circulation and transaction
[calculate the number of times that one string is equal to another string]
[oops framework] network module websocket
Seretod2022 track1 code analysis - task-based dialogue system challenge for semi supervised and reinforcement learning
Quick start sequence table chain table






