Reading the Schema
region (r_regionkey, r_name, r_comment)
nation (n_nationkey, n_name, n_regionkey, ...)
customer (c_custkey, c_name, c_nationkey, c_acctbal, c_mktsegment, ...)
orders (o_orderkey, o_custkey, o_orderdate, o_totalprice, ...)
lineitem (l_orderkey, l_linenumber, l_partkey, l_suppkey, l_quantity, ...)
- Every column has a prefix from its table:
c_name, s_name, p_name
- So two tables never share a column name, and you rarely need
c.c_name
- Foreign keys are named for what they point to:
o_custkey → c_custkey
lineitem is 1 GB: add LIMIT 10 while you work, and filter early