当前位置:网站首页>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 
边栏推荐
- Event extraction and documentation (2020-2021)
- Crazy God redis notes 09
- Quick reference manual for the strongest collation of common regular expressions (glory Collection Edition)
- Emqx simple to use
- Add.Eslinctrc.js under SRC for the general format of the project
- Learning pyramid context encoder network for high quality image painting paper notes
- Yum to see which installation package provides a command
- C primer plus learning notes - 5. Pointer
- Update C language notes
- C primer plus learning notes - 6. Arrays and pointers
猜你喜欢

Update C language notes

Several common sorts

XML schema

How to set up an internal wiki for your enterprise?

PSO and mfpso

HMS core discovery Episode 16 live broadcast preview | play AI's new "sound" state with tiger pier

Ren Xudong, chief open source liaison officer of Huawei: deeply cultivate basic software open source and jointly build the root technology of the digital world

MGRE and OSPF comprehensive experiment

Drools 开发决策表

几种常见的排序
随机推荐
un7.23:如何在linix上安装MySQL?
Dictation SC or Pb file is read-write control ensor is
What programmer is still being grabbed by the company at the age of 35? Breaking the "middle-aged crisis" of programmers
Chiitoitsu(期望dp)
It is related to the amount of work and ho. Embedded, only one 70 should be connected
HMS core discovery Episode 16 live broadcast preview | play AI's new "sound" state with tiger pier
472-82 (22, 165, 39, sword finger offer II 078, 48. Rotate image)
Context encoders: feature learning by painting paper notes
Mysq Database Constraints
智能指针、左值引用右值引用、lambda表达式
Recruitment | embedded software (MCU) Engineer
Middle aged crisis, workplace dad who dare not leave, how to face life's hesitation
Support complex T4 file systems such as model group monitoring and real-time alarm. e
This article takes you to understand C string functions and memory functions in simple terms
Image to image translation with conditional advantageous networks paper notes
支撑复杂的模型群监控、实时告警等t4 文件系统。e
Print leap years between 1000 and 2000
Pony activation tool appears cannot open file k:\oemsf solution
Heavy! The 2022 China open source development blue book was officially released
太空可再生能源的代币化