Introduction to the function of sql statement
Today, the editor is to share with you about the role of sql statements, I believe many people do not understand, in order to let you better understand the role of sql statements, so give you a summary of the following content, let's look down. I'm sure you'll get something.
Structured query language (Structured Query Language) is referred to as SQL. Structured query language is a database query and programming language for accessing data and querying, updating and managing relational database systems.
Sql statement is a language that operates on a database.
Program function
Create a database
CREATE DATABASE database-name
Delete database
Drop database dbname
Create a new table
Create table tabname (col1 type1 [not null] [primary key], col2 type2 [not null],..)
Delete new table
Drop table tabname
Add a column
Alter table tabname add column col type
Add primary key
Alter table tabname add primary key (col)
Delete primary key
Alter table tabname drop primary key (col)
Create an index
Create [unique] index idxname on tabname (col … (.)
Delete index
Drop index idxname
Create a view
Create view viewname as select statement
Delete View
Drop view viewname
This is the end of the introduction on the role of the sql statement. I hope the above content can be of certain reference value to everyone and can be put into practice. If you like this article, you might as well share it for more people to see.