Write a SQL RIGHT OUTER JOIN statement that joins the user_id column from the blog.posts table, the name column of the blog.users table and the body column of the blog.posts table together.
Here is what I have so far:
USE blog;
SELECT posts.user_id, posts.body, users.name
FROM posts
RIGHT OUTER JOIN users ON
posts.user_id, posts.body = users.name;
Here are the tables with their columns
posts: id,body,user_id
users: id, name
How do I adjust this code to work?
Here is the syntax for RIGHT JOIN.
SELECT column_name(s)
FROM table1
RIGHT JOIN table2 ON table1.column_name = table2.column_name;
For more details, go to this link.
https://www.w3schools.com/sql/sql_join_right.asp
Hope this helps.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments