Ver Mensaje Individual
  #23 (permalink)  
Antiguo 16/12/2011, 13:10
dannyalfonzo
 
Fecha de Ingreso: febrero-2011
Mensajes: 18
Antigüedad: 13 años, 2 meses
Puntos: 9
Respuesta: Duda con actualizacion de tabla

CREATE TABLE `categorias` (
`cod_categoria` int(5) NOT NULL,
`desc_categoria` varchar(50) NOT NULL,
PRIMARY KEY (`cod_categoria`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


INSERT INTO `categorias` VALUES (1, 'Sushi');
INSERT INTO `categorias` VALUES (2, 'Sopas');
INSERT INTO `categorias` VALUES (3, 'Ensaladas');
INSERT INTO `categorias` VALUES (4, 'Postres');

CREATE TABLE `productos` (
`nom_pro` varchar(50) NOT NULL,
`cod_pro` int(6) NOT NULL,
`stock` int(11) NOT NULL,
`desc_pro` varchar(3000) NOT NULL,
`precio_unid` int(10) NOT NULL,
`categoria` int(5) NOT NULL,
PRIMARY KEY (`cod_pro`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `productos` (
`nom_pro` varchar(50) NOT NULL,
`cod_pro` int(6) NOT NULL,
`stock` int(11) NOT NULL,
`desc_pro` varchar(3000) NOT NULL,
`precio_unid` int(10) NOT NULL,
`categoria` int(5) NOT NULL,
PRIMARY KEY (`cod_pro`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


INSERT INTO `productos` VALUES ('Sushi 1', 1, 1000, '<p>Texto de ejemplo</p>\r\n<p><strong>Lorem Ipsum</strong> is simply dummy </p>', 80, 1,);
INSERT INTO `productos` VALUES ('ensalada 1', 1, 1000, '<p>Texto de ejemplo 2</p>\r\n<p><strong>Lorem Ipsum</strong> is simply dummy </p>', 80, 3);


y la de pedidos:
CREATE TABLE `pedidos` (
`corelativo` int(11) NOT NULL auto_increment,
`pedido_cod` varchar(100) NOT NULL,
`modo_pago` int(2) NOT NULL,
`cod_estatus` int(11) NOT NULL,
`user_cod` int(11) NOT NULL,
`observasiones` text NOT NULL,
`fecha` datetime NOT NULL,
PRIMARY KEY (`corelativo`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

adicionalmente tengo las tablas de estatus del pedido, la de modos de pagos y la de usuarios