From the course: Advanced PostgreSQL

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Representing real-world data

Representing real-world data - PostgreSQL Tutorial

From the course: Advanced PostgreSQL

Representing real-world data

Now that we have a basic understanding of working with the geometry data type and we can run simple queries on that data, let's work with some real world data. This will be much more fun. Now I'm going to create a table called UKPlaces. I'm going to drop it if it already exists. And this will contain the location of a few counties in the United Kingdom. First, let me go ahead and select the drop table command and run F5 in order to drop the table if it already exists. Well, it doesn't. So we are all set here. I'll now go ahead and select the command to create this table called UKPlaces. Notice I have a sensor ID that's just a way to uniquely identify the sensors that I've placed across the counties. That's what you should imagine. I have the name of the county, the longitude and latitude of the county, the name of the country that's just going to be the UK and the location of the sensor. That is a column of type geometry. That sensor location is going to hold the point information for…

Contents