In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article is about what the four types of SQL commands are. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.
SQL commands are mainly divided into four types: DDL (data definition language), DML (data manipulation language), DCL (data Control language) and TCL (transaction Control language). Next, let's take you to a brief understanding of these four types, hoping to be helpful to you.
Structured query language (SQL) is a well-known database language, we can use it to perform certain operations on existing databases, and we can also use it to create databases. SQL uses certain commands, such as Create,Drop,Insert, to perform the required tasks.
These SQL commands are mainly divided into four categories. Let's give you a brief introduction:
DDL (data definition language)
DDL or data definition language actually consists of SQL commands that can be used to define database schemas. It only deals with the description of the database schema and is used to create and modify the structure of database objects in the database.
Common DDL commands:
CREATE: used to create databases or their objects (such as tables, indexes, functions, views, stored procedures, and triggers).
DROP: used to delete objects from the database.
ALTER: used to change the structure of the database.
TRUNCATE: used to delete all records from the table, including all spaces assigned to the record.
COMMENT: used to add comments to the data dictionary.
RENAME: used to rename objects that exist in the database.
DML (data manipulation language)
SQL commands that handle data operations that exist in the database belong to DML or data manipulation language, which includes most SQL statements.
Common DML commands:
SELECT: used to retrieve data from the database.
INSERT: used to insert data into a table.
UPDATE: used to update existing data in the table.
DELETE: used to delete records from database tables.
DCL (data control language)
DCL includes commands such as GRANT and REVOKE, which mainly deal with permissions, permissions and other controls of the database system.
Common DCL commands:
GRANT: grants users access to the database.
REVOKE: use the GRANT command to extract the user's access rights.
TCL (transaction Control language)
The TCL command handles transactions in the database.
Common TCL commands:
COMMIT: submit the deal.
ROLLBACK: roll back the transaction in the event of any errors.
SAVEPOINT: sets the SavePoint in the transaction.
SET TRANSACTION: specify the characteristics of the transaction.
Thank you for reading! On what the four types of SQL commands are shared here, I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.