Rick James Wrote:
-------------------------------------------------------
> DECIMAL(3,2) will hold the numbers you mentioned.
> MySQL will not "enforce" the "0.25 steps".
>
> "cil", etc, should be kept in a separate column.
>
> It sounds like you need one database (CREATE
> DATABASE) with at least one table (CREATE TABLE),
> which will contain several columns.
hi, I have a little idea to startup
first of all, to setup the lenses part I drew a model that can be seen here
http://s25.postimg.org/44385qzvj/diagrama_1.jpg
the tables are
CREATE TABLE IF NOT EXISTS `stocklentes`.`lentes` (
`ID_lente` INT(2) NOT NULL AUTO_INCREMENT ,
`lente` VARCHAR(25) NOT NULL ,
`desc` VARCHAR(45) NOT NULL ,
`Abbe` INT(2) NOT NULL ,
`densidad` VARCHAR(15) NOT NULL ,
`geometrĂa` VARCHAR(15) NOT NULL ,
PRIMARY KEY (`ID_lente`) ,
UNIQUE INDEX `tipo` (`lente` ASC) )
ENGINE = InnoDB
AUTO_INCREMENT = 12
DEFAULT CHARACTER SET = utf8
CREATE TABLE IF NOT EXISTS `stocklentes`.`cilindro` (
`ID_cil` INT(2) NOT NULL AUTO_INCREMENT ,
`cilindro` DECIMAL(5,2) NOT NULL ,
PRIMARY KEY (`ID_cil`) )
ENGINE = InnoDB
AUTO_INCREMENT = 18
DEFAULT CHARACTER SET = utf8
CREATE TABLE IF NOT EXISTS `stocklentes`.`esfera` (
`ID_esf` INT(5) NOT NULL AUTO_INCREMENT ,
`esfera` DECIMAL(5,2) NOT NULL ,
PRIMARY KEY (`ID_esf`) )
ENGINE = InnoDB
AUTO_INCREMENT = 75
DEFAULT CHARACTER SET = utf8
what do you think??