SQLNotes: Order Details

XuanKhanh Nguyen
Nothingaholic
Published in
2 min readJan 30, 2022

--

Problem

Find order details made by Jill and Eva. Consider the Jill and Eva as first names of customers. Output the order date, details and cost along with the first name. Order records based on the customer id in ascending order.

Tables: customers
+--------------+---------+
| id | int |
+--------------+---------+
| first_name | varchar |
+--------------+---------+
| last_name | varchar |
+--------------+---------+
| city | varchar |
+--------------+---------+
| address | varchar |
+--------------+---------+
|phone_number | varchar |
+--------------+---------+
Tables: orders

+------------------+-----------+
| id | int |
+------------------+-----------+
| cust_id | int |
+------------------+-----------+
| order_date | datetime |
+------------------+-----------+
| order_details | varchar |
+------------------+-----------+
| total_order_cost | int |
+------------------+-----------+

Solution

Algorithm

The question asked us to output the order detail by Jill and Eva

select first_name 
from…

--

--

Nothingaholic
Nothingaholic

Published in Nothingaholic

We love what we do. The moment when we realize we’ve learned something new makes every meeting or change worth it. Learn on!

XuanKhanh Nguyen
XuanKhanh Nguyen

Written by XuanKhanh Nguyen

Interests: Data Science, Machine Learning, AI, Stats, Python | Minimalist | A fan of odd things.

No responses yet