|
Posted by Eric Robinson on 10/07/47 11:26
Hi all,
I'm having real trouble wrapping my newbie brain around this problem. Can
someone please tell me the most efficient (or any!) way to write a SELECT
statement to return a set of rows from 5 tables:
These tables are part of our medical database. For example, a person seeking
healthcare may want to know the names and contact information for all
doctors in Reno, NV, who do cardiology. Sounds simple, but it isn't.
A medical group can have many doctors.
A doctor may be a member of more than one medical group.
A doctor or group can have multiple specialties.
A group can have multiple facilities (physical locations).
So the tables look like this...
Table: Doctors
---------------
DoctorName
DoctorID
Table: Groups
--------------
GroupName
GroupID
Table: Docs2Groups (provides many-to-many relationship between Doctors and
Groups)
---------------------
DoctorID
GroupID
Table: Specialties (provides many-to-many relationshop between Doctors,
Groups, and Specialties)
-----------------
SpecialtyID
SpecialtyDesc
DoctorID
GroupID
Facilities
---------
FacilityName (provides one-to-many relationship between Groups and
Facilities)
FacilityID
GroupID
Address
City
State
Zip
Phone
E-mail
Any help would be GREATLY appreciated.
--Eric Robinson
[Back to original message]
|