
Originally Posted by
oknow
how do I implement an index?
with ALTER TABLE ADD INDEX -- the complete syntax is in da manual

Originally Posted by
oknow
and also the UNIQUE combination userID, movieID.. or is that done in the query?
no, that is best done by making them the primary key --
Code:
CREATE TABLE usermovies
( userid INTEGER NOT NULL
, movieid INTEGER NOT NULL
, PRIMARY KEY ( userid, movieid )
);
a primary key is unique by definition
if you ever need to search which users have a particular movie, you will also need an index on (movieid,userid)
Bookmarks