© 2013 All rights reserved.
7

MySQL: Working with coordinates in the database

How to insert coordinates in the database and how to operate with them in MySQL.

mysql

For all examples i have this two simple tables. Both tables contains 3000 rows with data:

The first table has a column ready to save the coordinate values separately, the second table will store the coordinates as POINT.

 

Save coordinates separately

 

This way we all know, we store the longitude and latitude separately with simple sql query: