首页 > 解决方案 > 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.

标签: sqlsql-server-2008mysqli

解决方案


我们试试看:

查询 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;


推荐阅读