help a beginner out please asap

Discussion in 'MySQL' started by blade001, Nov 4, 2011.

  1. #1
    I am doing a database for an assignment:(
    dvd rentals and i know what tables to make but i have no idea what values to put in the foreign keys

    eg.
    create table actor
    (
    actorid int(5) not null auto-increment,
    actorname varchar(255),
    filmid int(5),
    genreid int(5),
    preferenceid int(5),
    primary key (actorid),
    foregin key (filmid) references actor(filmid),
    foregin key (genreid) referenced director(genreid),
    foregin key (peferenceid) referenced director(preferenceid)
    );

    insert into actor (actorid, actorname, filmid, genreid, preferenceid)
    values (



    Is the creating table ok??? im NOT looking for a perfect one, and im not sure what to do for the foreign key values, so what do i need to put in???
    thanks;)
     
    blade001, Nov 4, 2011 IP