SQL
一句话解释
SQL (Structured 查询 Language) 是 language used 到创建, 读取, 更新, and 删除数据 in relational 数据库.
用大白话说
SQL (Structured Query Language) is the standard language for working with relational databases. You use it to create tables, insert data, query data, update records, and manage the database structure.
SQL has several categories of commands:
- DDL (Data Definition Language):
CREATE,ALTER,DROP— define structure. - DML (Data Manipulation Language):
INSERT,UPDATE,DELETE— modify data. - DQL (Data Query Language):
SELECT— read data. - DCL (Data Control Language):
GRANT,REVOKE— manage permissions.
SQL is declarative — you describe *what* you want, not *how* to get it. The database engine figures out the most efficient execution plan.
示例
sql
-- DDL: create a table
CREATE TABLE users (id SERIAL PRIMARY KEY, name TEXT);
-- DML: insert data
INSERT INTO users (name) VALUES ('Ada');
-- DQL: query data
SELECT * FROM users WHERE name = 'Ada';Three 分类的 SQL: 定义结构, 修改数据, and querying 数据.
相关术语
相关资源
相关课程
- SQL 基础
开始编写 SQL 查询.
解读错误信息
用大白话解释常见错误——什么意思、为什么发生、如何修复。