About the address of the store and the nearby subway, the database design of the picture.

addresses are generally composed of specific information of provinces, cities, autonomous regions and counties. Are they stored separately in four fields?
the nearby subway is one-to-many. How do you store it and check the query?
there are also many pictures, similar to subway stations, how do you store them

Mar.18,2021

what I will do is certainly not a standard answer.

provinces, cities and autonomous regions will be divided into three fields, detailed address of the fourth field. It is easy to check, and the input is easy to control. You can use selective input to avoid user mistakes.

there is a many-to-many relationship between the store and the subway, the subway and the store are stored independently, and the third table stores the relationship.

the picture is complicated, but it should be different from the subway. The possibility that the same picture corresponds to two stores is relatively low, while logo may correspond to multiple stores, but logo will only have one per store, and its frequency will be higher than other images. It should be stored in the store information table.
if logo is removed, the picture is a many-to-one relationship, and the external key of the picture table is associated with the store. The store table itself does not save picture information.

in this way, you can locate the store information directly to logo, and check the table to get other pictures when needed.
nearby subway stations are also checked separately.


I will write two tables, one is that the address and the subway are put together, then make a type distinction, and record their longitude and latitude, and the other table is to store shop pictures, so that you can find out that type is all the subway stations nearby according to the longitude and latitude of the store

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf6bea-32028.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf6bea-32028.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?