Database Reference
In-Depth Information
Figure 8.6
The current format of the visitorbook table.
Figure 8.7
The current content of the visitorbook table.
On our visitorbook page on the website, it would be nice to ask the visitor to give us
some idea of where they are based geographically. We will store this in a location column.
We will also allow them to rate our site with a score between 1 and 20. For the location col-
umn, we need to store a string. It is hard to guess the length of this directly but let us say this
would be no more than 50 characters long. Therefore we use the following to add a location
column to the table:
ALTER TABLE visitorbook
ADD
location VARCHAR(50)
For the score column, we will only be storing a limited range of numbers, so we can just
use a SMALLINT datatype to store the score. We add the extra column as follows:
ALTER TABLE visitorbook
ADD
score SMALLINT
Search WWH ::




Custom Search