Data is stored as "ROW" within standard row tables where as it is stored as "COLUMN" as far as column table is concerned. In a row table, all rows are structured the same way. Data will be unique within a row but would be occurring many times among all rows. In other words, data is duplicated in a row table. In a column table, the table is organized by column instead. Data duplication is replaced by a link to the first data occurrence. This is the data compression. It is performed automatically on column tables.
The following standard create table syntax can create either a row table or a column table by default but you can notice data layout is the same for either table type.
-------- For that particular table definition ------ CREATE TABLE ATABLE ( ID INTEGER, NAME VARCHAR(10), SURNAME VARCHAR(20), DEPARTMENT VARCHAR(30), PRIMARY KEY (ID) ); -- Find out what is the underlying data storage structure -- when the table is defined as column or when it is a row table type.
Row table underlined data storage | Column Table underlined data storage | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|