중간고사 8주차 :
시험은 필기와 실기로 나뉨,
필기를 다본 뒤에는 제출후
컴퓨터를 열고 access를 연 뒤 실기도 제출
자료 X
Where절 : 조건
복합은 And or
Not은 없는 것.
범위할 때 Between
#41
- 어떤 query 안에 또 query가 있다. - > subquery
JOIN도 가능.
#44
- Grouping
- 조건은 WHERE절에 넣는다.
- Group이라는 것은 Customer이 있으면, Customer을 그룹으로 묶는다.
- Rep1배정된 그룹, Rep2에 배정된 그룹, Rep3에 배정된 그룹 ...
- 그러면 안에 C1, C14 ~ 여러 사람들이 있을 것이다. (Cus)
- 각각의 Group에 COUNT를 적용하면 여기 전체의 Average Balance를 적용할 수 있다.
- SELECT RepNum,
SELECT RepNum, Count(CustomerNum), AVG(Balance)
FROM Customer
GROUP BY Customer.RepNum
ORDER BY Customer.RepNum;
위가 정답,
#47
AverageBalance랑 AVG(Balance)이거 이름 헷갈리게 시험 출제할 수 있음 조심
#49
SELECT Customer.RepNum, Count(Customer.CustomerNum) AS CustomerNum의개수, Avg(Customer.Balance) AS Balance의평균
FROM Customer
WHERE (((Customer.[CreditLimit])<10000))
GROUP BY Customer.RepNum
HAVING (((Count(Customer.[CustomerNum]))>2));
ORDER BY RepNum;
아 위에 식 봐라..... 밑에식이상..
SELECT Customer.RepNum, Count(Customer.CustomerNum) AS CustomerNum의개수, Avg(Customer.Balance) AS Balance의평균
FROM Customer
WHERE (((Customer.[CreditLimit])<10000))
GROUP BY Customer.RepNum
HAVING (((Count(Customer.CustomerNum))>2))
ORDER BY Customer.RepNum;
ORDER BY 잊지마
#51
ORDER By 안알려줌 집가서 공부해
#53
#54
SELECT Orders.OrderNum, OrderDate, Customer.CustomerNum, CustomerName, Item.ItemNum, Description, NumOrdered, QuotedPrice
FROM Orders, Customer, Item, Orderline
WHERE Customer.CustomerNum = Orders.CustomerNum
AND Orders.OrderNum = Orderline.OrderNum
AND Orderline.ItemNum = Item.ItemNum
ORDER BY Orders.OrderNum
;
'JAVA_School > JAVA_School_class' 카테고리의 다른 글
[0412] DB설계및구현1 (0) | 2023.04.12 |
---|---|
[0412] 패턴중심적사고와프로그래밍 (0) | 2023.04.12 |
[0410] 패턴중심적사고와프로그래밍 (0) | 2023.04.10 |
[0405] 패턴중심적사고와프로그래밍 (0) | 2023.04.05 |
[0403] DB설계및구현1 (0) | 2023.04.03 |