Orders
table to include only orders from the year 2019.Orders
table with the Users
table on buyer_id
to user_id
.RANK()
or ROW_NUMBER()
) to assign a rank to each order for each user based on the order_date
.user_id
, join_date
, and the count of orders as the final output.erDiagram Users { int user_id date join_date varchar favorite_brand } Orders { int order_id date order_date int item_id int buyer_id int seller_id } Items { int item_id varchar item_brand } Users ||--o{ Orders : buyer_id Users ||--o{ Orders : seller_id Items ||--o{ Orders : item_id