June 2010
Intermediate to advanced
328 pages
7h 51m
English
The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.
Recently I answered a question that I see frequently, from a software developer trying to prevent duplicate rows. At first I thought he must lack a primary key. But that wasn’t his problem.
In his content management database, he stored articles for publishing on a website. He used an intersection table for a many-to-many association between a table of articles and a table of tags.
| ID-Required/intro/articletags.sql | |
| | CREATE TABLE ArticleTags ( |
| | id SERIAL PRIMARY KEY, |
| | article_id BIGINT UNSIGNED NOT NULL, |
| | tag_id BIGINT UNSIGNED ... |
Read now
Unlock full access