Published: Monday 4 September 2023
With a SQL statement, we can use the JOIN statement to join multiple tables to a database query.
Two commonly used JOIN types that are used in SQL Server are INNER JOIN and LEFT JOIN.
Take these users and roles data:
Write a SQL statement that will return all users and their role. For table names, use User for the user table and Role for the role table. You'll need to use one of the JOIN methods to JOIN the User table with the Role table. Remember to only include the columns you need in the statement.