PostgreSQL allows columns of a table to be defined as variable-length multidimensional arrays. Like this:
CREATE TABLE sal_emp
(
name text,
pay_by_quarter integer[],
schedule text[][]
);
Some INSERT statements are as below
INSERT INTO sal_emp
VALUES ('Bill', '{10000, 10000, 10000, 10000}',
'{{"meeting", "lunch"}, {"training", "presentation"}}');
INSERT INTO sal_emp
VALUES ('Carol', '{20000, 25000, 25000, 25000}',
'{{"breakfast", "consulting"}, {"meeting", "lunch"}}');
SELECT * FROM sal_emp;
Output:
name | pay_by_quarter | schedule
-------+---------------------------+-------------------------------------------
Bill | {10000,10000,10000,10000} | {{meeting,lunch},{training,presentation}}
Carol | {20000,25000,25000,25000} | {{breakfast,consulting},{meeting,lunch}}
(2 rows)
How can we achieve the same thing in SQL Server or any alternative to it?
1:n-related side tables... This concept has a lazy smell :-)