Hi,
I have used column-based relations a lot in my projects like:
CREATE TABLE `user` (
id INT AUTO_INCREMENT PRIMARY KEY,
usergroup INT
);
CREATE TABLE `usergroup` (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50)
);
however, at work it seems some people do it using table-based relations like this:
CREATE TABLE `user` (
id INT AUTO_INCREMENT PRIMARY KEY
);
CREATE TABLE `usergrouprelation` (
userid INT,
usergroupdid INT
);
CREATE TABLE `usergroup` (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50)
);
and I am wondering here what are the pros and cons of both approach? And what is the official term for this?