当前位置:网站首页>Mysql database -dql
Mysql database -dql
2022-07-03 16:40:00 【Don't go to graduate school, don't change your name TL】
Single table query
Data preparation
-- establish db1 database
CREATE DATABASE db1;
-- Use db1 database
USE db1;
-- Create data table
CREATE TABLE product(
id INT, -- Product id
NAME VARCHAR(20), -- Name of commodity
price DOUBLE, -- commodity price
brand VARCHAR(10), -- Brand of goods
stock INT, -- inventory
insert_time DATE -- Add the time
);
-- Add data
INSERT INTO product VALUES (1,' Huawei mobile phones ',3999,' Huawei ',23,'2088-03-10'),
(2,' Mi phones ',2999,' millet ',30,'2088-05-15'),
(3,' Apple mobile phone ',5999,' Apple ',18,'2088-08-20'),
(4,' Huawei's computer ',6999,' Huawei ',14,'2088-06-16'),
(5,' Xiaomi computer ',4999,' millet ',26,'2088-07-08'),
(6,' Apple computer ',8999,' Apple ',15,'2088-10-25'),
(7,' Lenovo computer ',7999,' lenovo ',NULL,'2088-11-11');Created a db1 The database of , It contains product The table is shown below :

The query syntax
select
Field list
from
List of table names
where
List of conditions
group by
Grouping field
having
Grouping after Conditions ( Cannot use after grouping where, Only use having)
order by
Sort
limit
Paging limit
Query all
(1) Query data of all tables
(2) Query the table data of the specified field
(3) Remove duplicate queries
(4) Calculate the value of the column ( arithmetic )
(5) Alias query
unfinished ....
边栏推荐
- Processing strategy of message queue message loss and repeated message sending
- Le zèbre a été identifié comme un chien, et la cause de l'erreur d'AI a été trouvée par Stanford
- Zebras are recognized as dogs, and Stanford found the reason why AI made mistakes
- Cocos Creator 2. X automatic packaging (build + compile)
- 疫情常态化大背景下,关于远程办公的思考|社区征文
- Golang 装饰器模式以及在NSQ中的使用
- 为抵制 7-Zip,列出 “三宗罪” ?网友:“第3个才是重点吧?”
- TCP擁塞控制詳解 | 3. 設計空間
- Thinking about telecommuting under the background of normalization of epidemic | community essay solicitation
- Basis of target detection (IOU)
猜你喜欢

QT串口ui设计和解决显示中文乱码

0214-27100 a day with little fluctuation

Le zèbre a été identifié comme un chien, et la cause de l'erreur d'AI a été trouvée par Stanford

Mysql 将逗号隔开的属性字段数据由列转行

拼夕夕二面:说说布隆过滤器与布谷鸟过滤器?应用场景?我懵了。。

Netease UI automation test exploration: airtest+poco
![[combinatorics] non descending path problem (outline of non descending path problem | basic model of non descending path problem | non descending path problem expansion model 1 non origin starting poi](/img/81/59ed6bebf5d85e9eb71bd4ca261309.jpg)
[combinatorics] non descending path problem (outline of non descending path problem | basic model of non descending path problem | non descending path problem expansion model 1 non origin starting poi

CC2530 common registers for port interrupts

What material is 12cr1movr? Chemical property analysis of pressure vessel steel plate 12cr1movr

word 退格键删除不了选中文本,只能按delete
随机推荐
PHP中register_globals参数设置
Multithread 02 thread join
How programming apes grow rapidly
To resist 7-Zip, list "three sins"? Netizen: "is the third key?"
function overloading
Learn from me about the enterprise flutter project: simplified framework demo reference
Alibaba P8 painstakingly sorted it out. Summary of APP UI automated testing ideas. Check it out
Yu Wenwen, Hu Xia and other stars take you to play with the party. Pipi app ignites your summer
Leetcode binary search tree
【剑指 Offer 】57 - II. 和为s的连续正数序列
PHP production website active push (website)
[combinatorics] polynomial theorem (polynomial coefficients | full arrangement of multiple sets | number of schemes corresponding to the ball sub model | polynomial coefficient correlation identity)
Eleven requirements for test management post
NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
Client does not support authentication protocol requested by server; consider upgrading MySQL client
TCP congestion control details | 3 design space
utfwry. Dat PHP, about ThinkPHP's method of IP location using utfwry address Library
Mongodb installation and basic operation
ThreeJS 第二篇:顶点概念、几何体结构
MongoDB 的安装和基本操作