Scrib Base de Datos
Scrib Base de Datos
Scrib Base de Datos
-- -----------------------------------------------------
-- Schema bdcontroldeventas
-- -----------------------------------------------------
DROP SCHEMA IF EXISTS `bdcontroldeventas` ;
-- -----------------------------------------------------
-- Schema bdcontroldeventas
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `bdcontroldeventas` DEFAULT CHARACTER SET utf8 ;
USE `bdcontroldeventas` ;
-- -----------------------------------------------------
-- Table `bdcontroldeventas`.`categoria`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `bdcontroldeventas`.`categoria` ;
-- -----------------------------------------------------
-- Table `bdcontroldeventas`.`persona`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `bdcontroldeventas`.`persona` ;
-- -----------------------------------------------------
-- Table `bdcontroldeventas`.`cliente`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `bdcontroldeventas`.`cliente` ;
CREATE TABLE IF NOT EXISTS `bdcontroldeventas`.`cliente` (
`cod_cliente` INT(11) NOT NULL,
`rut_cliente` VARCHAR(20) NOT NULL,
PRIMARY KEY (`cod_cliente`),
CONSTRAINT `cliente_personaFK`
FOREIGN KEY (`cod_cliente`)
REFERENCES `bdcontroldeventas`.`persona` (`cod_persona`)
ON DELETE CASCADE
ON UPDATE CASCADE)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `bdcontroldeventas`.`producto`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `bdcontroldeventas`.`producto` ;
-- -----------------------------------------------------
-- Table `bdcontroldeventas`.`usuario`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `bdcontroldeventas`.`usuario` ;
-- -----------------------------------------------------
-- Table `bdcontroldeventas`.`detalle_venta`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `bdcontroldeventas`.`detalle_venta` ;
-- -----------------------------------------------------
-- Table `bdcontroldeventas`.`historial`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `bdcontroldeventas`.`historial` ;
-- -----------------------------------------------------
-- Table `bdcontroldeventas`.`productoescaneado`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `bdcontroldeventas`.`productoescaneado` ;
-- -----------------------------------------------------
-- Table `bdcontroldeventas`.`productostock`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `bdcontroldeventas`.`productostock` ;
-- -----------------------------------------------------
-- Table `bdcontroldeventas`.`proveedor`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `bdcontroldeventas`.`proveedor` ;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;