Question: PLEASE HELP WITH ASSIGNMENT!!!!! I don't know how to distinguish between the sender and receiver's first and last name in the code. how would I
PLEASE HELP WITH ASSIGNMENT!!!!! I don't know how to distinguish between the sender and receiver's first and last name in the code. how would I write this out?

(the bottom two tables in red text which are hard to read are the "image" table and "message_image" table respectively)
message table info
+------------+-----------+-------------+--------------------------------------------+---------------------+ | message_id | sender_id | receiver_id | message | send_datetime | +------------+-----------+-------------+--------------------------------------------+---------------------+ | 1 | 1 | 2 | Congrats on winning the 800m Freestyle! | 2016-12-25 09:00:00 | | 2 | 2 | 1 | Congrats on winning 23 gold medals! | 2016-12-25 09:01:00 | | 3 | 3 | 1 | You're the greatest swimmer ever | 2016-12-25 09:02:00 | | 4 | 1 | 3 | Thanks! You're the greatest sprinter ever | 2016-12-25 09:04:00 | | 5 | 1 | 4 | Good luck on your race | 2016-12-25 09:05:00 | +------------+-----------+-------------+--------------------------------------------+---------------------+
person table info
+-----------+------------+-----------+--------------------+ | person_id | first_name | last_name | email | +-----------+------------+-----------+--------------------+ | 1 | Michael | Phelps | NULL | | 2 | Katie | Ledecky | NULL | | 3 | Usain | Bolt | NULL | | 4 | Allyson | Felix | NULL | | 5 | Kevin | Durant | NULL | | 7 | Custom | Name | custom@email.com | +-----------+------------+-----------+--------------------+
contact_list table info
+---------------+-----------+------------+----------+ | connection_id | person_id | contact_id | favorite | +---------------+-----------+------------+----------+ | 1 | 1 | 2 | n | | 2 | 1 | 3 | n | | 3 | 1 | 4 | n | | 4 | 1 | 5 | n | | 5 | 1 | 6 | n | | 6 | 2 | 1 | y | | 7 | 2 | 3 | n | | 8 | 2 | 4 | n | | 9 | 3 | 1 | y | | 10 | 3 | 4 | n | | 11 | 4 | 5 | n | | 12 | 4 | 6 | n | | 13 | 5 | 1 | y | | 14 | 5 | 6 | n | | 15 | 7 | 1 | y | | 16 | 7 | 1 | y | | 17 | 7 | 1 | n | +---------------+-----------+------------+----------+
message_image table info
+------------+----------+ | message_id | image_id | +------------+----------+ | 1 | 5 | | 3 | 2 | | 4 | 1 | | 4 | 3 | | 4 | 4 | +------------+----------+
image table info
+----------+------------+----------------+ | image_id | image_name | image_location | +----------+------------+----------------+ | 1 | PIC1 | loc1 | | 2 | PIC2 | loc2 | | 3 | PIC3 | loc3 | | 4 | PIC4 | loc4 | | 5 | PIC5 | loc5 | +----------+------------+----------------+
Task 13: Find All of the Messages that Michael Phelps Sent
Construct the SQL statement to find all of the messages that Michael Phelps sent. Note: You must use the WHERE clause to set the conditions for this query. Display the following columns:
- Sender's first name
- Sender's last name
- Receiver's first name
- Receiver's last name
- Message ID
- Message
- Message Timestamp
Database Schema Notes Type Notes intl8) .Primary key Requirad Required connection id Primary key Required Required intl8 archari25) Field Notes contect id Required varchari25 Required nt(8) .Primery key varchar 10) Not required Custom Column Your Choice Your Choice Required ender id 'Required nt(a) .Required varchar2ss) 'Required Notes Field Notes Required Primary key Required Required Primary key Required imase idnt(s) Primary key Required Required
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
