Re: 3 value logic. Why is SQL so special?
Date: Thu, 14 Sep 2006 13:30:47 GMT
Message-ID: <bQcOg.540922$iF6.314593_at_pd7tw2no>
Cimode wrote:
> A simple alternative solution WITHOUT using the god damn NULLS...
> Flight entity is just equivalent to an assumed and recurring plane
> departure being associated to a specific departure airport. 1:N
> cardinality
>
> _DT: departure_time
> _AT: arrival_time
> _ADT: actual departure time
> _AAT: actual arrival time
> _DA: departure_airport
> _AA: arrival_airport
> _ADA: actual departure_airport
> _AAA: actual arrival_airport
> _LN: last name
> _FN: first name
> _DOB: date of birth
>
> Note: I use ONLY concatenated PRIMARY key (no surrogate, never liked
> them)
>
> passenger:
> passenger_LN, passenger_FN, passenger_DOB
> plane_model:
> plane_model (PK), plane_capacity
> plane:
> planeid, plane_model
> book:
> flight_DT, flight_DA, flight_AT, flight_AA, passengerlname,
> passengerfname, passenger_birthdate
> plane_flight:
> planeid, flight_DT, flight_DA, flight_AT, flight_AA
>
> flight:
> flight_DT, flight_DA, flight_AT, flight_AA
>
> plane_departure:
> flight_DT, flight_DA, flight_AT, flight_AA, flight_ADT,
> flight_ADA
> plane_departure_check:
> flight_DT, flight_DA, flight_AT, flight_AA, flight_ADT,
> flight_ADA, passenger_LN, passenger_FN, passenger_DOB
> plane_arrival:
> flight_DT, flight_DA, flight_AT, flight_AA, flight_AAT,
> flight_AAA
>
>
>>From the above logical structure you can pretty much get anything you
> want including:
>
>> How late/early are the planes on current schedules >> If the planes could land at their supposed destination (you may associate a reason for it: BAD WEATHER, HIJACK). You know if the plane actually landed where it was supposed to land or not...You need to create and additional entity for that... >> What plane model should be scheduled to do a flight depending on book counts >> Which passengers did not leave where there were supposed to...
>
> And many other information...
> This is a purely pedagogical case (far from being complete) to
> demonstrate that it is perfectly possible to build some logical design
> in minutes (took me 20 of them) WITHOUT using NULLS...while sticking to
> the God Damn Real World (lazyness) excuse...
I haven't examined all of the above, but:
The main point I'm trying to make here is that much of what WE think
doesn't matter and usually only adds to an inflated cost to make and run
a system. The strictest interpretation of the biz rules (many of which
are well-documented in this case) is the main avenue towards rightness
p Received on Thu Sep 14 2006 - 15:30:47 CEST