SQLNotes: Order Details
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…