There are several ways: you just need to have two numeric columns, one for height, one for weight, and then do the conversion (if necessary) during the display. Another is to create a table “height” and a table “weight”, each of which has a primary key that is associated with another table. Then you can store both English and metric values in these tables (along with any other meta-information you want):
CREATE TABLE height (
id SERIAL PRIMARY KEY,
english VARCHAR,
inches INT,
cm INT,
hands INT // As in, the height of a horse
);
INSERT INTO height VALUES
(1,'4 feet', 48, 122, 12),
(2,'4 feet, 1 inch', 49, 124, 12),
(3,'4 feet, 2 inches', 50, 127, 12),
(3,'4 feet, 3 inches', 51, 130, 12),
....
...
- , , - , ..
CREATE TABLE users (
uid SERIAL PRIMARY KEY,
height INT REFERENCES height(id),
weight INT references weight(id),
sign INT references sign(id),
...
);
4 5 :
SELECT *
FROM users
JOIN height ON users.height = height.id
WHERE height.inches >= 48 AND height.inches <= 60;
:
- "" ( - ) - , !
- HTML select super easy -
SELECT english FROM height ORDER BY inches, . - - (, ), , - .
- (, "" )