If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > How to do creations of composit and multivalued attributes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-10-10, 10:43
Rashmi.B.K Rashmi.B.K is offline
Registered User
 
Join Date: Sep 2010
Posts: 2
How to do creations of composit and multivalued attributes

Hello!.......I'm studying in 5th sem...I'm working on a DBMS project "Color analysis".....can anyone please tel me how to do creations of composit and multivalued attributes?

Last edited by Rashmi.B.K; 09-11-10 at 03:27.
Reply With Quote
  #2 (permalink)  
Old 09-11-10, 08:56
baburajv baburajv is offline
Registered User
 
Join Date: Feb 2004
Location: Bangalore, India
Posts: 242
could you please elaborate the requirements?
__________________
Cheers....

baburajv
Reply With Quote
  #3 (permalink)  
Old 09-11-10, 12:35
Rashmi.B.K Rashmi.B.K is offline
Registered User
 
Join Date: Sep 2010
Posts: 2
Ya....In my project we have composite & multivalued attributes in tables.....how can we represent these in creation of tables???can we do this in MySql 5.0????

Last edited by Rashmi.B.K; 09-13-10 at 07:45.
Reply With Quote
  #4 (permalink)  
Old 09-15-10, 06:08
baburajv baburajv is offline
Registered User
 
Join Date: Feb 2004
Location: Bangalore, India
Posts: 242
if i understand the requirement correctly, my suggestion is to go for an INT column where each bit represents a specific value.

consider the following example of colors

R G B Numeric Value
1 1 1 7
1 1 0 6
1 0 1 5
1 0 0 4
0 1 1 3
0 1 0 2
0 0 1 1
0 0 0 0

If we have to represent these color combination in a single column,

7 represents the combination where R,B and G are 1 whereas
4 represents the combination where R=1 and G and B are 0s.

If we define the bit positions for each of the composite attributes, a BIT wise OR of values can be stored in the column which represents the combination..

let me know if this solves your problem
__________________
Cheers....

baburajv
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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