Volman2014
Volman2014

Reputation: 81

Is a tuple attribute of a different form considered a domain constraint?

Quick question here. Say I have a relation named "Employee". Input into the

"bDate" attribute (birthday) for each tuple of this relation is for example

currently "YYYY-MM-DD" (1988-10-01) which would easily be held by an attribute type of an array

of CHAR's. Would it be considered a domain constraint if the bDate attribute is

input as "01-OCT-88"? My analytical reasoning would be that it wouldn't be,

since this input could be stored easily in an array of CHAR's, yet the form is

different, and flipped around. From a database integrity standpoint, would

different forms such as this be considered a domain constraint?

Upvotes: 0

Views: 61

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1270001

This is a bit long for a comment.

You wouldn't store a bDate as a string of characters. You would store it as a date. Hence, the representation of the date would not make a difference, given that they are both turned into an internal representation.

Storing dates as characters strings has nothing to do with domain constraints. It is just bad practice.

Upvotes: 3

Related Questions