SQL Join Flashcards

1
Q

How do you join two SQL tables?

A

With the ‘join’ keyword and the ‘using’ keywords

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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");
How well did you know this?
1
Not at all
2
3
4
5
Perfectly