|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi all,
I have seen many databases that tables with columns such as IsMale,IsFemale,IsNull,Is... All these were somekind of boolean type with yes/no or true/false or 1/0 values.In DBMSs that supports boolean or bit data type it can be implemented naturaly but in Oracle that does not have boolean or bit,people usually use number(1) or char(1) for this purpose. My question: Is this design OK in your opinion? I personally think that this should be design using a relationship with other tables such as HumanSex or...for scalability reasons and so on (Not in fe/male situation! ) Any other ideas are highly appreciated. -Thanks in advance |
|
#2
|
||||
|
||||
|
I would use a mix of number(1) and lookup tables (when there is a greater cardinality) to avoid indexing problems and query mess up, imagine the case of a "true-false" table aliased many times in your query (one for each table that has to be filtered for true/false values).
__________________
My blog Tutorials about OSS databases, DBMonster ... Contribute to OSS Development, fill bug reports! Developer Shed eSupport Commented my.ini/my.cnf (ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins Random data (with a bias) |
|
#3
|
|||
|
|||
|
Thanks pabloj for your reply,
I have problem with these "lookup tables".I have seen people use that in many bad ways and most of time there is a problem in Design.Say more about your understanding from lookup tables,please. I agree with you in case of t/f types,But I feel Is... columns are not essentially columns,they are inference of some relations.What is your opinion on this? -Regards |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Implementation of boolean types. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|