WHAT I WANT TO ACHIEVE
=> Create an ANDROID app that shows the list of car manufacturers and the type of models they make. So when the user opens the app they see list of manufacturers. (ALL THIS DATA WILL BE LOADED FROM A DATABASE)
Like
1.Toyota
2.GMC etc..
So when they click on Toyota they will see the different cars Toyota makes (BY LOADING THEM FROM DATABASES). There would be sequence of screens displaying the different models .
SCREEN 1: Toyota Camry[A PICTURE , LITTLE DETAIL , AND A (VIDEO OR AUDIO) ]
SCREEN 2: Toyota Carina II[SAME THING HERE, (VIDEO OR AUDIO) , PICTURE AND DETAILS ABOUT CAR] etc…
So in each SCREEN there would be some kind of media related to THE CAR MODEL as shown above. A video or an audio promoting the car and some kind of text related to that model.
Now I’m downloading this information and want to save this kind of information of manufacturers and their cars in a database . I just cant come up with a good DB schema that let me safe this kind of data and let me load back to the screens .
–> If you can give me a general database schema like the number of tables I should have etc.. i would really appreciate.
SCHEMA I THOUGHT OF BUT DOESN’T LOOK GOOD
==>MANUFACTURERS TABLE[*MANUFACTURERS _ID , COMPANY_NAME , *MODELS ???HERE WHAT AM I MISSING ??? **]
==>MODELS_TABLE [*MANUFACTURERS _ID , MODEL_ID ,MODEL_NAME*]
==>RELATED MEDIA [*MODEL_ID , VIDEO_LOCATION , AUDIO_LOCATION , DETAILS_ABOUT_THE_CAR*]
AS YOU SEE AM JUST NOT GOOD WITH THE DESIGN :/ SO PLEASE HELP , THANKS IN ADVANCE
Any answer to this might be slightly subjective but my personal approach would be as follows…
Two tables called
MANUFACTURERSandMODELS.For the
MANUFACTURERStable I’d have the following columns…For the
MODELStable I’d have the following columns…I’ve used
_idfor both tables as an AndroidCursorneeds a column called_idwhen used withAdapters. Create_idasUNIQUE PRIMARY KEY.I also don’t think it is necessary to have a separate table for the media as it relates directly to each model of car and the data can be included directly in the
MODELStable.I’ve used
descriptionas a generic term instead ofDETAILS_OF_CARand used_urifor the video and audio as it implies the media may be either stored locally or on a network server.Other people might take a different approach but from what you describe this is the way I would do things.