Database Reference
In-Depth Information
UPDATE webpage
SET
content = “Welcome to my MySQL based website”
WHERE
ID = 1;
UPDATE webpage
SET
content = “Please add a comment to my visitor book”
WHERE
ID = 2;
UPDATE webpage
SET
content = “Here are some links you may find of use”
WHERE
ID = 3;
UPDATE webpage
SET
content = “Here is what I have done with my work life up till now”
WHERE
ID = 4;
UPDATE wbpage
SET
content = “My hobbies are, web programming, anorak spotting and
fish collecting “
WHERE
ID = 5;
Figure 8.5 shows what the webpage table will look like after you have selected everything
from it again. Our website's database now has some content.
ALTER
The ALTER command is a strange command to have in SQL as it can be argued that it is not
needed. This command allows you to change the structure of a table after it has been cre-
ated. The argument is that if you have correctly completed the analysis and design of your
database, you should not need to alter its structure at a later time. However, the real world
is seldom like this, we make mistakes, and goals and requirements change, so it is a good
Figure 8.4
Fixing our unconstrained UPDATE.
Search WWH ::




Custom Search