Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help to see if script works

Status
Not open for further replies.
Jun 9, 2005
2
US
can someone tell me if script will work in sql. This is for two tables.
create table Gender
(gender smallint not null,
description char(16) not null,
female char (8) not null,
male char(8) not null,
other char(8) not null,
unknown char(10) not null,
primary key (gender) )

create table color
(color smallint not null,
description char(16) not null,
color of hair char(16) not null,
color of eyes char(8) not null,
primary key (color) )

create table people
(people smallint not null,
description char(24) not null,
First Name varchar2(16) not null,
Last Name varchar2(16) not null,
age char(5) not null,
hair char(16) not null,
eyes char(10) not null,
gender char(10) not null,
height varchar2(16) not null,
weight varchar2(16) not null,
primary key (people) )

insert into gender values (1, 'female' );
insert into gender values (2, 'male' );
insert into gender values (3, 'other' );
insert into gender values (4, 'unknown' );
insert into color values (0, 'black' );
insert into color values (1, 'blonde' );
insert into color values (2, 'red' );
insert into color values (3, 'brown' );
insert into color values (4, 'light brown' );
insert into color values (5, 'purple' );
insert into color values (6, 'pink' );
insert into color values (7, 'gray' );
insert into color values (8, 'salt and pepper' );
insert into color values (9, 'dark brown' );
insert into people values (0,'Last Name' );
insert into people values (1,'First Name' );

insert into people values ('Reymond','Ramirez',


 
I am not sure if this is your complete sql but the inserts will fail because you have defined all your columns to be not null and the insert stmt does not provide values for all columns.

Regards,
AA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top