Java and Database Connectivity
|
SQL: Reprise
-
Table:
-
-
a set of similar namespaces (rows)
-
representing a kind of thing in the domain
-
each namespace (row) represents one thing of this kind
- Like objects in a class... almost.
-
Primary key:
-
-
a column in a table in which each value is distinct
from every other.
-
makes the table into a namespace of rows
-
not every table has one
-
Foreign keys
-
-
a column in a table whose values are values from the
primary key column in another table
-
not every table has one
-
some tables have more than one
-
Join
-
-
A select statement which joins two or more tables
-
Usually in ways that represent predetermined
relationships
-
If mis-constructed (e.g. 'cross-product joins') can go
horribly wrong
-
Complex joins can be expensive to compute.