Re: design a little inventory db
Posted by: pepe pepa
Date: December 02, 2014 01:23AM

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??

Options: ReplyQuote


Subject
Written By
Posted
November 30, 2014 11:34AM
December 01, 2014 09:27AM
Re: design a little inventory db
December 02, 2014 01:23AM
December 03, 2014 12:49AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.