VCE IT Lecture Notes by Mark Kelly, McKinnon Secondary College

Data Types

In databases (and programming) it's important to be able to choose an appropriate data type for fields (or variables) in which the data will be stored. Different RDBMS and programming languages offer different selections of available field types for you to choose from.

Data types should not be confused with data formats which specify how data looks when output.

The 2011-2014 study design specifies knowledge of these data types:

  • Unit 1 - integer, floating point numbers, character, string.
  • ITA - text (string), number, date, currency, logic (Boolean)
  • SD - integer, floating point number, Boolean, character, string
DATA TYPE DESCRIPTION EXAMPLE
Integer a whole number (no fractional part) -32000, 394
Floating point number a number with a fractional part -3049.3, 394.126
Character a single character of text E, $, 1, + (the '1' is stored as text and cannot be used arithmetically)
String any number of text characters "string45+&_44"
Number any type of numeric storage (byte, integer, short/long floating point, currency etc) 12, -13.5, 192345769656.3423523
Date

stores a day, month and year combination for any day in history.

It's stored in a special format that lets software interpret the date and do comparisons and calculations with it (e.g. Date + 3 = 3 days after Date. Date2-Date1 gives the number of days between date1 and date2.

12 March 2011
Logic (Boolean) Stores a single value - true or false. Boolean takes very little memory and storage space.

IsMarried = TRUE

If IsMarried = FALSE Then Happy = TRUE

 

 

Data type comparison - Access vs Filemaker

Access data types Notes Filemaker equivalent
Text

Can contain any text, digits or punctuation that can be typed.

Max length: 255 characters.

Text
Memo Text, up to 64,000 characters
Byte numbers from 0 to 255 (no fractions). Uses 1 byte Number
Integer numbers from –32,768 to 32,767 (no fractions). Uses 2 bytes
Long Integer numbers from –2,147,483,648 to 2,147,483,647 (no fractions). Uses 4 bytes.
Decimal numbers from -10,000,000,000,000,000,000,000,000,000 to +10,000,000,000,000,000,000,000,000,000. Uses 12 bytes
Single (precision) Really small and big numbers, positive and negative to 7 decimal places. Uses 4 bytes.
Double (precision) numbers from –1.79769313486231E308 to –4.94065645841247E–324 for negative values and from 1.79769313486231E308 to 4.94065645841247E–324 for positive values. That's like 300 digits and up to 15 decimal places! Uses 8 bytes.
Date/Time Dates and times. Uses 8 bytes Timestamp
Currency Use the Currency data type to prevent rounding off during calculations. Accurate to 15 digits to the left of the decimal point and 4 digits to the right. Uses 8 bytes

Number

(autonumber is formatted as 'auto-enter serial number')

AutoNumber Unique sequential or random numbers automatically inserted when a record is added. Sometimes called serial number. Uses 4 bytes
Yes/No (Boolean) Can contain only one of two values: Yes/No, True/False, On/Off etc. Uses only 1 binary bit.
OLE Object Binary data e.g. pictures, sounds, XLS data files. Can use up to 1 gigabyte. Container
Hyperlink Stores a UNC (e.g. //server1/data) or URL (e.g. http://www.fred.com). Max size 64,000 characters No exact equivalent in Filemaker - use text.

 

Filemaker Data Type Notes Access Equivalent
Text Up to 2 gigabytes! Text or memo
Number Up to 800 digits, positive or negative, with or without decimal places. Byte, Integer, Long Integer, Decimal, Single, Double
Date Any date between 1 Jan 0001 and 31 Dec 4000 Date
Time A time of day: hour, minute and second
Timestamp Combined date and time
Container Any binary data e.g. picture, sound, Word document, up to 4 Gigabytes. OLE object
Calculation A value calculated by a formula using existing data. The answer can be any of text, number, date, time, timestamp or container. Not found in Access. Use a query.
Summary A special field type produced by processing values across many records (e.g. average, maximum, minimum). There is only a single summary value for an entire table, rather than one for each record. Not found in Access? Alternative?
Global A global field is not a different data type as such, but it contains the same value for all records in the database and can be of any type except summary. It's useful for storing values like the login name of the person using the database: it only needs to be stored once, not individually for each record in the database. Not found in Access?

Have you ever wondered why two dominant RDBMS have such stupid names? How does "Access" or "Filemaker" make you think of "database"? Anyhoo...

 

Back to the IT Lecture Notes index

Back to the last page you visited

Created 12 April 2010

Last changed: November 24, 2010 2:27 PM

VCE IT Lecture notes copyright © Mark Kelly 2001-