当前位置:网站首页>Mysql database - basic operation of database and table (II)

Mysql database - basic operation of database and table (II)

2022-04-23 19:42:00 X heart

For reference only :

 

The first 1 Turn off : insert data

USE Company;

# Please add the implementation code here 
########## Begin ##########

########## bundle insert the value ##########
insert into tb_emp(Id,Name,DeptId,Salary) 
values(1,'Nancy',301,2300)
,(2,'Tod',303,5600)
,(3,'Carly',301,3200);



########## End ##########
SELECT * FROM tb_emp;

The first 2 Turn off : Update data

USE Company;

# Please add the implementation code here 
########## Begin ##########

########## update the value ##########
update tb_emp 
set Name="Nancy",DeptId=301,Salary =2300
where Id=1;
update tb_emp
set Name="Tracy",DeptId=302,Salary =4300
where Id=3;




########## End ##########

SELECT * FROM tb_emp;

The first 3 Turn off : Delete data

USE Company;

# Please add the implementation code here 
########## Begin ##########

########## delete the value ##########

delete FROM tb_emp where Salary>3000;


########## End ##########

SELECT * FROM tb_emp;

 

版权声明
本文为[X heart]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231927030977.html