In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
What are the additions, deletions, changes, and lookups in mysql? In response to this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more small partners who want to solve this problem find a simpler and easier way.
1. Create db_shop database, if the database does not exist, create it
create database if not exists db_shop;
2. Delete the database, if the data exists, delete it
drop database if exists db_shop;
Create a data table for db_shop
use db_shop;drop table if exists tb_goods;CREATE TABLE tb_goods( `goodsId` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`tb_goods`));
4. Create a new table from the old table
create table tb_goods01 like tb_goods;
5. Delete data table
drop table tb_goods01;
Add a column to a table (one field)
alter tb_goods add column goodsName varchar(255) after goodsId;
Note: If you don't write after or before, you will add it to the end by default.
7. Delete fields
alter table tb_goods drop column goodsName;
8. Insert data
insert into tb_goods (goodsId,goodsName) values (1002,'goods1');
9. Inquiry
query all
select * from tb_goods;
query for specific
select goodsName fromtb_goods;
fuzzy lookup
select * from tb_goods like '% goods %';
10. Update Data Sheet
update tb_goods set goodsName ='commodity 2'; about mysql which add, delete, change, check the answer to the sentence problem shared here, I hope the above content can have some help to everyone, if you still have a lot of doubts not solved, you can pay attention to the industry information channel to learn more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.