The first real step will be to think about what kind of data we need to store and then design a database schema to efficiently store that data. To keep things simple (but realistic), let's set our specification as follows:
The address book should keep track of multiple addresses for a person
Each person can have a first and last name
Each address can have a street address, a phone number, and an e-mail address
Translated into a relational database schema, that means we'll have a people
table that will assign a unique identifier to each firstname
and lastname
pair.
Then we'll have an addresses
table that will allow each person to have multiple addresses, each consisting of a unique ID (so it's easy to reference later), a location
("Office", "Home"), a free-form postal address (so we don't have to worry about the complexity of having a city, country, state, postal code, and so on), a phone number, and an e-mail address. Each row will have a column called person
, which will be the...