Home >Database >Mysql Tutorial >What is the function of sql statement?

What is the function of sql statement?

藏色散人
藏色散人Original
2019-05-13 13:44:0432008browse

What is the function of sql statement?

Structured Query Language (Structured Query Language) is referred to as SQL. Structured Query Language is a database query and programming language used to access data, query, update and manage relationships. Database system;

sql statement is a language used to operate the database.

Program functions:

1. Create database

CREATE DATABASE database-name

2. Delete database

drop database dbname

3. Create new Table

create table tabname(col1 type1 [not null] [primary key],col2 type2 [not null],..)

4. Delete new table

drop table tabname

5. Add a column

Alter table tabname add column col type

6. Add primary key

Alter table tabname add primary key(col)

7. Delete primary key

Alter table tabname drop primary key(col)

8. Create index

create [unique] index idxname on tabname(col….)

9. Delete index

drop index idxname

10. Create view

create view viewname as select statement

11. Delete view

drop view viewname

The above is the detailed content of What is the function of sql statement?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn