A relationsTables that store data in a relational database uses tables to store data in the database. Each of these tables corresponds to an entity (anything about which we need to store data, like a person, place or thing).
Relationships are created between tables using key fields. Relationships can be classified as ONE to ONE, ONE to MANY, MANY to ONE and MANY to MANY.
Data types
A record structure allows for multiple different types of data to be stored. For example, a simple database may hold your name as text, your age as a number and your gender as a Boolean value (Male | Female).
Common data types utilised in databases are listed below:
Data type
Description
Example data
Number/integer
These are whole numbers only
Age = 16
Real/float
These are numbers that can have a decimal part
0.1, 1.2, 3.4, 6.0
Boolean
This has two values only, true and false
True/False, 1/0, Y/N
Character
This is a single letter, number or symbol
A, B, C, @, *
Text/string
This is used for text, and can include any character
Digital Technology
Date/time
Used for dates and times
29/11/2016 20:55
Calculated
A formula to work something out
Age: Current date minus date of birth
Data type
Number/integer
Description
These are whole numbers only
Example data
Age = 16
Data type
Real/float
Description
These are numbers that can have a decimal part
Example data
0.1, 1.2, 3.4, 6.0
Data type
Boolean
Description
This has two values only, true and false
Example data
True/False, 1/0, Y/N
Data type
Character
Description
This is a single letter, number or symbol
Example data
A, B, C, @, *
Data type
Text/string
Description
This is used for text, and can include any character