Chapter 25. Arrays in SQL

ARRAYS CANNOT BE REPRESENTED directly in SQL-92, but they are a common vendor language extension that became part of SQL-99. Arrays violate the rules of First Normal Form (1NF) required for a relational database, which say that the tables have no repeating groups in any column. A repeating group is a data structure that is not scalar; examples of repeating groups include linked lists, arrays, records, and even tables within a column.

The reason they are not allowed is that a repeating group would have to define a column like a data type. There is no obvious way to JOIN a column that contains an array to other columns, since there are no comparison operators or conversion rules. There is no obvious way to display or ...

Get Joe Celko's SQL for Smarties, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.