Re: The best way to insert tags in a DB

From: ^Bart <gabriele1NOSPAM_at_hotmail.com>
Date: Mon, 21 Oct 2019 19:04:09 +0200
Message-ID: <qokoe7$15br$1_at_gioia.aioe.org>


> Table 'recipe' contains recipes, one recipe per row. Each row has a unique
> identifier value called 'recipe_id'.
>
> Table 'tag' contains the tags, one tag per row. Each row has a unique
> identifier value called 'tag_id'.

Good idea to set each row of these tables has unique!

> Table 'recipe_tag' contains a list of tags per recipe, one row for each
> unique combination of recipe and tag. This table contains only 'recipe_id'
> and 'tag_id' values, in pairs, with constraints to ensure that no
> recipe_id/tag_id pair is repeated.

Another good idea to have recipe_id and tag_id in pairs!

Thanks! :)

^Bart Received on Mon Oct 21 2019 - 19:04:09 CEST

Original text of this message