# Miscellaneous > Database Design >  parent/child table or not?

## marcpirat

hi

i don't know if i should use a parent/child relation.

i  would like to manage ADVERTISEMENT and it's answer...

so i could something like



```
CREATE TABLE ADVERTISEMENT(
  ADVERTISEMENT_ID INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
  TITLE VARCHAR(64) NOT NULL,
  DESCRIPTION VARCHAR(400) NOT NULL,
  STATE_ID  INT NOT NULL
  DATE_CREATION DATE,
  USERS_ID INT
);

CREATE TABLE ANSWER(
  ANSWER_ID INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
  TEXT VARCHAR(400) NOT NULL,
  DATE_CREATION DATE,
  PARENT_ID INT,
  USERS_ID INT
);
```

i will use all field...

or i can use same table like



```
CREATE TABLE ADVERTISEMENT(
  ADVERTISEMENT_ID INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
  TITLE VARCHAR(64) NOT NULL,
  DESCRIPTION VARCHAR(400) NOT NULL,
  STATE_ID  INT NOT NULL
  DATE_CREATION DATE,
  USERS_ID INT,
  PARENT_ID INT
);
```

any suggestion?

thanks

----------


## skhanal

Your second choice does not have all the fields from two tables from first choice, so I am not sure how you can capture all the information in second option.

Is one advertisement supposed to have multiple answers?. If yes, then you should use two tables.

----------


## marcpirat

with second option, some fields are useless (title when a user reply to ads...),  table it's like ads/answer...


in fact

a user publish a ads and other user replie to him privately

example

paul publish an adm

bob reply to this ads
paul reply to bob
bob reply to paul
...
...

mathew reply to this ads
paul reply to mathew
mathew replty to paul
...

on web page, 
paul can see all discution by user...
but users see only their discussions

----------


## marcpirat

any solution?

----------

