SQL Join Flashcards
1
Q
How do you join two SQL tables?
A
With the ‘join’ keyword and the ‘using’ keywords
2
Q
How do you temporarily rename columns or tables in a SQL statement?
A
By using Alias’
select “products”.”name” as “product”,
“suppliers”.”name” as “supplier”
from “products”
join “suppliers” using (“supplierId”);
select "p"."name" as "product", "p"."category", "s"."name" as "supplier", "s"."state" from "products" as "p" join "suppliers" as "s" using ("supplierId");