SQL Recipes
A FREE cookbook for SQL queries and examples
Register FAQ Search Today's Posts Mark Forums Read

General DB Chat If it relates to databases ... write about here.

Go Back   SQL Recipes a FREE cookbook of SQL queries and examples > SQL queries and examples > General DB Chat

Reply
 
LinkBack Thread Tools Search this Thread
  #1 (permalink)  
Old 07-03-2008, 12:11 PM
AriesABCD AriesABCD is offline
Junior Member
 
Join Date: Jul 2008
Posts: 1
AriesABCD is on a distinguished road
Default Adding a constraint

I have a question on adding a constraint to a table.

The following are my tables.

1. Attribute table that will define the attributes
Code:
Attribute
AtId       AtName
1            Age
2            Gender
2. Attribute value table that will store value for attributes
Code:
AttributeValue
AtValId     AtId               AtDesc
1             1                    10 - 20
2             1                    21 - 30
3             1                    31 - 40
4             2                    Male
5             2                    Female
3. User table that will contain list of users and their profile
Code:
User
UserId    User Name         Age   Gender
1           Matt thompson    2        4
Is there any way to set a constraint on the columns Age and Gender of User table to have the values only from attribute table?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:50 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
Copyright (c) 2006-2008 SQL Recipes

1 2 3 4 5 6 7 8