Benjamin, beautifully put. Thank you both so much.
--Dylan Shea
Benjamin Pflugmann wrote:
> Hi.
>
> It's simply that you can look at (a_id,b_id) as a PRIMARY KEY. You
> don't need an additional, aritificial sequence number ab_id.
>
> CREATE TABLE table_ab (
> a_id INT NOT NULL,
> b_id INT
Hi.
It's simply that you can look at (a_id,b_id) as a PRIMARY KEY. You
don't need an additional, aritificial sequence number ab_id.
CREATE TABLE table_ab (
a_id INT NOT NULL,
b_id INT NOT NULL,
PRIMARY KEY (a_id,b_id),
UNIQUE (b_id,a_id)
)
Replace INT by whatever type seems appropriate
Thanks.
(I don't know where I was coming from with the JOIN stuff, should have gone
to bed hours ago)
However, you don't think I should have the "ab_id" column, which would be the
standard serial primary key for a table. Does a junction entity table not
need it's own record ids? Technically, i
> I'm afraid this borders on sql/db question material vs. specific mysql
> material, but it stems from what I've read in the O'Reilly mysql book.
>
> If I have a db, which has two tables that have about 15 fields each.
>
> and they have a many to many relationship between them. Should I
> a.