Enumerations in Computational Languages
Understand how enumerations are defined and used in different computational languages like JavaScript, SQL, and XML Schema. Learn to implement enumerations as objects in JavaScript with constant properties and how to validate enumeration attributes effectively.
We'll cover the following...
Enumerations in SQL
Unfortunately, standard SQL does not support enumerations. Some DBMS, such as MySQL and Postgres, provide their own extensions of SQL column definitions in the CREATE TABLE statement that define enumeration-valued columns.
A MySQL enumeration is specified as a list of enumeration labels with the keyword ENUM within a column definition, as shown below:
A Postgres enumeration is specified as a special user-defined type that can be used in column definitions:
Enumerations in XML schema
In XML Schema, an enumeration ...