Skip to content
This repository was archived by the owner on Aug 17, 2024. It is now read-only.

Conversation

Adibab
Copy link

@Adibab Adibab commented Feb 12, 2023

Volunteers: Are you marking this coursework? You can find a guide on how to mark this coursework in HOW_TO_MARK.md in the root of this repository

Your Details

  • Your Name: Adiba Belayete
  • Your City: Manchester
  • Your Slack Name: Adiba

Homework Details

  • Module: SQL -02
  • Week: 02

Notes

  • What did you find easy?

  • What did you find hard?

  • What do you still not understand?

  • Any other notes?

12. Retrieve the names of all customers who bought a product from a supplier based in China.
sql -
select distinct customers.name from customers inner join orders on orders.customer_id = customers.id inner join order_items on order_items.order_id = orders.id inner join suppliers on suppliers.id = order_items.supplier_id and suppliers.country = 'China';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to see you exploring distinct here

13. List all orders giving customer name, order reference, order date and order total amount (quantity * unit price) in descending order of total.

sql -
select customers.name, orders.order_date, orders.order_reference, order_items.quantity * product_availability.unit_price as total_amount from customers inner join orders on orders.customer_id = customers.id inner join order_items on order_items.order_id = orders.id inner join product_availability on product_availability.prod_id = order_items.product_id order by total_amount desc;

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job on completing these tasks Adiba :) separating your clauses onto new lines can help with readability

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants