base de datos actualizada
This commit is contained in:
parent
473d7bb9e8
commit
421e4c1613
Interfaz
|
@ -1,8 +1,6 @@
|
||||||
CREATE DATABASE IF NOT EXISTS conticket;
|
CREATE DATABASE IF NOT EXISTS conticket;
|
||||||
USE conticket;
|
USE conticket;
|
||||||
drop table asientos;
|
|
||||||
DELETE FROM asientos;
|
|
||||||
ALTER TABLE asientos AUTO_INCREMENT = 1;
|
|
||||||
|
|
||||||
-- Tabla para almacenar los asientos
|
-- Tabla para almacenar los asientos
|
||||||
CREATE TABLE asientos (
|
CREATE TABLE asientos (
|
||||||
|
@ -10,7 +8,8 @@ CREATE TABLE asientos (
|
||||||
artista VARCHAR(50) NOT NULL, -- Nombre del artista/concierto
|
artista VARCHAR(50) NOT NULL, -- Nombre del artista/concierto
|
||||||
dia INT NOT NULL, -- Día del evento (22, 23, 24)
|
dia INT NOT NULL, -- Día del evento (22, 23, 24)
|
||||||
asiento VARCHAR(10) NOT NULL, -- Identificador del asiento (ej: 1A, 2B)
|
asiento VARCHAR(10) NOT NULL, -- Identificador del asiento (ej: 1A, 2B)
|
||||||
estado ENUM('disponible', 'vendido') DEFAULT 'disponible' -- Estado del asiento
|
estado ENUM('disponible', 'vendido') DEFAULT 'disponible', -- Estado del asiento
|
||||||
|
precio DECIMAL(10, 2) NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
-- Tabla para registrar las ventas
|
-- Tabla para registrar las ventas
|
||||||
|
@ -22,7 +21,3 @@ CREATE TABLE ventas (
|
||||||
FOREIGN KEY (asiento_id) REFERENCES asientos(id)
|
FOREIGN KEY (asiento_id) REFERENCES asientos(id)
|
||||||
);
|
);
|
||||||
|
|
||||||
INSERT INTO ventas (asiento_id, fecha_venta, precio) VALUES
|
|
||||||
(1, '2023-10-01 10:00:00', 100),
|
|
||||||
(2, '2023-10-02 11:00:00', 150),
|
|
||||||
(3, '2023-10-03 12:00:00', 200);
|
|
Loading…
Reference in New Issue