当前位置:网站首页>Database creation, addition, deletion, modification and query
Database creation, addition, deletion, modification and query
2022-07-03 18:35:00 【It is small new】
The database is easy to operate
// View version number
select version();
// View all local databases
show databases;
// Write what you check
select ‘xxxx’;
// Switch database
use test;
// Look at all the tables
show tables;
// sign out
Exit
Select Inquire about
Insert insert data
Update Update data
Delete Delete data
Drop Delete table
Create Create table
SQL classification :
DCL Data control language (Data Control Language)
Represent keyword :grant,revoke.
DDL Data definition language (Data Definition Language)
Represent keyword :create ,drop,
DML Data operation language (Data Manipulation Language)
Represent keyword :insert,delete,update
DQL Data query language (Data Query Language)
Represent keyword :select
TCL Transaction control language (Transactional Control Language)
Represent keyword :commit ,rollback;
Create database
grammar :create table Table name (
Name type ,
Name type ,
);
CREATE TABLE `student_info1` (
`student_name` varchar(255) DEFAULT NULL,
`student_age` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE if not exists `student_info` (
`student_name` varchar(255) DEFAULT NULL,
`student_age` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `student_info3` (
`student_name` varchar(255) DEFAULT NULL,
`student_age` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Insert
grammar
insert into Table name ( Name 1, Name 2) values ( value 1, value 2);
insert into student_info (student_name,student_age) values (' Two dogs ',23);
Update
grammar
update Table name set Name 1= value , Name 2= value where Name = value ;
update student_info set student_age=66 where student_name=' Two dogs ';
Delete
grammar
delete from Table name where Name = value ;
delete from student_info where student_name=' Two dogs ';
select:
grammar
select Column qualification from Table limit where Row qualification
select student_name from student_info where student_age=23;
select * from student_info;
边栏推荐
- [combinatorics] generating function (generating function application scenario | using generating function to solve recursive equation)
- How to disable the clear button of ie10 insert text box- How can I disable the clear button that IE10 inserts into textboxes?
- PHP MySQL order by keyword
- Recent learning experience
- [combinatorics] generating function (commutative property | derivative property | integral property)
- Xception for deeplab v3+ (including super detailed code comments and original drawing of the paper)
- 统计图像中各像素值的数量
- 多媒体NFT聚合平台OKALEIDO即将上线,全新的NFT时代或将来临
- [combinatorics] generating function (property summary | important generating function)*
- 图像24位深度转8位深度
猜你喜欢
[Godot] add menu button
2022-2028 global physiotherapy clinic industry research and trend analysis report
English語法_名詞 - 分類
Module 9 operation
Class exercises
English语法_名词 - 分类
The number of incremental paths in the grid graph [dfs reverse path + memory dfs]
Gao Qing, Beijing University of Aeronautics and Astronautics: CIM is a natural quantum computing platform for graph data processing
How do microservices aggregate API documents? This wave of operation is too good
What problems can cross-border e-commerce sellers solve with multi platform ERP management system
随机推荐
Torch learning notes (4) -- torch's dynamic calculation diagram
Torch learning notes (5) -- autograd
Redis core technology and practice - learning notes (VI) how to achieve data consistency between master and slave Libraries
Ping problem between virtual machine and development board
圖像24比特深度轉8比特深度
AcWing 271. Teacher Yang's photographic arrangement [multidimensional DP]
English grammar_ Noun classification
What is SQL get connection
12、 Service management
2022-2028 global scar care product industry research and trend analysis report
2022-2028 global aircraft head up display (HUD) industry research and trend analysis report
Image 24 bit depth to 8 bit depth
Enterprise custom form engine solution (12) -- form rule engine 2
Naoqi robot summary 27
PHP determines which constellation it belongs to today
042. (2.11) do it when it's time to do it
Caddy server agent
Unsafe类的使用
[linux]centos 7 reports an error when installing MySQL "no package MySQL server available" no package ZABBIX server MySQL available
[Godot] add menu button