当前位置:网站首页>Day06 homework -- skill question 1
Day06 homework -- skill question 1
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 student surface ,(id Set as primary key self growth )
create table student(
id int primary key auto_increment,
name varchar(20),
score int,
address varchar(50),
useremail varchar(20)
)
desc student;
3. towards student Add records to the table
insert into student value(1,' Zhang San ',98,' Beijing ','[email protected]'),(2,' Li Si ',88,' Shanghai ','[email protected]'),(3,' Wang Wu ',78,' Guangzhou ','[email protected]'),(4,' Zhao Liu ',68,' Shenzhen ','[email protected]'),(5,' Sun Qi ',58,' Hangzhou ','[email protected]'),(6,' Xiaohong ',48,' Beijing ','[email protected]'),(7,' Little black ',99,' Shanghai ','[email protected]'),(8,' Little green ',100,' Hangzhou ','[email protected]'),(9,' Small powder ',60,' Hangzhou ','[email protected]'),(10,' Lilac ',70,' heilongjiang ','[email protected]')
4. Use sql Statement to query all contents in the table
SELECT * from student;
5. Use sql Statement to query all score>70 Of my classmates id,name,score
select id,name,score from student where score>70;
6. change name The data type of the field is varchar(50)
alter table student MODIFY COLUMN name varchar(50);
desc student;
7. Add a field to the table , The field name is “pingjia”, Field type is varchar(20)
alter table student add pingjia varchar(20);
desc student;
8. Change the score of the classmate whose name is Zhang San to 88
update student set score=88 where name=' Zhang San ';
select * from student;
9. If 80 It's a passing line , Find out the details of all qualified students
select * from student where score >=80;
10. Use keywords in, Inquire about id The value is 1 or 5 or 7 Basic information of students
select * from student where id in(1,5,7);
11. Inquire about id Values in 5 to 8 Basic information of all students
select * from student where id between 5 and 8;
12. The query name is Xiaohong and the score is greater than 60 Basic information of students
select * from student where name=' Xiaohong ' and score>60;
13. The query name is Xiao Hong or the score is greater than 90 Basic information of students
select * from student where name=' Xiaohong ' or score>90;
边栏推荐
- day06 作业---技能题7
- Learning notes of automatic control principle --- linear discrete system
- Overview of motion recognition evaluation
- 有限元学习知识点备案
- Okaleido上线聚变Mining模式,OKA通证当下产出的唯一方式
- 【数据库 】GBase 8a MPP Cluster V95 安装和卸载
- In the first year of L2, the upgrade of arbitrum nitro brought a more compatible and efficient development experience
- pl/sql之集合
- day06 作业--技能题6
- at、crontab
猜你喜欢
Spark persistence strategy_ Cache optimization
数据库操作技能7
Kotlin properties and fields
Mycat2 sub database and sub table
利用模m的原根存在性判断以及求解
JDBC数据库连接池(Druid技术)
Uni app simple mall production
Vision Group Training Day5 - machine learning, image recognition project
Arbitrum Nova release! Create a low-cost and high-speed dedicated chain in the game social field
Okaleido launched the fusion mining mode, which is the only way for Oka to verify the current output
随机推荐
Which financial product has the highest yield in 2022?
Number of briquettes & Birthday Candles & building blocks
Oracle 19C OCP 1z0-082 certification examination question bank (7-12)
CIS 2020 - alternative skills against cloud WAF (pyn3rd)
基于C语言的哈夫曼转化软件
23.10 Admin features
Regular expression: judge whether it conforms to USD format
The effective condition of MySQL joint index and the invalid condition of index
Human computer interaction software based on C language
[abstract base class inheritance, DOM, event - learning summary]
Ueditot_ JSP SSRF vulnerability recurrence
Review notes of Microcomputer Principles -- zoufengxing
P1825 [USACO11OPEN]Corn Maze S
【FreeSwitch开发实践】使用SIP客户端Yate连接FreeSwitch进行VoIP通话
Self review ideas of probability theory
day06 作业--增删改查
Vision Group Training Day5 - machine learning, image recognition project
Super potential public chain dfinity -- the best time for DFI developers to enter
Spark scheduling analysis
Winter vacation homework & Stamp cutting