Attribute domain

In computing, the attribute domain is the set of values allowed in an attribute.{{citation|title=A Guided Tour of Relational Databases and Beyond|first1=Mark|last1=Levene|first2=George|last2=Loizou|publisher=Springer|year=1999|isbn=9781852330088|page=72|url=https://books.google.com/books?id=CkYpI7QsLlQC&pg=PA72}}.

For example:

Rooms in hotel (1–300)

Age (1–99)

Married (yes or no)

Nationality (Nepalese, Indian, American, or British)

Colors (Red, Yellow, Green)

For the relational model it is a requirement that each part of a tuple be atomic.{{citation|title=Database Management Systems|first=Rajesh|last=Narang|publisher=PHI Learning Pvt. Ltd.|year=2011|isbn=9788120343139|page=70|url=https://books.google.com/books?id=4TRuL7nDsj4C&pg=PT89}}. The consequence is that each value in the tuple must be of some basic type, like a string or an integer. For the elementary type to be atomic it cannot be broken into more pieces. Alas, the domain is an elementary type, and attribute domain the domain a given attribute belongs to an abstraction belonging to or characteristic of an entity.{{clarify|date=March 2024}}

For example, in SQL, one can create their own domain for an attribute with the command

CREATE DOMAIN SSN_TYPE AS CHAR(9);

The above command says: "Create a datatype SSN_TYPE that is of character type with size 9".

References

{{reflist}}

{{DEFAULTSORT:Attribute Domain}}

Category:Type theory

Category:Database theory