On Mon, Mar 28, 2011 at 09:59:59AM -0400, Sam Carleton scratched on the wall:
> The system calls for an associative table, a table with two foriegn
> keys to two other tables, allowing for a many to many relationship.
> Is there any way to make the primary key be both the columns?
> 
> CREATE TABLE Invoice_Item_Favorite(
>       Invoice_Item_Id INTEGER,
>       FavoriteId INTEGER,

        PRIMARY KEY ( Invoice_Item_Id, FavoriteId ),

>       FOREIGN KEY(Invoice_Item_Id) REFERENCES Invoice_Item(Invoice_Item_Id),
>       FOREIGN KEY(FavoriteId) REFERENCES Favorite(FavoriteId)
> );

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to