Conversation
misshimichka
requested changes
Dec 8, 2025
Collaborator
misshimichka
left a comment
There was a problem hiding this comment.
Привет! По ЛР4:
Ставлю 10/13, нужно поправить задания с ошибками.
| --а также общее количество заказов | ||
| select shipcountry,shipcity, count(distinct orderid) | ||
| from "Sales"."Orders" as o | ||
| group by rollup(shipcountry, shipcity) |
Collaborator
There was a problem hiding this comment.
4.a. 0
Не выводится количество заказов по городам.
| c.city, | ||
| o.shipcountry, | ||
| o.shipcity | ||
| order by sum(d.unitprice * d.qty*(1-d.discount)); |
Collaborator
There was a problem hiding this comment.
- 0
Неверно вычисляетсяshipad
Неверная конечная дата периода
| FROM public."OrderValues" as o | ||
| WHERE orderdate BETWEEN '2007-01-01'::date AND '2007-12-31'::date | ||
| GROUP BY TO_CHAR(orderdate, 'Month'), EXTRACT(MONTH FROM orderdate) | ||
| ORDER BY EXTRACT(MONTH FROM orderdate); |
Collaborator
There was a problem hiding this comment.
2.6. Не ошибка, а замечание: правильнее создать алиас для EXTRACT(MONTH FROM orderdate) и не вычислять каждый раз, а сортировать по алиасу.
| dense_rank() over( order by count(orderid) desc, p.productname asc) | ||
| from "Production"."Products" as p | ||
| join "Sales"."OrderDetails" as d on p.productid = d.productid | ||
| group by p.productname,p.unitprice; |
Collaborator
There was a problem hiding this comment.
2.3. Запрос не выводит товары, которые не входят ни в один заказ.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.