Home | Features | F A Qs | Download | Purchase | Links | Support | Contact us  


Boffin Examples
 

The Dinosaur Database

 

Create_Dinosaur_Demo.sql (abbreviated, the full SQL is included with the download.)

 

--creates DINO_FEEDER table

Create Table Dino_Feeder(

Feeder Varchar(20) not null primary key,

Feeder_Meaning Varchar(100)

);

--creates DINO_PERIOD table

Create Table Dino_Period(

Period Varchar(25) not null primary key,

Period_Description Varchar(250)

);

--creates DINOSAURS table

Create Table Dinosaurs(

Dino_Name Varchar(25) not null primary key,

Meaning Varchar(25),

Period Varchar(25),

Lived Varchar(50),

Found Varchar(50),

Body_Length Number(5,2),

Body_Height Number(4,2),

Body_Weight Number(6,1),

Moved Varchar(25),

Feeder_Type Varchar(20),

Food Varchar(60),

Described_By Varchar(40),

Year_Described Number(4),

Update_Date Date

);

-- add DINOSAURS table constraint to DINO_FEEDER table

Alter table Dinosaurs

ADD (CONSTRAINT Feeder

FOREIGN KEY (FEEDER_TYPE)

REFERENCES DINO_FEEDER(FEEDER));

-- add DINOSAURS table constraint to DINO_PERIOD table

Alter table Dinosaurs

ADD (CONSTRAINT Time_Period

FOREIGN KEY (PERIOD)

REFERENCES DINO_PERIOD(PERIOD));

 

/* Insert 3 records into DINO_FEEDER table */

Insert into Dino_Feeder

Values('herbivore', 'An animal that feeds on plants' );

Insert into Dino_Feeder

Values('carnivore','An animal that feeds on the flesh of other animals');

Insert into Dino_Feeder

Values('omnivore','An animal that feeds on anything including both plants and other animals');

/* Insert 5 records into DINO_PERIOD table */

Insert into Dino_Period

Values('Upper Triassic', 'The Triassic Period represents the start of the Mesozoic Era and started about 225 million years ago continuing until about 190 million years ago.' );

Insert into Dino_Period

Values('Lower Jurassic','The Lower Jurassic period started about 190 million years ago');

Insert into Dino_Period

Values('Upper Jurassic','The Upper Jurassic period continued until about 136 million years ago when significant changes occurred.');

Insert into Dino_Period

Values('Lower Cretaceous','The Lower Cretaceous Period started about 136 million years ago ');

Insert into Dino_Period

Values('Upper Cretaceous','The Upper Cretaceous period was the last of the Mesozoic ages terminating in a mass extinction at about 65 million years ago.');

/* Insert 30 records into DINOSAURS table */

Insert into Dinosaurs Values(

'Albertosaurus',

'Alberta lizard',

'Upper Cretaceous',

'between 76 and 74 million years ago',

'Canada',

9,

3.5,

1500,

'2 legs',

'carnivore',

'probably plant-eating dinosaurs',

'Lambe',

1914,

'15-Apr-2004'

);

Insert into Dinosaurs Values(

'Allosaurus',

'other lizard',

'Upper Jurassic',

'between 153 and 135 million years ago',

'USA, Australia and Tanzania',

12,

5,

2000,

'2 legs',

'carnivore',

'Stegosaurus, Diplodocus and others',

'Marsh',

1877,

'16-May-2004'

);

Insert into Dinosaurs Values(

'Archaeopteryx',

'ancient wing',

'Upper Jurassic',

'about 147 million years ago',

'Germany',

0.5,

0.2,

0.5,

'2 legs and by flying',

'carnivore',

'probably small reptiles, mammals and insects.',

null,

null,

'15-Apr-2004'

);

Insert into Dinosaurs Values(

'Baryonyx',

'heavy claw',

'Lower Cretaceous',

'about 125 million years ago',

'England and Spain',

10,

4,

2000,

'2 legs',

'carnivore',

'fish and Iguanodon',

'Charig and Milner',

1986,

'15-Apr-2004'

);

 

etcetera ..

 

 

 

To return to the list of examples click here
 


Copyright © Boffin Associates, 2005
Oracle® is a registered trademark of the Oracle Corporation 
Microsoft®,  Excel®  and Access® are registered trademarks of Microsoft Corporation