| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: 3 value logic. Why is SQL so special?
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
>> 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...
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 and economy.
2) Just as the DBA isn't finished if he includes nulls, he's not finished until he considers the frequent usages of his schemas. Personally, if I had a choice, I would never use all the above attributes as the usual 'key' as massive changes to many tables are needed whenever flights are re-scheduled and this is frequent and common. Better to have some kind of flight assignment table so that most of the app's deal only with a unique assigned internal number, whether most people would call this a surrogate, I don't know.
p Received on Thu Sep 14 2006 - 08:30:47 CDT
![]() |
![]() |