.smartsg-subpage .page-header, .smartsg-subpage .entry-title { display: none !important; } .smartsg-subhero { padding: 118px 0 44px; } .smartsg-subhero h1 { margin: 0; font-size: 64px; line-height: 1.04; font-weight: 740; letter-spacing: 0; } .smartsg-subcontent { padding: 0 0 110px; } .smartsg-card-link { display: block; color: inherit !important; text-decoration: none; } .smartsg-card-link:hover { transform: translateY(-2px); box-shadow: 0 18px 45px rgba(7,19,22,0.08); } @media (max-width: 700px) { .smartsg-subhero { padding: 76px 0 34px; } .smartsg-subhero h1 { font-size: 42px; } .smartsg-subcontent { padding-bottom: 76px; } } /* smartsg-top-offset-fix */ body.page-id-120 > .elementor-149 { display: none !important; } body.page-id-120 #content { margin-top: -112px !important; } @media (max-width: 700px) { body.page-id-120 #content { margin-top: -112px !important; } } /* smartsg-fixed-nav-fix */ body.page-id-120 .smartsg-topbar { position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important; }

SQL 入门基础 – 完整指南

SQL(Structured Query Language,结构化查询语言)是一种用于管理和操作关系型数据库的标准化编程语言。在本教程中,您将学习 SQL 的核心概念和基础知识。

一、SQL 是什么?

SQL 指结构化查询语言,全称是 Structured Query Language

二、SQL 能做什么?

SQL 可以执行以下操作:

三、SQL 发展历史

1970s: 起源与早期发展

1980s: 标准化与商业化

1990s-2020s: 持续演进

四、什么是 RDBMS?

RDBMS 指关系型数据库管理系统(Relational Database Management System)。

RDBMS 是 SQL 的基础,也是所有现代数据库系统的基础,包括:

RDBMS 中的数据存储在被称为的数据库对象中。表是相关数据项的集合,由组成。

五、SQL 是一种标准 – 但是…

虽然 SQL 是一门 ANSI 标准的计算机语言,但存在着多种不同版本的 SQL 语言。

为了与 ANSI 标准相兼容,它们必须以相似的方式共同支持一些主要命令:

SELECT    -- 查询数据
UPDATE    -- 更新数据
DELETE    -- 删除数据
INSERT    -- 插入数据
WHERE     -- 条件过滤
...

注意:除了 SQL 标准之外,大部分 SQL 数据库程序都拥有它们自己的专有扩展!

六、在您的网站中使用 SQL

要创建一个显示数据库中数据的网站,您需要:

  1. RDBMS 数据库程序(比如 MySQL、SQL Server、PostgreSQL)
  2. 使用服务器端脚本语言(比如 PHP、Python、Node.js)
  3. 使用 SQL 来获取您想要的数据
  4. 使用 HTML/CSS 展示数据

七、SQL 快速参考

命令 描述
SELECT 从数据库中提取数据
INSERT INTO 向数据库插入新数据
UPDATE 更新数据库中的数据
DELETE 从数据库中删除数据
CREATE DATABASE 创建新数据库
CREATE TABLE 创建新表

八、学习本教程的 prerequisites

在学习 SQL 之前,您需要了解:

SQL 采用类似英语的语法,非常容易上手!

下一步学习

在本系列的下一篇文章中,我们将学习 SQL SELECT 语句,这是 SQL 中最常用的命令,用于从数据库中查询数据。


本教程基于菜鸟教程 SQL 教程整理,适用于 MySQL、PostgreSQL、SQL Server 等主流数据库。

Leave a Reply

Discover more from

Subscribe now to keep reading and get access to the full archive.

Continue reading