liyupi / sql-mother Goto Github PK
View Code? Open in Web Editor NEW免费的闯关式 SQL 自学教程网站,从 0 到 1 带大家掌握常用 SQL 语法,纯前端实现,简单易学~
Home Page: http://sqlmother.yupi.icu
免费的闯关式 SQL 自学教程网站,从 0 到 1 带大家掌握常用 SQL 语法,纯前端实现,简单易学~
Home Page: http://sqlmother.yupi.icu
Cannot read properties of undefined (reading 'exec')
报错什么原因
22100f3
麻烦鱼皮看看可以不,可以的话我提 PR
好像 tab 格式不太一样,看看要不要改
输入的是答案也提示这个 语句错误,Cannot read properties of undefined (reading 'exec')
示例的查询结果和SQL代码好像不太匹配?
如果按照示例的SQL代码,跑一遍出来的结果应该是
+----------+--------+------------+---------+
| emp_name | salary | department | manager |
+----------+--------+------------+---------+
| 小明 | 5000 | 技术部 | 张三 |
| 小明 | 5000 | 技术部 | 李四 |
| 小明 | 5000 | 技术部 | 王五 |
| 李华 | 4500 | 销售部 | 张三 |
| 李华 | 4500 | 销售部 | 李四 |
| 李华 | 4500 | 销售部 | 王五 |
| 鸡哥 | 6000 | 财务部 | 张三 |
| 鸡哥 | 6000 | 财务部 | 李四 |
| 鸡哥 | 6000 | 财务部 | 王五 |
+----------+--------+------------+---------+
但这个和示例给出的结果不太相同,如果把SQL语句改成
mysql> select e.emp_name, e.salary, d.department, d.manager
-> from employees e, departments d
-> order by emp_name asc;
这样出来的结果是
+----------+--------+------------+---------+
| emp_name | salary | department | manager |
+----------+--------+------------+---------+
| 小明 | 5000 | 技术部 | 张三 |
| 小明 | 5000 | 财务部 | 李四 |
| 小明 | 5000 | 销售部 | 王五 |
| 李华 | 4500 | 技术部 | 张三 |
| 李华 | 4500 | 财务部 | 李四 |
| 李华 | 4500 | 销售部 | 王五 |
| 鸡哥 | 6000 | 技术部 | 张三 |
| 鸡哥 | 6000 | 财务部 | 李四 |
| 鸡哥 | 6000 | 销售部 | 王五 |
+----------+--------+------------+---------+
这样就和示例的结果相同了
所以问题应该是department的归属问题?
更加系统性地深入学习sql
例如新增了一个时间处理的自定义关卡,如果在里面新增多个子关卡?
answer is :select s.name student_name, s.age student_age, s.class_id class_id, c.name class_name from student s, class c;
并未用到cross join
可以增加SQLAlchemy 的练习吗?谢谢了
服务器拉取文件,然后运行提示:
VITE v3.2.7 ready in 1373 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
但是ip加端口无法访问,端口也放行了,但是端口并没有被占用...
题目要求将学生表和班级表的所有行组合在一起,并返回学生姓名(student_name)、学生年龄(student_age)、班级编号(class_id)以及班级名称(class_name)。
提供的答案是 select s.name student_name, s.age student_age, s.class_id class_id, c.name class_name from student s, class c;
因为 class 表里同样有 id 字段,表示班级编号,将 s.class_id class_id 改为 c.id class_id 之后满足题目的要求,但查询结果与答案不一致,无法通过关卡。
许多关卡的初始化SQL建表全和第一关一样,是要自己在本地编写每一关的createTable.sql,然后再本地运行吗?
添加这个功能后,用户可以在issue或者社区自定义关卡交流学习
请问该练习网站的数据库是什么?
select datetime() as 'datetime'
在 http://sqlmother.yupi.icu/#/learn 上面运行没有问题,
在我本地 mysql:5.7.36
上面执行报错,提示
select datetime() as 'datetime'
> 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '() as 'datetime'' at line 6
> Time: 0.001s
而换成
select CURRENT_TIMESTAMP as 'datetime';
则可以得的到期待的
datetime |
---|
2023-09-26 16:15:15 |
l would like to help and offer my best knowledge to this comminity support request.
For more details visit https://mintycode.io
看示例代码的时候,发现示例给的代码是跑不出来的。是否存在错误?
以下是我自己测试可以运行的代码
-- Level 23
-- My Answer of Example:
-- 主查询
SELECT c.name, o.total_amount
FROM customers c
INNER JOIN orders o ON c.customer_id = o.customer_id
WHERE c.customer_id IN (
-- 子查询
SELECT customer_id
FROM orders
WHERE total_amount > 200
)
====================
-- Level 24
-- 主查询
SELECT c.name, o.total_amount
FROM customers c
INNER JOIN orders o ON c.customer_id = o.customer_id
WHERE EXISTS (
-- 子查询
SELECT DISTINCT customer_id
FROM orders
)
第20关讲解示例中,员工表employees与部门表departments关联查询结果错误
SELECT e.emp_name, e.salary, e.department, d.manager
FROM employees e
CROSS JOIN departments d;
中e.department
应更正为d.department
介绍“分配唯一连续排名”,介绍中却没有给出并列的例子。
有一个记录的age是空的但是查询出来确实小同学 答案是否不正确
failed to load config from C:\Users\LiWeiJun\Desktop\sql-mother-master\vite.config.ts
error when starting dev server:
Error:
You installed esbuild for another platform than the one you're currently using.
This won't work because esbuild is written with native code and needs to
install a platform-specific binary executable.
Specifically the "esbuild-windows-64" package is present but this platform
needs the "esbuild-windows-32" package instead. People often get into this
situation by installing esbuild on Windows or macOS and copying "node_modules"
into a Docker image that runs Linux, or by copying "node_modules" between
Windows and WSL environments.
If you are installing with npm, you can try not copying the "node_modules"
directory when you copy the files over, and running "npm ci" or "npm install"
on the destination platform after the copy. Or you could consider using yarn
instead of npm which has built-in support for installing a package on multiple
platforms simultaneously.
If you are installing with yarn, you can try listing both this platform and the
other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
Keep in mind that this means multiple copies of esbuild will be present.
Another alternative is to use the "esbuild-wasm" package instead, which works
the same way on all platforms. But it comes with a heavy performance cost and
can sometimes be 10x slower than the "esbuild" package, so you may also not
want to do that.
at generateBinPath (C:\Users\LiWeiJun\Desktop\sql-mother-master\node_modules\esbuild\lib\main.js:1808:17)
at esbuildCommandAndArgs (C:\Users\LiWeiJun\Desktop\sql-mother-master\node_modules\esbuild\lib\main.js:1886:33)
at ensureServiceIsRunning (C:\Users\LiWeiJun\Desktop\sql-mother-master\node_modules\esbuild\lib\main.js:2051:25)
at build (C:\Users\LiWeiJun\Desktop\sql-mother-master\node_modules\esbuild\lib\main.js:1942:26)
at bundleConfigFile (file:///C:/Users/LiWeiJun/Desktop/sql-mother-master/node_modules/vite/dist/node/chunks/dep-2faf2534.js:63043:26)
at loadConfigFromFile (file:///C:/Users/LiWeiJun/Desktop/sql-mother-master/node_modules/vite/dist/node/chunks/dep-2faf2534.js:63019:31)
at resolveConfig (file:///C:/Users/LiWeiJun/Desktop/sql-mother-master/node_modules/vite/dist/node/chunks/dep-2faf2534.js:62643:34)
at createServer (file:///C:/Users/LiWeiJun/Desktop/sql-mother-master/node_modules/vite/dist/node/chunks/dep-2faf2534.js:61943:26)
at CAC.<anonymous> (file:///C:/Users/LiWeiJun/Desktop/sql-mother-master/node_modules/vite/dist/node/cli.js:707:30)
hhh
请问网站的icon是我坤坤的头发吗
关于level16的独特解法。
-- 请在此处输入 SQL
-- select sum(score) total_score,avg(score) avg_score,max(score) max_score,min(score) min_score from student
select 3073 as total_score,307.3 as avg_score ,600 as max_score ,0 as min_score
hhhh~~
一不小心点了刷新就得重头再来。。。
Macbook air m2
macOS Sonoma 14.0 23A5312d arm64
node v20.5.1
npm 9.8.0
> npm list
[email protected] /Users/equationzhao/sql-mother
├── @bytemd/[email protected]
├── @bytemd/[email protected]
├── @bytemd/[email protected]
├── @types/[email protected]
├── @typescript-eslint/[email protected]
├── @typescript-eslint/[email protected]
├── @vitejs/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
SELECT adventurer_id, adventurer_name, SUM(reward_coins) AS total_reward_coins FROM rewards GROUP BY adventurer_id, adventurer_name ORDER BY total_reward_coins DESC LIMIT 3;
只 group by adventurer_id
也对🐔
1
看答案中group_by adventurer_id,adventurer_name。但是adventurer_id已经是用户的唯一标识了,所以group_by adventurer_id应该就够了,没必要再加上adventurer_name了吧?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.