Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the commonly used sql statements in the database at present

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article is to share with you about the sql statements commonly used in the database. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Commonly used sql statements

1. Database correlation

Check all databases.

Show databases

Create a database

Create database db1

View the database

Show create database db1

Create a database specified character set

Create database db1 character set utf8/gbk

Delete database

Drop database db1

Using the database

Use db1

Table correlation

Create a tabl

Create table T1 (id int,name varchar (10))

View all tables

Show tables

View individual table properties

Show create table t1

View table fields

Desc t1

Create a table to specify the engine and character set

Create table T1 (id int,name varchar (10)) engine=myisam/innodb charset=utf8/gbk

Modify the table

Modify table name

Rename table t1 to t2

Modify table properties

Alter table t1 engine=myisam/innodb charset=utf8/gbk

Add table field

Alter table t1 add age int first/after xxx

Delete table field

Alter table t1 drop age

Modify table field name and type

Alter table t1 change age newAge int

Modify the type and location of the table

Alter table t1 modify age int first/after xx

Delete tabl

Drop table T1 Thank you for reading! This is the end of this article on "what are the sql statements commonly used in the database?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report