Get the App
SLTechnology News&Howtos  ›  Database  › 

Introduction to the function of sql statement

Shulou Source: shulou.com Published: 2022-06-01 19:41:16 10月02日 Update

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.

Tags: Data database statement language query function content program index structure view structure learning for application value function that is articles more see programming Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi macOS OPPO Reno Shulou Technology Apple