Home
Certification Preparation
Microsoft
SQL Server exams
SQL Question - Constraint
Daniel333
All,
Hi, been a few weeks since I even thought about SQL. It's been slow at work so they wanted me to put some time in studying. (woohoo!) Anyhow, I am learning what a constraint is.
e.g.
RATING CHAR(1) CHECK (RATING IN (A, B,C,D)
I was hoping someone could explain to me, why we have to refer to RATING twice? Is there any logic to this? Would you ever check a constraint against another field than the one the executed the constraint?
thanks,
Find more posts tagged with
Comments
BeaverC32
RATING CHAR(1) specifies that there is a column named RATING, and the data type is a CHAR
CHECK specifies there is a constraint, and the parameters of that constraint are within the ().
RATING IN states that the column RATING must have a value of A, B, C, or D
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Best Of