当前位置:网站首页>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 ....
边栏推荐
- What is the maximum number of concurrent TCP connections for a server? 65535?
- Thinking about telecommuting under the background of normalization of epidemic | community essay solicitation
- Client does not support authentication protocol requested by server; consider upgrading MySQL client
- [combinatorics] polynomial theorem (polynomial theorem | polynomial theorem proof | polynomial theorem inference 1 item number is the number of non negative integer solutions | polynomial theorem infe
- Golang anonymous function use
- Pytorch 1.12 was released, officially supporting Apple M1 chip GPU acceleration and repairing many bugs
- TCP擁塞控制詳解 | 3. 設計空間
- 面试之 top k问题
- Yu Wenwen, Hu Xia and other stars take you to play with the party. Pipi app ignites your summer
- What material is 12cr1movr? Chemical property analysis of pressure vessel steel plate 12cr1movr
猜你喜欢

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

8 cool visual charts to quickly write the visual analysis report that the boss likes to see

What kind of material is 14Cr1MoR? Analysis of chemical composition and mechanical properties of 14Cr1MoR

为抵制 7-Zip,列出 “三宗罪” ?网友:“第3个才是重点吧?”

爱可可AI前沿推介(7.3)

TCP congestion control details | 3 design space

The mixlab editing team is recruiting teammates~~

Visual SLAM algorithms: a survey from 2010 to 2016

于文文、胡夏等明星带你玩转派对 皮皮APP点燃你的夏日

面试官:JVM如何分配和回收堆外内存
随机推荐
PyTorch 1.12发布,正式支持苹果M1芯片GPU加速,修复众多Bug
PHP production website active push (website)
面试官:JVM如何分配和回收堆外内存
[statement] about searching sogk1997 and finding many web crawler results
Visual SLAM algorithms: a survey from 2010 to 2016
utfwry. Dat PHP, about ThinkPHP's method of IP location using utfwry address Library
Le zèbre a été identifié comme un chien, et la cause de l'erreur d'AI a été trouvée par Stanford
架构实战营 - 第 6 期 毕业总结
Difference between JSON and bson
Using optimistic lock and pessimistic lock in MySQL to realize distributed lock
香港理工大学|数据高效的强化学习和网络流量动态的自适应最优周界控制
斑马识别成狗,AI犯错的原因被斯坦福找到了
Summary of three methods of PHP looping through arrays list (), each (), and while
[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
LeetCode1491. Average value of wages after removing the minimum wage and the maximum wage
A survey of state of the art on visual slam
一台服务器最大并发 tcp 连接数多少?65535?
nifi从入门到实战(保姆级教程)——flow
2022爱分析· 国央企数字化厂商全景报告
ThreeJS 第二篇:顶点概念、几何体结构