你好,已完成所有问题,52640

52640,这是sql文件(包含建库、插入数据脚本及问题的答案),请查看

 

为什么你的COURSE表的course_id跟Takes表不一致呢?是不是之前您对COURSE进行过修改呢?因为universityrelationinsert 文件中,导入的COURSE表和Takes表的course_id是一致的。建议您重新建数据库,重新导入数据,再运行脚本。

你好,麻烦打开COURSE和TAKES表让我看看里面的数据

你好,前两问已完成,第三问正在测试中。

52640

— 1.
select
TAKES.year,
semester,
Takes.course_id as “Course ID”,
sum(credits) as “Total Credits”,
concat(‘$’,800*sum(credits)) as “Total Revenue”
from TAKES left join COURSE
on TAKES.course_id = COURSE.course_id
group by TAKES.year,semester,Takes.course_id
order by year desc, “Total Credits” asc;

— 2.
select
concat(TAKES.id,STUDENT.name) as “Student Info”,
STUDENT.tot_cred as “Record Credit”,
sum(credits) as “Calculated Credits”,
decode(sign(STUDENT.tot_cred-sum(credits)-50),1,’incorrect’,0,’needs closer examination’,-1,’needs closer examination’)as “Result”
from STUDENT, TAKES left join COURSE on TAKES.course_id = COURSE.course_id
where STUDENT.id = TAKES.id
group by TAKES.id, STUDENT.name, STUDENT.tot_cred
having STUDENT.tot_cred>sum(credits)
order by “Calculated Credits” desc;

待会我测试完第3问会发总的sql文件,如果前两问有问题可以跟我说一下哈

你好,这是插入数据的语句,这样我就知道怎么做了。现在国内是深夜了,我明天早点起来再接着做哈,明天应该可以做完给你。

你好,我看到题目source中只有一个DDL文件和一份Excel文件,其中excel表格中只有takes,student和advisor的数据,我不太清楚你所说的两个source是指什么。

我看你后来补充的word文件,里面有提到“

Now copy and paste the code from universityrelationinsert and run it as a script. This will populate some of the smaller tables.

This took me about 4 minutes.

” 请问这个脚本文件能否提供呢?

\"\" \"\"

你好,我知道source中DDL有创建course,prereq, student,takes表,可这仅仅是定义了表,里面没有数据,数据需要从excel中导入,但是excel表格中只有takes,student和advisor的数据,有些题目需要多个表的查询,可是没有数据,我无法进行测试,麻烦提供完整的数据。

你好,题目中要求的You can find the total revenue by calculating how many students took a course each semester and how many credits each course is worth.但是excel表中没有参与课程的学生数量,以及没有每门课的学分。

Reminder
OK
作业代写,代写作业,作业辅导,辅导作业,作业问答,美国作业代写,留学生作业,留学生作业代写,数学作业,数学作业代写,统计作业代写,物理作业代写,金融作业代写,大学作业辅导 Keywords: 作业代写 代写作业 作业辅导 辅导作业 作业问答 美国作业代写 留学生作业 留学生作业代写 数学作业 数学作业代写 统计作业代写 物理作业代写 金融作业代写 大学作业辅导