First page Back Continue Last page Image

-- Create a new table from scratch

CREATE TABLE `planets` (

-- Let us have the database provide a unique key

`planetID` INT(5) AUTO_INCREMENT,

-- The name of the object

`planetName` VARCHAR(10) NOT NULL,

-- Add one line for each field in the table

`Mass` DECIMAL(10,4),

`Diameter_km` INT(10),

`Density_kmpmc` INT(10),

`Gravity_mpss` DECIMAL(7,2),

...

Integers are always used for holding unique ID numbers

Integers are a good choice for holding numbers where precision is meaningless

Jupiter is 139,820.24678 Kilometers in Diameter

Do we really need the .24678?

Example Of Integer Variable