当前位置:网站首页>21 day SQL punch in summary
21 day SQL punch in summary
2022-07-28 05:19:00 【Pony_ eighteen】
Catalog
Be careful :Linux Next mysql5.6 The password of is empty by default , direct Enter Get into
The first 1 Day job
Method 1 :windows Under the graphical interface
1) Create database istester
2) Check whether the database creation is successful

Method 2 :linux The command operation
drop database if exists istester;
create database istester;
show databases;// View all databases
use istester // Get into istester database
status; // View the current database information

The first 2 Day job
Created yesterday isTester Under database , establish surface istester and surface idoxu
notes :SQL The homework , The other day's library 、 surface , It's all about building the foundation ; None of this , Add, delete, modify and check later , You can't play ;
1)isTester Table fields 、 type 、 attribute :
id INT(10) NOT NULL UNIQUE PRIMARY KEY ,
uname VARCHAR(20) NOT NULL ,
sex VARCHAR(4) ,
birth YEAR,
department VARCHAR(20) ,
address VARCHAR(50) ,
idoxu VARCHAR(20)
2)idoxu Table fields 、 type 、 attribute :
id INT(10) NOT NULL UNIQUE PRIMARY KEY AUTO_INCREMENT ,
stu_id INT(10) NOT NULL ,
c_name VARCHAR(20) ,
istester VARCHAR(50) ,
grade INT(10)
Method 1 : Graphical tools


Method 2 : Command line
create table istester(
id ...);

The first 3 Day job
According to the existing table istester and idoxu Create new table ( Copy table )
1) Copy istester Table structure , Create new table istester2
notes : There are two ways
2) Copy idoxu Table structure and data , Create new table idoxu2
3) Copy idoxu Table structured id,stu_id,istester Three fields , Create new table idoxu3
Method 1 :
Right click the copy table directly and rename it
Method 2 :
1) Copy istester Table structure , Create new table istester2
notes : There are two ways
create table istester2 like istester ;
or
create table idoxu2 as select * from idoxu where 2=1;
2) Copy idoxu Table structure and data , Create new table idoxu3
create table idoxu3 as select * from idoxu
3) Copy idoxu Table structured id,stu_id,istester Three fields , Create new table idoxu3
create table idoxu3 as select id,stu_id,istester from idoxu where 1<>1;
The first 4 Day job
1) Delete table istester2
2) Delete table at the same time idoxu2 and idoxu3
3) See what other tables are available

The first 5 Day job
1) modify istester surface , Add a field istester6 ( Character type VARCHAR, length 100, Not allowed to be empty )
2) View fields istester6 , Whether to add successfully
3) modify istester surface , Delete field istester6
4) Acknowledgement field istester6 , Delete successfully


show columns from istester = desc istester

The first 6 Day job ,
Insert insert:
1) To watch istester insert data
id = 1 ,uname = idoxu ,idoxu = 2020
id = 2 ,uname = idoxu2 ,idoxu = 2020
id=11,uname = idoxu3,sex=1
id=12,uname = idoxu4,sex=2
id=13,uname = idoxu5,sex=1
id=14,uname = idoxu6,sex=2
2) To watch idoxu insert data
id=4,stu_id=11,c_name=idoxu,grade=90
id=5,stu_id=12,c_name=lin,grade=100
id=6,stu_id=33,c_name=istester,grade=20


The first 7 Day job
1) Inquire about istester surface id = 1 The content of
2) Inquire about idoxu surface grade=100 The content of

The first 8 Day job
continue select
1) lookup idoxu surface , name (c_name) contain “i” The data of
2) lookup istester surface ,id contain “1” The data of
3) lookup istester surface ,id contain “1” The data of , Press id Descending
4) lookup istester surface ,id contain “1” The data of , take id The biggest three
select * from istester where uname like '%i%';



The first 9 Day job
1) find idoxu In the table , Students with the highest scores and scores
2) find idoxu In the table , Students with the lowest scores and scores

Method 2 : Subquery + function

The first 10 Day job
-- 1) find istester surface ,sex Empty data ;
-- 2) to update istester surface , hold sex Empty , Set to 0( Gender unknown )
-- 3) find idoxu surface ,grade Less than 60 Classmate
-- 4) to update idoxu surface , hold grade Less than 60 Classmate , All changed to 59 branch





The first 11 Day job
-- 1) lookup istester surface , Press id Descending
-- 2) lookup idoxu surface , Press grade Ascending


The first 12 Day job
1) Inquire about istester surface , How many pieces of data are there
2) Inquire about istester surface , There are several gender types (sex Field , duplicate removal )


The first 13 Day job
1) lookup idoxu surface , Student achievement (grade) Total score
2) lookup idoxu surface , Student achievement (grade) average

The first 14 Day job
1) lookup idoxu surface , Achievements in 80 - 100 Students in the section ;( continuity )
2) lookup istester surface ,id by 2,11,12 The data of ;( Discontinuous )


The first 15 Day job
1) Delete istester surface ,id Greater than 12 The data of ;
2) Delete idoxu surface , fraction grade fail, ( Less than 60 branch ) The data of ;
![]()
The first 16 Day job ***
1) To build the data , hold istester All data of table , Insert into idoxu surface
Field value rules
id take id
stu_id take id
c_name take uname
istester and grade Field , Give default 60
The first 17 Day job
-- 1) Modify table idoxu, Put field istester , Change it to istester6( Character type varchar, length 160 )
-- 2) Check whether the modification is successful
-- 3) hold idoxu surface , Renamed as idoxu6
-- 4) Check whether the modification is successful


The first 18 Day job ***
1) Create database istesterdb6
2) Check whether the database is created successfully ;
3) Get into istesterdb6 library
4) In the database istesterdb6 , establish idoxu surface , Direct copy istester library idoxu6 Data and structure of tables ;
5) Check whether the table was created successfully ;


The first 19 Day job
idoxu surface , fraction grade
1) Top three students And fractions ;
2) ranking 3 - 6 Students of And fractions ;
3) ranking 6 All students after And fractions ;



The first 20 Day job
Multiple tables ( Left link 、 Right link 、 Inner link )
surface idoxu6 and surface istester




The first 21 Day job
1) Keep watch idoxu6, Change it to idoxu
2) Delete Library istesterdb6
3) Delete istester surface
4) Empty idoxu The data table
![]()
![]()
边栏推荐
- Service object creation and use
- How to quickly turn function test to automatic test
- Autoreleasepool problem summary
- 测试开发---自动化测试中的UI测试
- Driving the powerful functions of EVM and xcm, how subwallet enables Boca and moonbeam
- RT based_ Distributed wireless temperature monitoring system of thread (I)
- DELL远程控制卡 使用ipmitools设置ipmi
- Making RPM packages with nfpm
- 7.<tag-字符串和API的取舍>补充: 剑指 Offer 05. 替换空格
- I've been in an outsourcing company for two years, and I feel like I'm going to die
猜你喜欢

How does Alibaba use DDD to split microservices?

HashSet add

FreeRTOS learning (I)

ES6 new variable modifiers let and const, new basic data type symbol

Why is MD5 irreversible, but it may also be decrypted by MD5 free decryption website

微服务故障模式与构建弹性系统
![[paper notes] - low illumination image enhancement - zeroshot - rrdnet Network - 2020-icme](/img/e3/f9c6bfdbcd5dffd406e3f1d2331050.png)
[paper notes] - low illumination image enhancement - zeroshot - rrdnet Network - 2020-icme

【CPU占用高】software_reporter_tool.exe

【CVPR2022】Multi-Scale High-Resolution Vision Transformer for Semantic Segmentation

数据安全逐步落地,必须紧盯泄露源头
随机推荐
New modularity in ES6
Offline loading of wkwebview and problems encountered
Data security is gradually implemented, and we must pay close attention to the source of leakage
[paper notes] - low illumination image enhancement - zeroshot - rrdnet Network - 2020-icme
7. < tag string and API trade-offs> supplement: Sword finger offer 05. replace spaces
【ARXIV2203】SepViT: Separable Vision Transformer
【ARXIV2203】Efficient Long-Range Attention Network for Image Super-resolution
How to simulate common web application operations when using testcafe
Reading sdwebimage source code Notes
Internal implementation principle of yymodel
Summary and review of puppeter
Applet import project
测试开发---自动化测试中的UI测试
Gan: generative advantageous nets -- paper analysis and the mathematical concepts behind it
After ruoyi generates the code corresponding to the database, what should I do to make the following image look like
数据库日期类型全部为0
Improving the readability of UI layer test with puppeter
【CPU占用高】software_reporter_tool.exe
基于MPLS构建虚拟专网的配置实验
Testcafe provides automatic waiting mechanism and live operation mode