当前位置:网站首页>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
边栏推荐
- torch 网络模型转换onnx格式,并可视化
- 1. Getting to know R
- Installation and testing of open source deep learning framework plaidml
- Experience Technology Department of ant group launched the 2023rd school recruitment
- Is it really hopeless to choose electronic engineering and be discouraged?
- 测试必备:推荐一款跨平台App性能专项测试工具!
- Reasonably configure thread pool
- 存储体系概述
- JDBC interface summary
- IO流基础知识详解--文件及IO流原理
猜你喜欢

Understanding of data in memory

How to close icloud when Apple ID of Apple mobile phone forgets password and frequently jumps out to log in

API call display, detailed API of Taobao, tmall and pinduoduo commodity pages, and return of APP side original data parameters

Negative remainder problem

在 Traefik Proxy 2.5 中使用/开发私有插件(Traefik 官方博客)

负数取余问题

基于微信电子书阅读小程序毕业设计毕设作品(7)中期检查报告

5g R17 standard is frozen. What does it say?

基于微信电子书阅读小程序毕业设计毕设作品(2)小程序功能

Demand and business model innovation - demand 1 - Introduction to demand engineering
随机推荐
Jenkins各配置选项介绍原创
Business opportunities with an annual increase of 3billion - non cage eggs or a new blue ocean for export to ASEAN
Méthode de sauvegarde programmée basée sur la base de données distribuée elle - même
synchronized下的 i+=2 和 i++ i++执行结果居然不一样
【splishsplash】自定义导出器
5g R17 standard is frozen. What does it say?
用户权限和组权限
QT -- how to get the contents of selected cells in qtableview
选电子工程被劝退,真的没前景了?
Viewpoint sharing | Li Wei, an expert of Gewu titanium intelligent technology products: underlying logic and scenario practice of unstructured data platform
Shell programming regular expressions and metacharacters
JDBC接口总结
Since using low code development, the development efficiency has been increased by 10 times
什么是数据驱动
基于微信电子书阅读小程序毕业设计毕设作品(3)后台功能
Jenkins中pipeline对接CMDB接口获取主机列表的发布实践原创
Programming tool download address
2022年最新宁夏建筑安全员模拟题库及答案
基于微信电子书阅读小程序毕业设计毕设作品(6)开题答辩PPT
Continuously improve the overall performance of adaoracle Oracle Oracle