Database Administration Fundamentals (WS19SQL10004) – Day 4

So far, we have covered how JOIN tables, built-in functions to manipulate strings, numbers and even convert numbers (currencies and dates) to strings, GROUP BY and ORDER BY clauses and the structure of a SELECT statement.

  SELECT table1.field1,
    table1.field2,
    ...
    table2.field1,
    table2.field2,
    ...
    table3.field1,
    table3.field2,
    ...

  FROM table1
  INNER|LEFT|RIGHT JOIN table2
    ON table1.shared_field1 = table2.shared_field1
    AND table1.shared_field2 = table2.shared_field2
  ...
  INNER|LEFT|RIGHT JOIN table3
    ON table1.shared_field1 = table3.shared_field1
    AND table1.shared_field2 = table3.shared_field2
  ...

  WHERE condition1
    AND|OR condition2
    AND|OR condition3
  ...

  GROUP BY table1.field1,
    table1.field2,
    ...
    table2.field1,
    table2.field2,
    ...
    table3.field1,
    table3.field2,
    ...

  ORDER BY
    table1.field1 ASC|DESC,
    table1.field2 ASC|DESC,
    ...
    table2.field1 ASC|DESC,
    table2.field2 ASC|DESC,
    ...
    table3.field1 ASC|DESC,
    table3.field2 ASC|DESC,
    ...

Download the class notes for day 4.