当前位置:网站首页>Basic knowledge of MySQL database
Basic knowledge of MySQL database
2022-07-24 05:09:00 【terrific51】
This note is mainly a summary mysql Database Basics
What we need to master mainly includes information ——> Draw ER chart ——> from ER Figure creating a database table (sql sentence )
1. conceptual model -ER chart 
Change picture to 
2. use sql sentence ( Realize operations such as adding, deleting, checking and rebuilding )
(1) build 
CREATE TABLE `wy`.`student` (
`Sno` VARCHAR(45) NOT NULL,
`Sname` VARCHAR(5) NOT NULL,
`Ssex` VARCHAR(2) NOT NULL,
`Sage` VARCHAR(3) NOT NULL,
`Sdept` VARCHAR(45) NOT NULL,
PRIMARY KEY (`Sno`));
INSERT INTO `wy`.`student` (`Sno`, `Sname`, `Ssex`, `Sage`, `Sdept`) VALUES ('200215121', ' Li Yong ', ' male ', '20', 'CS');
INSERT INTO `wy`.`student` (`Sno`, `Sname`, `Ssex`, `Sage`, `Sdept`) VALUES ('200215122', ' Liu Chen ', ' Woman ', '19', 'CS');
INSERT INTO `wy`.`student` (`Sno`, `Sname`, `Ssex`, `Sage`, `Sdept`) VALUES ('200215123', ' Wang min. ', ' Woman ', '18', 'MA');
INSERT INTO `wy`.`student` (`Sno`, `Sname`, `Ssex`, `Sage`, `Sdept`) VALUES ('200515125', ' Zhang Li ', ' male ', '19', 'IS');
The table is as follows :
(2) increase
INSERT INTO ‘wy’.‘student’ (‘Sno’, ‘Sname’, ‘Ssex’, ‘Sage’, ‘Sdept’) VALUES (‘200215126’, ‘ Zhang Chengmin ’, ‘ male ’, ‘18’, ‘CS’);
(3) Delete

- Delete row
DELETE FROM ‘wy’.‘student’ WHERE (‘Sno’ = ‘200515125’); - Delete table
DROP TABLE Student CASCADE;
(4) Change 
UPDATE ‘wy’.‘class’ SET ‘Cdept’ = ‘ School of computer and information engineering ’ WHERE (‘Cid’ = ‘06’);
(5) check
SELECT * FROM wy.class;
ER Figure example 
边栏推荐
- Using a* heuristic search to solve maze routing problem
- [advanced mathematics] the difference between differentiable and differentiable functions
- Add.Eslinctrc.js under SRC for the general format of the project
- FRP intranet penetration service usage
- Unable to delete the file prompt the solution that the file cannot be deleted because the specified file cannot be found
- 太空可再生能源的代币化
- XML schema
- )的低字节来反馈给应用层或者成多种格式文档:
- HCIA NAT experiment
- Chapter 1 regression, classification & clustering
猜你喜欢

MapReduce介绍

What programmer is still being grabbed by the company at the age of 35? Breaking the "middle-aged crisis" of programmers

Event extraction and documentation (2019)

MGRE and OSPF comprehensive experiment

Activation functions and the 10 most commonly used activation functions

Smart pointer, lvalue reference, lvalue reference, lambda expression
![[postgraduate entrance examination vocabulary training camp] day 10 - capital, expand, force, adapt, depand](/img/9a/a218c46806cf286f0518a72809e084.png)
[postgraduate entrance examination vocabulary training camp] day 10 - capital, expand, force, adapt, depand

The x-fkgom supporting the GOM engine key.lic is authorized to start
![Codeforce:d2. remove the substring (hard version) [greedy string + subsequence]](/img/c1/320e0349e2edda0eb420ed018aa831.png)
Codeforce:d2. remove the substring (hard version) [greedy string + subsequence]

Drools 开发决策表
随机推荐
Middle aged crisis, workplace dad who dare not leave, how to face life's hesitation
浅谈不可转让的声誉积分NFT SBTs面临的困境
本,降低线上要度是一样的。发现异常实例cp操
C primer plus learning notes - 6. Arrays and pointers
un7.23:如何在linix上安装MySQL?
MySQL transaction and its problems and isolation level
Memorandum 2022
Chapter 9 using image data
Pony activation tool appears cannot open file k:\oemsf solution
Use of fiddler packet capturing tool
Kingbase V8R6集群安装部署案例---脚本在线一键扩容
How to do if the right-click attribute of the network neighbor cannot be opened? The solution of the right-click attribute of the network neighbor cannot be opened
Two methods of modifying configuration files in PHP
How can e-commerce projects solve the over issuance of online coupons (troubleshooting + Solutions) (glory Collection)
Want to know how a C program is compiled—— Show you the compilation of the program
明星逆市入局的NFT,如何能走出独立行情?
There is not enough space on the disk to complete this operation when partitioning the computer
Recruitment | embedded software (MCU) Engineer
The world's first large aerospace model came out. Wenxin's second supplement "Fuchun Mountain Residence map" is Baidu Pratt Whitney AI's perseverance
Sword finger offer special assault edition day 7