发布网友 发布时间:2022-04-23 00:53
共1个回答
热心网友 时间:2022-05-01 03:58
--1
SELECT A.ID '订单号', B.NAME '商品名', B.PRICE '价格', C.NAME '顾客名', C.AGE '年龄'
FROM ORDERS A, GOODS B, CUSTOMER C
WHERE A.GOODSID = B.ID
AND A.CUSTMID = C.ID;
--2
SELECT B.ID '商品号', B.NAME '商品名', SUM(B.PRICE) '总价'
FROM ORDER ORDERS A, GOODS B
WHERE A.GOODSID = B.ID
GROUP BY B.ID, B.NAME;