sql - I'm trying some questions out before my finals
问题描述
This is the diagram Diagram
I can't seem to figure out how to do these questions. i'm not good at joins can someone please help me Store Suppliers Produce a query to display the stores and the suppliers which supply products to those stores. Show the names of the store and the managers of the store, the supplier name, contact name and phone number of the supplier.
解决方案
我们试试看:
查询 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;
推荐阅读
- nginx - Nginx 配置将一系列端口绑定到 80 并将 proxy_pass 设置为数字路由
- javascript - 在 div 内拖动元素,但拖动时元素闪烁
- r - 使用 Merge.xts 函数将多个 xts 文件合并在一起
- ethereum - 如何使用本地主机测试 Dai
- c# - 如何从麦克斯韦分布中绘制直方图?
- java - TrueTime Sometimes not giving value
- javascript - 如果用户在 iframe 中通过身份验证而不是重定向父窗口,则 iframe
- java - Proguard:IllegalArgumentException - 不是整数值 [proguard.evaluation.value.TypedReferenceValue]
- reactjs - 在 API 调用上的 onSubmit 和异步操作的 react-redux 问题
- amazon-web-services - 使用 AWS .Net SDK 时,客户端对象的生命周期应该是什么?