![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm building a database for an application that I'm writing. Because I can't disclose what this program actually does, I'm going to present a similar example. The application has an entity named person. A person has many vehicles. There are many types of vehicles: airplanes, ufos, bicycles, cars, etc... Each vehicle has its own unique attributes that can be unique to each user. I'm wondering how I can easily represent the data in a database. I want to be able to run a query to see what all vehicles a person has and then be able to click on a vehicle and learn the unique attributes that apply to said person. Here's an example. Person Name Address City Vehicles Type Car Transmission Color Max Speed Bicycle Style Height Airplane Wing Span Max Occupancy Now, I want to run a query to see what vehicles Joe has. Once I know what vehicles he has, I can run queries to get more details on each vehicle. What is the "right" way to set this up? I don't want to query every table to figure out if a person has at least one of that vehicle type. I may add more vehicles and thus would have to change my query each time. Any ideas? |
![]() |
| Thread Tools | |
| Display Modes | |
| |