# 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

<table><thead><tr><th width="152">Command</th><th>Explanation</th></tr></thead><tbody><tr><td>SELECT</td><td>Which fields you want to display</td></tr><tr><td>FROM</td><td>The table where the data is stored</td></tr><tr><td>WHERE</td><td>The search criteria</td></tr><tr><td>ORDER BY</td><td>The data is ordered with rules</td></tr><tr><td>SUM</td><td>To add numerical data</td></tr><tr><td>COUNT</td><td>To count the items of data</td></tr><tr><td>ASC</td><td>Order in ascending order</td></tr><tr><td>DESC</td><td>Order is descending order</td></tr><tr><td>*</td><td>Use all fields</td></tr><tr><td>&#x3C;></td><td>Equal to</td></tr></tbody></table>

***

## Exam Questions

{% embed url="<https://cdn.savemyexams.com/pdfs/LVeaj_niw2qFdeMy.pdf>" %}
COPYRIGHT -> SAVEMYEXAMS
{% endembed %}

***
