Describing database tables
A relational database stores data in tables. A table is composed of rows and columns, where each row is a single data record and each column stores a field value associated with each record. A table can have any number of records; however, each field is uniquely named and stores a specific type of data.
A data type restricts the information that can be stored in a field, and it is very important that an appropriate data type, and its associated parameters, be selected for each field in a table. The common data types are as follows:
- Integers (whole numbers), for example, 9, 27, and 345
- Floats (with decimal points, sometimes called real numbers), for example, 1.5 and 4.75
- Text, for example, abc and abc 123
- Boolean, for example, 'True' or 'False'
- Date, for example, 'dd/MM/yyyy'
Each of these data types can have additional constraints set, such as setting a default value, restricting the field size, or prohibiting null values.
In addition to the common data types we mentioned previously, some databases support the geometry field type, allowing the following geometry types to be stored: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon and GeometryCollection.
The multi-point/line/polygon types store multi-part geometries so that one record has multiple geometry parts associated with it.