9.1 Databases


Data Types

There are a number of data types that are represented in a database:

  • Text (e.g. NG321AE)

  • Character (e.g. X)

  • Boolean (e.g. True)

  • Integer (e.g. 15)

  • Real (e.g. 19.33)

  • Date / Time (e.g. 180555)


Primary Keys

Each table has a primary key. It acts as a unique number. Duplicate data items would be deleted if entered into the primary key field. It identifies each individual record.


SQL

Command
Explanation

SELECT

Which fields you want to display

FROM

The table where the data is stored

WHERE

The search criteria

ORDER BY

The data is ordered with rules

SUM

To add numerical data

COUNT

To count the items of data

ASC

Order in ascending order

DESC

Order is descending order

*

Use all fields

<>

Equal to


Exam Questions


Last updated