-
Notifications
You must be signed in to change notification settings - Fork 0
/
PuntoVentaDBCreationScript.sql
62 lines (52 loc) · 2.11 KB
/
PuntoVentaDBCreationScript.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema puntoventa
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema puntoventa
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `puntoventa` DEFAULT CHARACTER SET utf8 ;
USE `puntoventa` ;
-- -----------------------------------------------------
-- Table `puntoventa`.`Inventario`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `puntoventa`.`Inventario` (
`idInventario` INT NOT NULL AUTO_INCREMENT,
`codigobarra` VARCHAR(50) NOT NULL,
`descripcion` TEXT NOT NULL,
`cantidad` DOUBLE NOT NULL,
`preciocompra` DOUBLE NOT NULL,
`precioventa` DOUBLE NOT NULL,
PRIMARY KEY (`idInventario`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `puntoventa`.`Movimiento`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `puntoventa`.`Movimiento` (
`idMovimiento` INT NOT NULL AUTO_INCREMENT,
`codigoproducto` VARCHAR(50) NOT NULL,
`tipomov` VARCHAR(45) NOT NULL,
`cantidadvendida` DOUBLE NOT NULL,
`preciototal` DOUBLE NOT NULL,
`usuario` VARCHAR(100) NOT NULL,
`fecha` DATETIME NOT NULL,
PRIMARY KEY (`idMovimiento`, `fecha`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `puntoventa`.`Corte`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `puntoventa`.`Corte` (
`idCorte` INT NOT NULL AUTO_INCREMENT,
`inicioperiodo` DATETIME NOT NULL,
`finperiodo` DATETIME NOT NULL,
`totalcaja` DOUBLE NOT NULL,
`cantidadTot` DOUBLE NOT NULL,
`usuario` VARCHAR(100) NOT NULL,
PRIMARY KEY (`idCorte`))
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;