dbTalk Databases Forums  

Having Unique Database Field

comp.databases comp.databases


Discuss Having Unique Database Field in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
yancheng.cheok@gmail.com
 
Posts: n/a

Default Having Unique Database Field - 07-22-2007 , 09:42 PM






Hello all, recently, I read a good article from :

http://www.geekgirls.com/databases_from_scratch_3.htm

I have some question in my mind to achieve this.

In Step 11: Test sample data., Participants Table, a student may have
more than one registered activities.

Student ID Activities
----------------------------------------
12 Swimming
12 Jogging
13 Reading
14 Swimming
12 Swimming -> How we can prevent this
duplicated information???

May I know, how I can prevent the last duplicated col. Is there any
rule I can set through SQL command? Or I have to perform this
prevention through my own appplication code?

Thanks!

cheok


Reply With Quote
  #2  
Old   
Tonkuma
 
Posts: n/a

Default Re: Having Unique Database Field - 07-23-2007 , 12:44 AM






On Jul 23, 11:42 am, yancheng.ch... (AT) gmail (DOT) com wrote:
Quote:
In Step 11: Test sample data., Participants Table, a student may have
more than one registered activities.

Student ID Activities
----------------------------------------
12 Swimming
12 Jogging
13 Reading
14 Swimming
12 Swimming -> How we can prevent this
duplicated information???

May I know, how I can prevent the last duplicated col.
By making primary key of Participants Table as (Student)ID and
Activity.



Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.