here is my suggestion:
Code:
CREATE TABLE restaurants
( id INTEGER NOT NULL PRIMARY KEY
, name VARCHAR(255) NOT NULL
, image VARCHAR(100)
);
CREATE TABLE foodtypes
( id INTEGER NOT NULL PRIMARY KEY
, foodtype VARCHAR(37) NOT NULL
);
CREATE TABLE restaurant_foodtypes
( restaurants_id INTEGER NOT NULL
, foodtypes_id INTEGER NOT NULL
, FOREIGN KEY ( restaurants_id ) REFERENCES restaurants ( id )
, FOREIGN KEY ( foodtypes_id ) REFERENCES foodtypes ( id )
, PRIMARY KEY ( restaurants_id, foodtypes_id )
, INDEX reversi ( foodtypes_id, restaurants_id )
);
i have changed several names in the interest of clarity
the restaurant_foodtypes table is called a many-to-many or association or relationship table
Bookmarks