I'm building a database for a chat application and I'm having a spot of trouble building a View to combine the Chats table and the Users table.
The Chats table has fields sender_id, receiver_id which map to the user_id field in the Users table. Now, I want to create a View which will combine the Chats with the Users table, and also provide the sender's and receiver's profile picture(in the fields sender_pic and receiver_pic). These can be fetched from the profile_pic field from the Users table.
What's the SQL syntax for doing this?