CREATE TABLE country_polygon AS
SELECT points.country, ST_MakePolygon(ST_MakeLine(ST_MakePoint(points.longitude, points.latitude) ORDER BY points.num)) As geom
FROM points
GROUP BY points.country;
SELECT ST_Contains(geom,point) FROM country_polygon;