当前位置:网站首页>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;
边栏推荐
- Redis cache avalanche, penetration, breakdown
- NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
- [combinatorics] generating function (positive integer splitting | repeated ordered splitting | non repeated ordered splitting | proof of the number of repeated ordered splitting schemes)
- Administrative division code acquisition
- Data analysis is popular on the Internet, and the full version of "Introduction to data science" is free to download
- Use of unsafe class
- CV in transformer learning notes (continuously updated)
- 041. (2.10) talk about manpower outsourcing
- JS_ Array_ sort
- [Tongxin UOS] scanner device management driver installation
猜你喜欢
English語法_名詞 - 分類
FBI 警告:有人利用 AI 换脸冒充他人身份进行远程面试
Mysql45 lecture learning notes (II)
AcWing 271. Teacher Yang's photographic arrangement [multidimensional DP]
[untitled]
After the festival, a large number of people change careers. Is it still time to be 30? Listen to the experience of the past people
NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
How to draw non overlapping bubble chart in MATLAB
2022-2028 global sepsis treatment drug industry research and trend analysis report
Administrative division code acquisition
随机推荐
Three gradient descent methods and code implementation
198. Looting - Dynamic Planning
This diversion
Data analysis is popular on the Internet, and the full version of "Introduction to data science" is free to download
Win32: dump file analysis of heap corruption
Read the paper glodyne global topology preserving dynamic network embedding
Closure and closure function
SQL injection -day16
Opencv learning notes (continuously updated)
Caddy server agent
Class exercises
Valentine's day, send you a little red flower~
Bidding procurement scheme management of Oracle project management system
English语法_名词 - 分类
How to draw non overlapping bubble chart in MATLAB
Redis core technology and practice - learning notes (VI) how to achieve data consistency between master and slave Libraries
2022-2028 global copper foil (thickness 12 μ M) industry research and trend analysis report
[combinatorics] generating function (generating function application scenario | using generating function to solve recursive equation)
An academic paper sharing and approval system based on PHP for computer graduation design
Should I be laid off at the age of 40? IBM is suspected of age discrimination, calling its old employees "dinosaurs" and planning to dismiss, but the employees can't refute it