Locations + positions table (schema)

Hi,
I’m wondering if it is a right way
to store locations and positions.


CREATE TABLE `locations` ( 
 `id` int unsigned NOT NULL AUTO_INCREMENT, 
 `parent_id` int unsigned DEFAULT NULL, 
 `zip` int unsigned DEFAULT NULL, 
 `np` varchar(5) DEFAULT NULL, 
 `place` varchar(255) NOT NULL, 
 `lft` int unsigned NOT NULL, 
 `rgt` int unsigned NOT NULL,
 `has_pos` enum('0','1') NOT NULL DEFAULT '0',  
 PRIMARY KEY (`id`), 
 KEY `parent_id` (`parent_id`), 
 KEY `lt` (`lft`), 
 KEY `rt` (`rgt`) 
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8

CREATE TABLE `positions` ( 
 `location_id` int unsigned NOT NULL, 
 `latitude` FLOAT(9,6) NOT NULL, 
 `longitude` FLOAT(9,6) NOT NULL,
 PRIMARY KEY (`location_id`) ,
CONSTRAINT `fk_pos_to_loc` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8

Bye.

How many positions can a location have?

imho mainly because of I couldn’t find a place position.
I think this is the only reason.
On the other hand I could set the field latitude and longitude as default null
and get rid of has_pos.

exactly.

but I think it is handier with 2 or not ?

Why?

Well actually only one so
I think you suggest me only one
table :slight_smile:
but I think it is handier with 2 or not ?