First page Back Continue Last page Image

As we have seen from the scripts used in the examples thus far, the command for enter data into an existing table is the “INSERT” command

The INSERT Command is used in conjunction with the INTO and VALUES Command

The INSERT Command can be used to add one line or many lines to a table

CREATE TABLE `sfmembers` (

-- Let us have the database provide a unique key

`memberID` INT(5) AUTO_INCREMENT,

-- The First Name of the Member

`memberFirstName` VARCHAR(20) NOT NULL,

-- The Last Name of the Member

`memberLastName` VARCHAR(20) NOT NULL,

-- Where are they from

`homeworld` INT(5),

-- How Long have they been in Star Fleet

-- Date of Service

`dos` DATE NOT NULL,

-- What is their current Rank

`rankofrecord` VARCHAR(20) NOT NULL,

PRIMARY KEY(`memberID`)

);

We are going to demonstrate this by adding members to our Star Fleet Table

Inserting DATA Into An Existing Table