Hello guys i want create a table which willl consist of Regions and Location
therefore when i take a region it should give me a list of locations under that region. i hope my question is clear enough THank you
Am using mysql database
the language am using is Java
Greater Accra Labone,East Legon,Airport
Ashanti Region Kumasi,Amakom,Bantama
i want when i select greater accra, only the locations under greater accra should show. And when Ashanti region is chosen only the locations under Ashanti region should show. i just need help on how to go about it please.
If I were you I would create three tables such as REGIONS, LOCATIONS, and PLACES. The REGIONS table contains 1 column named RegList where in all the regions are listed. In the LOCATIONS table there would be two columns named LocList and RegList wherein the LocList contains all the list of locations or cities and acts as the primary key while in the RegList you can find the region where that location is in. In the Places, There will be two three columns such as PlacesList, LocList, RegIn. PlacesList is the list of all the locations while the LocIn and RegIn are the location and region where a specific place is in. It is in your program where you can connect and redirect one table to another (an input will produce an output that will serve as an input to another matter).
If your Mysql platform is Linux
then first of all you may need to get into your host with its respective username and pass as follows:
open the terminal by pressing ctrl+alt+t and type
mysql -h localhost -u username -p then press on enter
now it will ask for the password and enter the password
Eg: mysql -h localhost -u root -p
Now you could create a database using "create database Tour;" query
and "use Tour" query.