your table design is fine
define the primary/foreign keys like this --
Code:
create table page
( pid integer not null primary key
, maintitle varchar(60) not null
, maindescription text
, mainphoto varchar(100)
)
create table sub_category
( sid integer not null primary key
, pid integer not null
, foreign key (pid) references page (id)
, subphoto varchar(60)
, subtitle varchar(60)
)
create table sub_category_links
( sid integer not null
, link_url varchar(255) not null
, primary key (sid, link_url)
, foreign key (sid) references sub_category (sid)
, link_title varchar(60)
)
Bookmarks