当前位置:网站首页>Common SQL commands
Common SQL commands
2022-04-23 19:09:00 【Game programming】
Catalog
First choose database
USE DatabaseName;
About table | Code |
establish table | create table xx(); |
Copy table | create table xx1 like xx; |
change table name | rename table xx to xx2; |
establish table Writing
CREATE TABLE lesson (
id int(11) NOT NULL AUTO_INCREMENT,
name varchar(32) default '',
views int(11) NOT NULL default '0',
created_at DATETIME,
PRIMARY KEY (id,name)
FOREIGN KEY () REFERENCES XX()
);
alter | code |
Delete | ALTER TABLE xx DROP COLUMN c |
increase | ALTER TABLE xx ADD COLUMN c a varchar(50) |
renamed | ALTER TABLE xx CHANGE COLUMN c C |
Change properties | ALTER TABLR xx CHANGE COLUMN c c age int() |
increase primary key | ALTER TABLE xx ADD CONSTRAINT Constraint name PRIMARY KEY |
Delete primary key | ALTER TABLE xx DROP primary key |
to tablle Add data

Query data
duplicate problem

place table/column | column Data processing | Sort | Customize table | Data attribute | |
---|---|---|---|---|---|
Code | where | avg,count | oder by(desc,asc | as | null |
in | like | some(select ...) | exist | ||
from | distinct xx/unique(select) | all(select..) | |||
with | having(group by) | group by | |||
between and |
For select Must ignore null value
distinct & unique

Choice problem

Use where


Use like

Use in To execute multi table queries


as Usage: multi table query

some & as swap


Use many = Do multi table query

order by

Set performance

avg,count

group by

having

exits

author :DendenTaytay
Game programming ️, A game development favorite ~
If the picture is not displayed for a long time , Please use Chrome Kernel browser .
版权声明
本文为[Game programming]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231906382002.html
边栏推荐
- Actual combat of Nacos as service configuration center
- 7、 DOM (Part 2) - chapter after class exercises and answers
- Esp01s with Arduino development environment
- WebView opens H5 video and displays gray background or black triangle button. Problem solved
- Is it safe to open an account in Bohai futures.
- Introduction to micro build low code zero Foundation (lesson 3)
- MySQL学习第五弹——事务及其操作特性详解
- c1000k TCP 连接上限测试1
- Modify the font size of hint in editext
- openlayers 5.0 两种居中方式
猜你喜欢
Druid SQL和Security在美团点评的实践
Download xshell 6 and xftp6 official websites
从技术体系到商业洞察,中小研发团队架构实践之收尾篇
Esp32 drive encoder -- siq-02fvs3 (vscade + IDF)
ESP32 LVGL8. 1 - msgbox message box (msgbox 28)
剑指 Offer II 116. 省份数量-空间复杂度O(n),时间复杂度O(n)
Oracle configuration st_ geometry
C: generic reflection
binlog2sql 工具安装使用及问题汇总
Client interns of a large factory share their experience face to face
随机推荐
Simple use of navigation in jetpack
MySQL restores or rolls back data through binlog
高层次人才一站式服务平台开发 人才综合服务平台系统
Tencent map and high logo removal method
Coolweather is revised and connected to the wind weather interface to realize the broken line diagram of temperature
c#:泛型反射
Redis common interview questions
Esp32 (UART receiving and sending) - receiving and sending communication of serial port (4)
RPM包管理
Simplified path (force buckle 71)
12 examples to consolidate promise Foundation
电路在线模拟
I just want to leave a note for myself
FTP, SSH Remote Access and control
mysql_ Download and installation of Linux version
Use of kotlin collaboration in the project
SSDB基础2
One stop service platform for high-level talents and development of comprehensive service platform system for talents
[play with lighthouse] Tencent cloud lightweight server builds a full platform video analysis video download website
Transaction processing of SQL Server database