SQL 查询构建器
从 CREATE TABLE 模式开始(粘贴 DDL 或手动定义列),勾选所需列,添加 WHERE / JOIN / ORDER BY 子句,构建器会在你的方言下生成可运行的 SELECT、INSERT、UPDATE 或 DELETE 骨架。它只是起步脚手架——运行前请务必检查生成的 SQL。完全本地运行。
所选列的值 (留空 = 占位符 / NULL)
JOINs, GROUP BY and the WHERE/HAVING split
INNER JOIN keeps only rows that match on both sides; LEFT JOIN keeps every left row and fills the missing right side with NULL. WHERE filters rows before grouping, HAVING filters after aggregation — which is exactly why SUM(...) belongs in HAVING, not WHERE.
With GROUP BY, the SELECT list may only contain grouped columns and aggregates — anything else is the classic “not in GROUP BY” error.