Skip to content
🗄️

数据库与 SQL

15 个项目

15 个数据库实战项目围绕建表、查询优化与业务建模展开,写出生产级的 SQL 与表结构。

  1. 1

    Blog 数据库 Schema

    设计 and 构建 relational 数据库 Schema for blog 使用 posts, authors, and comments. 练习 CREATE TABLE, foreign 键, and 关系.

    入门 约 15 分钟
  2. 2

    Inventory Management 查询

    构建设置的 SQL 查询到 manage product inventory: 添加 products, 更新 stock, and 查找低-stock 项.

    入门 约 15 分钟
  3. 3

    用户认证 Schema

    设计 secure 用户认证数据库使用唯一 emails, 密码 hashes, and roles. 练习 constraints and 索引.

    简单 约 20 分钟
  4. 4

    Student Gradebook 使用连接

    构建 gradebook 数据库 and 编写 JOIN 查询到 组合 student, 课程, and grade 数据. 练习 INNER and LEFT 连接.

    简单 约 20 分钟
  5. 5

    Sales Analytics Dashboard 查询

    构建设置的 aggregation and GROUP BY 查询 for sales analytics dashboard. 练习 COUNT, SUM, AVG, and HAVING.

    中等 约 25 分钟
  6. 6

    E-commerce 顺序系统

    设计完整 e-commerce 数据库使用 customers, products, 顺序, and 顺序项. 练习复杂关系.

    中等 约 25 分钟
  7. 7

    Safe Bank Transfer 使用事务

    构建 bank transfer 系统 using SQL 事务. 练习 BEGIN, COMMIT, ROLLBACK, and ACID 属性.

    中等 约 20 分钟
  8. 8

    Normalized 库 Catalog

    设计 normalized 库数据库使用 books, authors, publishers, and 分类. 练习 normalization 到 3NF.

    中等 约 25 分钟
  9. 9

    MongoDB Document 存储

    构建 MongoDB-样式 document 存储 for blog using flexible JSON documents. 练习 NoSQL 设计模式.

    简单 约 15 分钟
  10. 10

    数据库迁移 Script

    编写设置的 数据库迁移 scripts 那个 evolve Schema over 时间. 练习 ALTER TABLE and versioned 迁移.

    中等 约 20 分钟
  11. 11

    高级 JOIN 与子查询

    掌握复杂 JOIN —— 自连接、反连接、CROSS APPLY 和相关子查询。练习最强大的 SQL 查询模式。

    中等 约 35 分钟
  12. 12

    窗口函数与 CTE

    掌握窗口函数(OVER、PARTITION BY、ROW_NUMBER、RANK)和公用表表达式(CTE),用于复杂分析查询。

    中等 约 40 分钟
  13. 13

    存储过程与函数

    编写存储过程和用户自定义函数。练习用参数和返回值将业务逻辑封装在数据库中。

    中等 约 40 分钟
  14. 14

    查询优化与 EXPLAIN

    学习用 EXPLAIN 分析查询计划,识别瓶颈,通过索引、查询重写和反范式化进行优化。

    中等 约 45 分钟
  15. 15

    电商数据库设计

    为电商平台设计完整的范式化数据库模式。一个开放式项目,涵盖范式化、关系、约束和索引策略。

    中等 约 60 分钟