An estate agent database contains a table called SELLER. The information held in this table includes: Forename, Surname, Phone, Age, Address and Postcode.
For each piece of information, give an appropriate data type and reason why that data type is appropriate.
(6 marks)

4 comments:
Forename - Text - It just contains letters
Surname - Text - It just contains letters
Phone - Text - Begins with a zero and contains a space
Age - Interger - It will be a number
Address - Text - It could contain house numbers and letterd
Postcode - Text - It contains numbers and letter
Forename- text/string
Surname- text/string
Phone- text/string could start with a 0 and has spaces
Age- intiger can only be a full value
Address- text/string could have a house number or name
Postcode- text/string a mizture of letters and numbers
Forename - (Text)The user's forename is made out of letters; therefore it must be text
Surname - (see previous answer)
Phone - (Text) If the data type was a number, then the 0 at the beginning of many phone numbers would not appear. This number will also not have any calculations done to it, so therefore text is also appropriate.
Age - (Integer) this is a whole number, so integer is appropriate
Address - (Text) The user needs to write their address, therefore this is text
Postcode - (Text) The postcode is made from a collection of numbers and letters, therefore the text data type will allow this to appear.
Answer:
Forename: text/string -- no numbers or calculations in a forename, forenames are never dates or times, and forenames cannot be displayed as a boolean. Only a text format can be used to enter forenames.
Surname: text/string -- same reasons as forename; only a text data type can be used to enter surnames.
Phone: text/string -- although no letters are needed in a phone number, phone numbers cannot be stored as integers because most begin with the digit "0" which is not permitted in integers. They do not need to be stored as real numbers because no calculations will be done with phone numbers. Text allows the character "0" and does not permit calculations.
Age: integer -- does not need to be stored as real because no age begins with the digit "0" and no calculations need to be done. Must be a number so integer is the preferred data type.
Address: text/string -- house numbers/names and town names can be entered as text. Integer, real, date/time and boolean are not suitable data types for this field.
Postcode: text/string -- cannot be stored as an integer because letters are required as well as digits. Postcodes are not dates or times, nor are they booleans. Text allows both numbers and letters to be entered into a field, so it is the most appropriate data type for this field.
Post a Comment