当前位置:网站首页>2. MySQL data management - DML (add, modify, delete data)
2. MySQL data management - DML (add, modify, delete data)
2022-07-23 11:54:00 【Piglet vs Hengge】
Catalog
01、DML( Data operation language )
Example 1: towards user Table add data
Example 2: towards student Table add data
Example 3: towards subject Table add data
Example 4: Create student table 、 The curriculum 、 Teachers list 、 Grade sheet and insert data
Example 5: towards emp Table add data
Example 6: Create database 、 Data sheet , And insert data into the table
Example 7: modify emp1 The data in the table
Example 8: Change the student number (StudentNo) by 1013 Student records of
Example 9: Modification example 3 Medium subject Table data
Example 10: Delete example 3 Medium subject Table data
4.DDL( Data definition language ) and DML( Data operation language ) Comprehensive case
Example 11: Create an employee table , And modify the table information and the data in the table
01、DML( Data operation language )
DML( Data operation language ): Used to manipulate data contained in database objects
Include
INSERT ( Add data statement )
UPDATE ( Update data statement )
DELETE ( Delete data statement )
1、 Add data (insert)
grammar :insert into Table name ( Field 1, Field 2, Field 3, … )values(' value 1', ' value 2', ' value 3',…);
Example 1: towards user Table add data
CREATE TABLE IF NOT EXISTS `user`( `userId` INT(10) PRIMARY KEY, `userName` VARCHAR(20) NOT NULL, `userGender` VARCHAR(1) NOT NULL, `money` DECIMAL(3,2) ); # Use insert Statement to user Add data to the table # grammar :insert into Table name ( Field 1, Field 2, Field 3, … )values(' value 1', ' value 2', ' value 3',…); INSERT INTO `user` (userId,userName,userGender,money)VALUES(1001,'zhangsan',' male ',2.55) INSERT INTO USER VALUES(1002,'lisi',' male ',2.88)give the result as follows :
Example 2: towards student Table add data
(1) Create... As shown in the following table MySQL Realization :
(2) Code :
# Create database myschool CREATE DATABASE myschool; # Using a database myschool USE myschool; # add to student Table data CREATE TABLE `student`( ` Student number ` INT(10), ` full name ` VARCHAR(20) NOT NULL, ` Gender ` VARCHAR(1) DEFAULT ' male ' NOT NULL, ` grade ` INT(10) NOT NULL, ` cell-phone number ` VARCHAR(20) NOT NULL, ` Address ` VARCHAR(20) NOT NULL, ` mailbox ` VARCHAR(20) NOT NULL, ` Id card ` VARCHAR(20) NOT NULL, PRIMARY KEY(` Student number `,` Id card `) ); DROP TABLE student INSERT INTO student VALUES(1011,' Guo Jing ',' male ',1,'13500000001',' Zhongguancun Street, Haidian District, Beijing 1 Number ','[email protected]',450323198612111000) INSERT INTO student VALUES(1012,' Li Wencai ',' male ',2,'13500000002',' Luoyang, Henan ','[email protected]','450323198112311000') INSERT INTO student VALUES(1013,' Li Mei ',' Woman ',3,'13500000015',' Luwan District, Shanghai ','[email protected]','450323198612311000')(3) Output results :
Example 3: towards subject Table add data
(1) Create... As shown in the following table MySQL Realization :
() Code :
# practice 1: Add data CREATE TABLE `subject`( `SubjectNo` INT(10) NOT NULL COMMENT ' Course number ', `SubjectName` VARCHAR(50) NOT NULL COMMENT ' Course name ', `ClassHour` VARCHAR(10) NOT NULL COMMENT ' Class hours ', `GreadID` INT(10) NOT NULL COMMENT ' Grade number ', PRIMARY KEY(`SubjectNo`) ) # Use insert Statement to user Add data to the table # grammar :insert into Table name ( Field 1, Field 2, Field 3, … )values(' value 1', ' value 2', ' value 3',…); INSERT INTO SUBJECT VALUES(1,' Advanced mathematics -1','120',1) INSERT INTO SUBJECT VALUES(2,' Advanced mathematics -2','110',2) INSERT INTO SUBJECT VALUES(3,' Advanced mathematics -3','100',3) INSERT INTO SUBJECT VALUES(4,' Advanced mathematics -4','130',4)Output results :
Example 4: Create student table 、 The curriculum 、 Teachers list 、 Grade sheet and insert data
(1) Create... As shown in the following table MySQL Realization
(2) Code :
# Student list CREATE TABLE `student` ( `s_id` VARCHAR(20), `s_name` VARCHAR(20) NOT NULL DEFAULT '', `s_birth` VARCHAR(20) NOT NULL DEFAULT '', `s_sex` VARCHAR(10) NOT NULL DEFAULT '', PRIMARY KEY (`s_id`) ); # The curriculum CREATE TABLE `Course`( `c_id` VARCHAR(20), `c_name` VARCHAR(20) NOT NULL DEFAULT '', `t_id` VARCHAR(20) NOT NULL, PRIMARY KEY(`c_id`) ); # Teachers list CREATE TABLE `Teacher`( `t_id` VARCHAR(20), `t_name`VARCHAR(20) NOT NULL DEFAULT '', PRIMARY KEY(`t_id`) ); # League tables CREATE TABLE `Score`( `s_id` VARCHAR(20), `c_id` VARCHAR(20), `s_score` INT(3), PRIMARY KEY(`s_id`,`c_id`) ); # Insert student table test data INSERT INTO student VALUES('01',' Zhao Lei ','1990-01-01',' male '); INSERT INTO student VALUES('02',' Qian Dian ','1990-12-21',' male '); INSERT INTO student VALUES('03',' Sun Feng ','1990-05-20',' male '); INSERT INTO student VALUES('04',' Li Yun ','1990-08-06',' male '); INSERT INTO student VALUES('05',' Zhou Mei ','1991-12-01',' Woman '); INSERT INTO student VALUES('06',' Wu Lan ','1992-03-01',' Woman '); INSERT INTO student VALUES('07',' Zheng Zhu ','1989-07-01',' Woman '); INSERT INTO student VALUES('08',' Wangju ','1990-01-20',' Woman '); # Curriculum test data INSERT INTO Course VALUES ('01',' Chinese language and literature ','02'); INSERT INTO Course VALUES ('02',' mathematics ','01'); INSERT INTO Course VALUES ('03',' English ','03'); # Teacher table test data INSERT INTO Teacher VALUES ('01',' Zhang San '); INSERT INTO Teacher VALUES ('02',' Li Si '); INSERT INTO Teacher VALUES ('03',' Wang Wu '); # Score sheet test data INSERT INTO Score VALUES ('01','01',80); INSERT INTO Score VALUES ('01','02',90); INSERT INTO Score VALUES ('01','03',99); INSERT INTO Score VALUES ('02','01',70); INSERT INTO Score VALUES ('02','02',60); INSERT INTO Score VALUES ('02','03',80); INSERT INTO Score VALUES ('03','01',80); INSERT INTO Score VALUES ('03','02',80); INSERT INTO Score VALUES ('03','03',80); INSERT INTO Score VALUES ('04','01',50); INSERT INTO Score VALUES ('04','02',30); INSERT INTO Score VALUES ('04','03',20); INSERT INTO Score VALUES ('05','01',76); INSERT INTO Score VALUES ('05','02',87); INSERT INTO Score VALUES ('06','01',31); INSERT INTO Score VALUES ('06','03',34); INSERT INTO Score VALUES ('07','02',89); INSERT INTO Score VALUES ('07','03',98);(3) Output results
student surface :
course surface :
teacher surface :
score surface :
Example 5: towards emp Table add data
(1) Create... As shown in the following table MySQL Realization
(2) Code :
# establish emp surface CREATE TABLE emp( `id` INT(10) NOT NULL COMMENT 'ID', `name` VARCHAR(100) NOT NULL COMMENT ' full name ', `gender` VARCHAR(10) DEFAULT ' male ' NOT NULL COMMENT ' Gender ', `birthday` DATE COMMENT ' Date of birth ', `salary` FLOAT(10,2) COMMENT ' salary ', `entry_date` DATE COMMENT ' Starting time ', `resume` TEXT COMMENT ' resume ', PRIMARY KEY(`id`) ); # Use insert Statement to user Add data to the table # grammar :insert into Table name ( Field 1, Field 2, Field 3, … )values(' value 1', ' value 2', ' value 3',…); INSERT INTO emp(id,NAME,gender,birthday,salary,entry_date,RESUME) VALUES(1,'zhangsan','female','1990-5-10',10000,'2015-5-5','good girl') INSERT INTO emp(id,NAME,gender,birthday,salary,entry_date,RESUME) VALUES(2,'lisi','male','1995-5-10',10000,'2015-5-5','good boy') INSERT INTO emp(id,NAME,gender,birthday,salary,entry_date,RESUME) VALUES(3,'wangwu','male','1995-5-10',10000,'2015-5-5','good boy')(3) Output results
Example 6: Create database 、 Data sheet , And insert data into the table
(1) Code :
# Create database examination CREATE DATABASE IF NOT EXISTS `examination`; # Using a database examination USE examination; # Create a student information table CREATE TABLE IF NOT EXISTS `student`( `sno` VARCHAR(20) NOT NULL PRIMARY KEY COMMENT ' Student number ', `sname` VARCHAR(20) NOT NULL COMMENT ' full name ', `ssex` VARCHAR(20) NOT NULL COMMENT ' Gender ', `sbirthday` DATETIME COMMENT ' Date of birth ', `class` VARCHAR(20) COMMENT ' class ' ); # Create a teacher information table teacher CREATE TABLE IF NOT EXISTS `teacher`( `tno` VARCHAR(20) NOT NULL PRIMARY KEY COMMENT ' Teacher number ', `tname` VARCHAR(20) NOT NULL COMMENT ' full name ', `tsex` VARCHAR(20) NOT NULL COMMENT ' Gender ', `tbirthday` DATETIME COMMENT ' Date of birth ', `prof` VARCHAR(20) COMMENT ' The title ', `depart` VARCHAR(20) NOT NULL COMMENT ' section and department ' ) # Create a curriculum CREATE TABLE IF NOT EXISTS `course`( `cno` VARCHAR(20) NOT NULL PRIMARY KEY COMMENT ' Course number ', `cname` VARCHAR(20) NOT NULL COMMENT ' Course name ', `tno` VARCHAR(20) NOT NULL COMMENT ' Teacher's teaching number ', CONSTRAINT fk_course_tno FOREIGN KEY(`tno`) REFERENCES `teacher`(`tno`) ); # Create a score sheet score CREATE TABLE IF NOT EXISTS `score`( `sno` VARCHAR(20) NOT NULL COMMENT ' Student student id ', `cno` VARCHAR(20) NOT NULL COMMENT ' Course number ', `degree` NUMERIC(4,1) COMMENT ' achievement ', CONSTRAINT fk_score_sno FOREIGN KEY (`sno`) REFERENCES `student`(`sno`), CONSTRAINT fk_score_cno FOREIGN KEY (`cno`) REFERENCES `course`(`cno`) ); # To the students student Table add data # Use insert Statement to user Add data to the table # grammar :insert into Table name ( Field 1, Field 2, Field 3, … )values(' value 1', ' value 2', ' value 3',…); INSERT INTO student(sno,sname,ssex,sbirthday,class)VALUES(108,' Zeng Hua ',' male ','1977-09-01','95033'); INSERT INTO student(sno,sname,ssex,sbirthday,class)VALUES(105,' Kuang Ming ',' male ','1975-10-02','95031'); INSERT INTO student(sno,sname,ssex,sbirthday,class)VALUES(107,' Wang Li ',' Woman ','1976-01-23','95033'); INSERT INTO student(sno,sname,ssex,sbirthday,class)VALUES(101,' Li Jun ',' male ','1976-02-20','95033'); INSERT INTO student(sno,sname,ssex,sbirthday,class)VALUES(109,' Wang Fang ',' Woman ','1975-02-20','95031'); INSERT INTO student(sno,sname,ssex,sbirthday,class)VALUES(103,' Lu Jun ',' male ','1974-06-03','95031'); # Information to teachers teacher Table add data INSERT INTO teacher(tno,tname,tsex,tbirthday,prof,depart)VALUES(804,' Li Cheng ',' male ','1958-12-02',' associate professor ',' Department of Computer Science '); INSERT INTO teacher(tno,tname,tsex,tbirthday,prof,depart)VALUES(856,' Zhang Xu ',' male ','1969-03-12',' lecturer ',' Department of electronic engineering '); INSERT INTO teacher(tno,tname,tsex,tbirthday,prof,depart)VALUES(825,' Wang Ping ',' Woman ','1972-05-05',' Assistant ',' Department of Computer Science '); INSERT INTO teacher(tno,tname,tsex,tbirthday,prof,depart)VALUES(831,' Liu Bing ',' Woman ','1977-08-14',' Assistant ',' Department of electronic engineering '); # To the course course Table add data INSERT INTO course(cno,cname,tno)VALUES('3-105',' Introduction to computer ',825); INSERT INTO course(cno,cname,tno)VALUES('3-245',' operating system ',804); INSERT INTO course(cno,cname,tno)VALUES('6-166',' digital circuit ',856); INSERT INTO course(cno,cname,tno)VALUES('9-888',' Advanced mathematics ',831); # To the result score Table add data INSERT INTO score(sno,cno,degree)VALUES(103,'3-245',86); INSERT INTO score(sno,cno,degree)VALUES(105,'3-245',75); INSERT INTO score(sno,cno,degree)VALUES(109,'3-245',68); INSERT INTO score(sno,cno,degree)VALUES(103,'3-105',92); INSERT INTO score(sno,cno,degree)VALUES(105,'3-105',88); INSERT INTO score(sno,cno,degree)VALUES(109,'3-105',76); INSERT INTO score(sno,cno,degree)VALUES(101,'3-105',64); INSERT INTO score(sno,cno,degree)VALUES(107,'3-105',91); INSERT INTO score(sno,cno,degree)VALUES(108,'3-105',78); INSERT INTO score(sno,cno,degree)VALUES(101,'6-166',85); INSERT INTO score(sno,cno,degree)VALUES(107,'6-166',79); INSERT INTO score(sno,cno,degree)VALUES(108,'6-166',81);(2) Output results
student surface :
teacher surface :
course surface :
score surface :
2、 Modifying data (update)
grammar :update Table name set [ Field name 1= The new data 1, Field name 2= The new data 2,...][where condition]
where Conditional clause : Conditionally filter data from the table
where Operator in :
surface Operator Operator meaning Example result = be equal to 5=6 false <> or != It's not equal to 5!=6 true > Greater than 5>6 false < Less than 5<6 true >= Greater than or equal to 5>=6 false <= Less than or equal to 5<=6 true between In a certain range BETWEEN 5 AND 10 - AND also 5>1 AND 1>2 false OR or 5>1 OR 1>2 true
Example 7: modify emp1 The data in the table
(1) establish emp1 surface , Parallel table emp1 insert data
(2) After inserting data , Modify the data :
# establish emp1 surface CREATE TABLE emp1( `id` INT(10) NOT NULL COMMENT 'ID', `name` VARCHAR(100) NOT NULL COMMENT ' full name ', `gender` VARCHAR(10) DEFAULT ' male ' NOT NULL COMMENT ' Gender ', `birthday` DATE COMMENT ' Date of birth ', `salary` FLOAT(10,2) COMMENT ' salary ', `entry_date` DATE COMMENT ' Starting time ', `resume` TEXT COMMENT ' resume ', PRIMARY KEY(`id`) ); #------------------------------------------------------------------------------------------ # Use insert Statement to user Add data to the table # grammar :insert into Table name ( Field 1, Field 2, Field 3, … )values(' value 1', ' value 2', ' value 3',…); INSERT INTO emp1(id,NAME,gender,birthday,salary,entry_date,RESUME) VALUES(1,'zhangsan','female','1990-5-10',10000,'2015-5-5','good girl') INSERT INTO emp1(id,NAME,gender,birthday,salary,entry_date,RESUME) VALUES(2,'lisi','male','1995-5-10',10000,'2015-5-5','good boy') INSERT INTO emp1(id,NAME,gender,birthday,salary,entry_date,RESUME) VALUES(3,'wangwu','male','1995-5-10',10000,'2015-5-5','good boy') #------------------------------------------------------------------------------------------ # Modify the data in the table # grammar :update Table name set Field name 1= The new data 1, Field name 2= The new data 2,...where.... # Change all employee salaries to 5000 element UPDATE emp1 SET salary=5000 # Name is “zhangsan” The salary of the employee is revised to 3000 UPDATE emp1 SET salary = 3000 WHERE `name`='zhangsan'; # Name is “lisi” The salary of the employee is revised to 4000 element ,gender Change it to female UPDATE emp1 SET salary=4000,gender='female' WHERE `name`='lisi'; # take wangwu My salary is increased on the original basis 1000 element UPDATE emp1 SET salary=salary+1000 WHERE `name`='wangwu';(3) Output results
① Change all employee salaries to 5000 element
② Name is “zhangsan” The salary of the employee is revised to 3000
③ Name is “lisi” The salary of the employee is revised to 4000 element ,gender Change it to female
④ take wangwu My salary is increased on the original basis 1000 element
Example 8: Change the student number (StudentNo) by 1013 Student records of
modify student Table data
Use update Statement modification student Table data
Change the student number (StudentNo) by 1013 Student records of
(1) Change the email address to [email protected]
(2) cell-phone number (phone) It is amended as follows 000000(1) Create database 、 Data sheet , And insert the data as follows :
(2) Use update Statement modification student Table data :
(3) Output results
① Matrikl-Nr (StudentNo) by 1013 The student email of is modified to [email protected]
② Matrikl-Nr (StudentNo) by 1013 Student mobile number (phone) It is amended as follows 000000
Example 9: Modification example 3 Medium subject Table data
Requirement specification :
Put the data sheet subject in ClassHour Greater than 110 And GradeID by 1 Class hours are reduced 10
(1) Example 3 Created subject The table is shown below :
(2) Put the data sheet subject in ClassHour Greater than 110 And GradeID by 1 Class hours are reduced 10
# practice 1: Add data CREATE TABLE `subject`( `SubjectNo` INT(10) NOT NULL COMMENT ' Course number ', `SubjectName` VARCHAR(50) NOT NULL COMMENT ' Course name ', `ClassHour` VARCHAR(10) NOT NULL COMMENT ' Class hours ', `GreadID` INT(10) NOT NULL COMMENT ' Grade number ', PRIMARY KEY(`SubjectNo`) ); # Use insert Statement to user Add data to the table # grammar :insert into Table name ( Field 1, Field 2, Field 3, … )values(' value 1', ' value 2', ' value 3',…); INSERT INTO SUBJECT VALUES(1,' Advanced mathematics -1','120',1); INSERT INTO SUBJECT VALUES(2,' Advanced mathematics -2','110',2); INSERT INTO SUBJECT VALUES(3,' Advanced mathematics -3','100',3); INSERT INTO SUBJECT VALUES(4,' Advanced mathematics -4','130',4); # grammar :update Table name set Field name 1= The new data 1, Field name 2= The new data 2,...where.... # Put the data sheet subject in ClassHour Greater than 110 And GradeID by 1 Class hours are reduced 10 UPDATE SUBJECT SET classHour=classHour-10 WHERE classHour>110 AND GreadID=1;(3) Output results :
3、 Delete data (delete)
grammar :delete from Table name [where condition]
condition Filter by , If not specified, delete all data of the table
Example 10: Delete example 3 Medium subject Table data
(1) Example 3 Created subject The table is shown below :
(2) Code :
# Use delete Statement delete data # grammar :delete from Table name [where condition] #------------------------------------------------------- # Create table CREATE TABLE `subject1`( `SubjectNo` INT(10) NOT NULL COMMENT ' Course number ', `SubjectName` VARCHAR(50) NOT NULL COMMENT ' Course name ', `ClassHour` VARCHAR(10) NOT NULL COMMENT ' Class hours ', `GreadID` INT(10) NOT NULL COMMENT ' Grade number ', PRIMARY KEY(`SubjectNo`) ); #------------------------------------------------------- # Use insert Statement to user Add data to the table # grammar :insert into Table name ( Field 1, Field 2, Field 3, … )values(' value 1', ' value 2', ' value 3',…); INSERT INTO SUBJECT1 VALUES(1,' Advanced mathematics -1','120',1); INSERT INTO SUBJECt1 VALUES(2,' Advanced mathematics -2','110',2); INSERT INTO SUBJECT1 VALUES(3,' Advanced mathematics -3','100',3); INSERT INTO SUBJECT1 VALUES(4,' Advanced mathematics -4','130',4); #------------------------------------------------------- # Use delete Statement delete data # grammar :delete from Table name [where condition] #(1)condition Filter by , If not specified, delete all data of the table DELETE FROM subject1; #(2) Delete subject1 In the table GreadID Greater than 2 The data of DELETE FROM subject1 WHERE GreadID>2;(3) Output results
①condition Filter by , If not specified, delete all data of the table
② Delete subject1 In the table GreadID Greater than 2 The data of
4.DDL( Data definition language ) and DML( Data operation language ) Comprehensive case
Example 11: Create an employee table , And modify the table information and the data in the table
(1) subject :
1. Create an employee table
Field attribute id plastic (int) name character string (varchar)( The length is 20) gender character string ( The length is 2) birthday Date type (date) character string ( The length is 10) remark character string ( The length is 50) 2. Revise the table exercise
2.1 Add age Column
2.2 modify email The column length is 50
2.3 Delete remark Column
2.4 Name name It is amended as follows username
3. Practice adding, deleting and modifying data on the employee table
3.1 Add data
3.2 Modifying data : take id by 4 Of that line username Change it to “ Frisa ”
3.3 Delete data : Delete age by 2000 That line
3.4 Modifying data : take id by 4 Of that line age Set to 250
3.5 Modifying data : take id by 5 Of that line username Change it to “ The Monkey King ”, Change the age to 26
(2) The code is as follows :
#1. Create an employee table workers DROP TABLE workers; CREATE TABLE `workers`( `id` INT(10) PRIMARY KEY AUTO_INCREMENT, `name` VARCHAR(20) NOT NULL, `gender` VARCHAR(2) NOT NULL, `birthday` DATE NOT NULL, `email` VARCHAR(10) NOT NULL, `remark` VARCHAR(50) NOT NULL ) #------------------------------------------------------ #2. Modify table information #2.1 Add age Column # grammar :ALTER TABLE Table name ADD Field name Column type [ attribute ] ALTER TABLE workers ADD age INT(100) NULL; #2.2 modify email The column length is 50 /* grammar : Both can be used , Often use the second *(1)ALTER TABLE Table name MODIFY Field name Column type [ attribute ] *(2)ALTER TABLE Table name CHANGE Old field name new field name Column type [ attribute ] */ #ALTER TABLE workers MODIFY email varchar(50); ALTER TABLE workers CHANGE email email VARCHAR(50); #2.3 Delete remark Column # grammar :ALTER TABLE Table name DROP Field name ALTER TABLE workers DROP remark; #2.4 Name name It is amended as follows username # grammar :ALTER TABLE Table name CHANGE Old field name new field name Column type [ attribute ] ALTER TABLE workers CHANGE NAME username VARCHAR(20); #------------------------------------------------------- #3. Practice adding, deleting and modifying data on the employee table #3.1 Add data INSERT INTO workers VALUES(1,' Zhang Sanfeng ',' male ','1367-10-21','[email protected]',102); INSERT INTO workers VALUES(2,' dharma ',' male ','1227-4-15','[email protected]',54); INSERT INTO workers VALUES(3,' Mei Chaofeng ',' Woman ','1547-6-1','[email protected]',44); INSERT INTO workers VALUES(4,' Trisomy ',' Unknown ','3012-8-15','[email protected]',2000); INSERT INTO workers VALUES(5,' Super Saia ',' male ','1985-2-3','[email protected]',25); #3.2 Modifying data : take id by 4 Of that line username Change it to “ Frisa ” # grammar :UPDATE Table name SET Field name 1= The new data , Field name 2= The new data ,... ...WHERE... ... UPDATE workers SET username=' Frisa ' WHERE id=4; #3.3 Delete data : Delete age by 2000 That line DELETE FROM workers WHERE age=2000; #3.4 Modifying data : take id by 4 Of that line age Set to 250 # grammar :UPDATE Table name SET Field name 1= The new data , Field name 2= The new data ,... ...WHERE... ... # This is used to supplement the deleted data above : #INSERT INTO workers VALUES(4,' Frisa ',' Unknown ','3012-8-15','[email protected]',2000); UPDATE workers SET age=250 WHERE id=4; #3.5 Modifying data : take id by 5 Of that line username Change it to “ The Monkey King ”, Change the age to 26 # grammar :UPDATE Table name SET Field name 1= The new data , Field name 2= The new data ,... ...WHERE... ... UPDATE workers SET username=' The Monkey King ',age=26 WHERE id=5;(3) Output results :
1. Create an employee table
2. Revise the table exercise
2.1 Add age Column
2.2 modify email The column length is 50
2.3 Delete remark Column
2.4 Name name It is amended as follows username
3. Practice adding, deleting and modifying data on the employee table
3.1 Add data
3.2 Modifying data : take id by 4 Of that line username Change it to “ Frisa ”
3.3 Delete data : Delete age by 2000 That line
3.4 Modifying data : take id by 4 Of that line age Set to 250
3.5 Modifying data : take id by 5 Of that line username Change it to “ The Monkey King ”, Change the age to 26
边栏推荐
- Sqli lab pass 17-22 notes
- Phxpaxos installation and compilation process
- [radiology] bugfix: when GLCM features: indexerror: arrays used as indexes must be of integer (or Boolean) type
- Mosaic the face part of the picture
- 10、I/O 输入输出流
- Entrepôt de données 4.0 Notes - acquisition de données commerciales
- 修改mysql的root密码
- Machine learning algorithm for large factory interview (5) recommendation system algorithm
- 数字藏品系统开发:企业布局元宇宙数字藏品
- [deployment] cluster deployment and startup of presto-server-0.261.tar.gz
猜你喜欢

Security problems of FileInfo in PHP file upload

CTF web common software installation and environment construction

数仓4.0笔记——数仓环境搭建—— Yarn配置

Data warehouse 4.0 notes - Data Warehouse Modeling

Entrepôt de données 4.0 Notes - acquisition de données commerciales

VMware uses wireless network card NAT to access the Internet under Windows

數倉4.0筆記——用戶行為數據采集四

3、DQL(数据查询语句)

数仓4.0笔记——业务数据采集

NFT trading platform digital collection system | development and customization
随机推荐
window下vmware使用无线网卡nat的方式上网
Development of digital collection system: what are the main features of NFT?
Ten year structure five year Life-02 first job
软件测试1
Customized development of ant chain NFT digital collection DAPP mall system
数仓4.0笔记——用户行为数据采集一
Usage of some, every, find, FindIndex
Quartz2.2 simple scheduling job
Sqli lab 1-16 notes with customs clearance
Image fuzzy processing batch production fuzzy data set
One of scala variables and data types
3、DQL(数据查询语句)
Review of knowledge points
[untitled]
Phxpaxos installation and compilation process
New BPMN file used by activiti workflow
NFT数字藏品系统开发:深圳晚报《美好时光遨游记》数字藏品上线秒磬
[untitled]
Adding environment variables and templates to systemctl service
Kubesphere ha install (II)









































