Numeric Data Types
Stored as Binary after converting from number
– For storing whole numbers – Can be either Positive or Negative (+ or -)
– For storing numbers when decimals are needed
– Usually 2 or 4 bytes
•Date / Time;
For storing calender dates and times
Needed as time and date are not denary numbers
Units go up in different # days per month, 60 seconds to an hour, 24 hours to a day
Used for either one or both together
(Actualy converted to a number and then a binary value of data + time for storage)
•Currency:
Used to store a specific 2 decimal number and display currency symbol
Includes 2 decimal places + a symbol
(Used for all monetary values)
Question 1:
List all the date formats you know and calculate the max bytes each needs
Question 2:
What are the biggest & smallest values using 2 bytes in:
1.a) Pure Binary
2.b) Sign & Mag
3.c) Two’s Compliment
Alphanumeric Data Types
Character
Stores a single character or digit
–Has a size of one byte
String
Question 3: What is the longest name you know?
•Hint: Sri Lanken Cricketer
•
Boolean
–Used to store 'Either / Or' information; with only 2 possible values.
Many characters grouped together under a single identifier (e.g Name)
Maximum number of charaacters defined by user
The question is always;
What length / how many characters to store?
Consider the longest possible value
•e.g. Mr Writhlington-Williamson
True or False, Yes or No
–Stored as a single byte
–Sometimes referred to as flags, after US mail boxes
• Calculated Fields
–Not strictly a data type as they are not stored data
–just formula stored and calculated when needed
–e.g. to store Age as NOW() - DATE
• Question 4:
Why are telephone numbers are always stored as a string?
Further Reading