Join two tables on column

PHOTO EMBED

Mon Jan 31 2022 17:50:43 GMT+0000 (UTC)

Saved by @aguest #sql

/*
For this challenge you need to create a simple SELECT statement that will return all columns from the products table, and join to the companies table so that you can return the company name.

products table schema:
id
name
isbn
company_id
price

companies table schema:
id
name

You should return all product fields as well as the company name as "company_name".
*/

SELECT products.*, companies.name AS company_name
FROM products
JOIN companies ON company_id = companies.id
content_copyCOPY