What is the function of sql statement?

藏色散人
Release: 2020-09-16 11:07:06
Original
31881 people have browsed it

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
Copy after login

2. Delete database

drop database dbname
Copy after login

3. Create new Table

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

4. Delete new table

drop table tabname
Copy after login

5. Add a column

Alter table tabname add column col type
Copy after login

6. Add primary key

Alter table tabname add primary key(col)
Copy after login

7. Delete primary key

Alter table tabname drop primary key(col)
Copy after login

8. Create index

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

9. Delete index

drop index idxname
Copy after login

10. Create view

create view viewname as select statement
Copy after login

11. Delete view

drop view viewname
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!