当前位置:网站首页>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 
边栏推荐
- How to set up an internal wiki for your enterprise?
- XML schema
- 2. Input a circle radius r, when r > = 0, calculate and output the area and perimeter of the circle, otherwise, output the prompt information.
- Why can't I log on my baidu account? Introduction to the solution of baidu account unable to log in
- [Huang ah code] Introduction to MySQL - 3. I use select *, and the boss directly rushed me home by train, but I still bought a station ticket
- Learning pyramid context encoder network for high quality image painting paper notes
- Mysq Database Constraints
- Chapter V communication training
- Use of fiddler packet capturing tool
- What if IPv4 has no internet access? Solutions to IPv4 without internet access rights (detailed explanation of pictures and texts)
猜你喜欢

Chapter VI more supervision training

Quick reference manual for the strongest collation of common regular expressions (glory Collection Edition)

HCIA NAT experiment

C primer plus learning notes - 6. Arrays and pointers

Chapter 7 other neural network types

Globally and locally consistent image completion paper notes

MapReduce介绍
![[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

Jiang Xingqun, senior vice president of BOE: aiot technology enables enterprise IOT transformation

微信朋友圈的高性能架构设计
随机推荐
2. Input a circle radius r, when r > = 0, calculate and output the area and perimeter of the circle, otherwise, output the prompt information.
Hcip-- review the homework for the next day
GOM engine starts M2 prompt: [x-fkgom] has been loaded successfully. What should I do if it gets stuck?
472-82 (22, 165, 39, sword finger offer II 078, 48. Rotate image)
Drools 开发决策表
浅谈不可转让的声誉积分NFT SBTs面临的困境
Kingbase v8r6 cluster installation and deployment case - script online one click expansion
Chapter VI more supervision training
Context encoders: feature learning by painting paper notes
Codeforce:d2. remove the substring (hard version) [greedy string + subsequence]
Smart pointer, lvalue reference, lvalue reference, lambda expression
Activation functions and the 10 most commonly used activation functions
Technical team: improve team effectiveness, starting from never doing three things
Hcde city closed door meeting successfully held in Nanjing station
HMS core discovery Episode 16 live broadcast preview | play AI's new "sound" state with tiger pier
Emqx simple to use
Sword finger offer special assault edition day 7
Binary SCA fingerprint extraction black Technology: go language Reverse Technology
C primer plus learning notes - 5. Pointer
几种常见的排序