Home>Article>Database> SQL database add, delete, modify, query syntax

SQL database add, delete, modify, query syntax

王林
王林 Original
2020-05-06 13:34:58 8245browse

SQL database add, delete, modify, query syntax

SQL SELECT syntax

SELECT column_name,column_name FROM table_name;

and

SELECT * FROM table_name;

SQL INSERT INTO syntax

INSERT INTO statements can be written in two forms.

The first form does not need to specify the column name to insert data, just provide the inserted value:

INSERT INTO table_name VALUES (value1,value2,value3,...);

The second form requires specifying the column name and the inserted value:

INSERT INTO table_name (column1,column2,column3,...) VALUES (value1,value2,value3,...);

SQL UPDATE syntax

UPDATE table_name SET column1=value1,column2=value2,... WHERE some_column=some_value;

SQL DELETE syntax

DELETE FROM table_name WHERE some_column=some_value;

Recommended tutorial:sql tutorial

The above is the detailed content of SQL database add, delete, modify, query syntax. 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