Home > Database > SQL > What is sql statement

What is sql statement

(*-*)浩
Release: 2019-07-22 11:40:06
Original
10041 people have browsed it

Structured Query Language (Structured Query Language), referred to as SQL, is a database query and programming language used to access data and query, update and manage relational database systems;

What is sql statement

The sql statement is a language used to operate the database. (Recommended learning: MySQL video tutorial)

Program function

Create database

CREATE DATABASE database-name
Copy after login

Delete database

drop database dbname
Copy after login

Create new table

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

Delete new table

drop table tabname
Copy after login

Common statements

Update: update table1 set field1=value1 where range

Search: select * from table1 where field1 like '%value1%' (all strings containing the pattern 'value1')

Sort: select * from table1 order by field1,field2 [desc ]

Sum: select sum(field1) as sumvalue from table1

Average: select avg(field1) as avgvalue from table1

Maximum: select max(field1) as maxvalue from table1

Minimum: select min(field1) as minvalue from table1[separator]

For more MySQL-related technical articles, please visit the MySQL Tutorial column to learn!

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

Related labels:
sql
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template