当前位置:网站首页>MySQL Basics
MySQL Basics
2022-06-12 19:50:00 【WD Technology】
Database creation 、 Delete
CREATE DATABASE test
DROP DATABASE test;
The creation of a table
CREATE TABLE < Table name >(
< List name 1> < data type > < The constraints required by this column >
< List name 2> < data type > < The constraints required by this column >
< List name 3> < data type > < The constraints required by this column >
……
PRIMARY KEY < List name 1, List name 2……> – Set a column or columns as the primary key as required
);
Deleting and updating tables 、 Modify the name of the table , Change column names
The deletion of the table is implemented in code as follows
DROP TABLE < List name >;
Add a column to the table and code it as follows :
ALTER TABLE < Table name > ADD COLUMN < Name , data type , constraint condition >;
Delete a column of code in the table to achieve the following :
ALTER TABLE < Table name > DROP COLUMN < Name >;
Modify table name code :
ALTER TABLE < The old name of the table > rename AS < The new name of the table >
Modify column name code :
ALTER TABLE < Table name > change < Old column names 1> < New column names 1> < data type > < constraint condition >,
change < Old column names 2> < New column names 2> < data type > < constraint condition >,
……;
Data insertion 、 Delete and update
Insert
INSERT INTO < Table name > ( Name 1, Name 2,… )
VALUES( The number 1, The number 2,… );
SQL Three points should be paid attention to in the writing rules of :
SQL All statements are based on ; ending
SQL Statements are case insensitive for keywords
The input symbols must all be English symbols
Add :
https://www.cnblogs.com/vuciao/p/10586773.html
边栏推荐
- [observation] Huawei's next generation data center "adds momentum" to Guangxi's low-carbon and high-quality development
- The joint empowerment plan of Baidu PaddlePaddle large enterprise open innovation center was launched! Help Pudong to upgrade its industry intelligently
- Axure RP 9 for Mac(交互式产品原型设计工具)中文版
- Original introduction to Jenkins' configuration options
- 【GAMES101】课堂笔记8–着色(着色频率、图形管线、纹理映射)
- 2022年最新宁夏建筑安全员模拟题库及答案
- 基于微信电子书阅读小程序毕业设计毕设作品(1)开发概要
- Méthode de sauvegarde programmée basée sur la base de données distribuée elle - même
- 选电子工程被劝退,真的没前景了?
- 94. analyze the content in the web page
猜你喜欢
Wechat e-book reading applet graduation design completion works (3) background function
Microsoft Word tutorial, how to insert page numbers and table of contents in word?
Overview of object detection
Compilation of programs
How mysterious is "PIP not an internal or external command, nor a runnable program or batch file"
Process accounting, process time, daemon
Interpreter Files
基於分布式數據庫本身的定時備份方法
system()
Implementation of exec function and shell
随机推荐
2022年最新宁夏建筑安全员模拟题库及答案
Using / developing private plug-ins in traifik proxy 2.5 (traifik official blog)
What did 3GPP ran do in the first F2F meeting?
Jenkins各配置选项介绍原创
Wechat e-book reading applet graduation design work (6) opening defense ppt
Demand and business model innovation - demand 2- demand basis
SPI one master and many slaves
简单理解防抖函数
The execution results of i+=2 and i++ i++ under synchronized are different
Original introduction to Jenkins' configuration options
Download and configuration of nuitka packaging tutorial
What is disk IO?
Axure RP 9 for Mac(交互式产品原型设计工具)中文版
BigTable (II): how BigTable achieves scalability and high performance
2 R programming
[notes for question brushing] line segment tree
Implementation of exec function and shell
2022年,中国大学生最多的20个城市
What are meta-inf and WEB-INF respectively?
设备管理-借还模块1