我在决赛前尝试了一些问题

时间:2018-06-01 04:14:59

标签: sql sql-server-2008 mysqli

这是图Diagram

我似乎无法弄清楚如何解决这些问题。我不擅长加入,有人可以帮助我 商店供应商 生成查询以显示向这些商店提供产品的商店和供应商。显示商店的名称和商店的经理,供应商名称,联系人姓名和供应商的电话号码。

1 个答案:

答案 0 :(得分:0)

试试吧:

查询8 - 对不起,我真的不明白。

查询9 -
SELECT ShiftID, EndTime - StartTime AS Downtime, T2.* FROM SHIFT T1 JOIN STAFF T2 ON T1.StaffID = T2.StaffID WHERE EndTime - StartTime >= 28 ORDER BY EndTime - StartTime DESC;

查询10 -
SELECT T1.*, Type, FibreContent, CarboContent, NULL AS FatContent, NULL AS ProteinContent FROM PRODUCT T1 JOIN VEGETARIAN T2 ON T1.ProductID = T2.ProductID UNION SELECT T1.*, Type, NULL FibreContent, NULL CarboContent, FatContent, ProteinContent FROM PRODUCT T1 JOIN HEALTHY T2 ON T1.ProductID = T2.ProductID ORDER BY Type;