달리기반 SQL 5번까지
달리기반 5-2
select p.Category, p.ProductName Top_Product, sum(o.Quantity) TotalSold
from products p join orders o on p.ProductID=o.ProductID
group by 1,2
having sum(o.Quantity) = (
select max(sum_quantity)
from
(
select p1.Category,sum(o1.Quantity) sum_quantity
from products p1 join orders o1 on p1.ProductID=o1.ProductID
group by p1.Category, p1.ProductID) a
where a.Category = p.Category
)
5-3
select Name, Department ,Salary
from employees e
where e.Salary = (
select max(Salary)
from employees e1
where e1.Department=e.Department
)
5-4
select e.Name, p.ProjectName, p.Budget
from employees e join employeeprojects em on e.EmployeeID=em.EmployeeID join projects p on em.ProjectID=p.ProjectID
where p.Budget >= 10000
order by 3 desc
오늘 뭔가 달리기반 SQL이 이해가 잘 안 되어서 너무 오래 걸렸다. 그리고 자바 달리기 하는데 비주얼 스튜디오 콘솔창에서 한글 입력을 못 받길래 하루종일 찾다가 반포기하고 했다. 나 오늘 뭐 했지? 내 시간 어디갔지?