-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.sql
More file actions
135 lines (109 loc) · 3.63 KB
/
database.sql
File metadata and controls
135 lines (109 loc) · 3.63 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 28-02-2023 a las 20:19:26
-- Versión del servidor: 10.4.24-MariaDB
-- Versión de PHP: 8.1.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `videoclub`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `clientes`
--
CREATE TABLE `clientes` (
`idCliente` int(5) UNSIGNED NOT NULL,
`dni` int(11) NOT NULL,
`nombre_completo` varchar(30) NOT NULL,
`telefono` varchar(20) NOT NULL,
`direccion` varchar(50) NOT NULL,
`estado` char(1) NOT NULL DEFAULT 'D' COMMENT 'D=Habilitado | O=Inhabilitado'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla `clientes`
--
INSERT INTO `clientes` (`idCliente`, `dni`, `nombre_completo`, `telefono`, `direccion`, `estado`) VALUES
(1, 12312312, 'rick sanchez', '12312312', 'calle falsa1 123', 'D'),
(2, 23423423, 'morty sanchez', '23423423', 'calle falsa2 234', 'D'),
(3, 34534534, 'test1', '34534534', 'calle falsa 345', 'D'),
(7, 12121212, 'test2', '12121212', 'calle falsa 1212', 'D'),
(8, 5684221, 'pepe argento', '6125129', 'av siempre viva 4124', 'D');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `peliculas`
--
CREATE TABLE `peliculas` (
`idPelicula` int(5) UNSIGNED NOT NULL,
`codigo_de_barras` varchar(20) NOT NULL,
`titulo` varchar(20) NOT NULL,
`genero` varchar(20) NOT NULL,
`estado` char(1) NOT NULL COMMENT 'D=Disponible | P=Prestado',
`idCliente` int(5) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla `peliculas`
--
INSERT INTO `peliculas` (`idPelicula`, `codigo_de_barras`, `titulo`, `genero`, `estado`, `idCliente`) VALUES
(1, '123', 'antman', 'accion', 'D', NULL),
(2, '234', 'avenger 4', 'acción', 'D', NULL),
(3, '345', 'avatar 2', 'ficción', 'D', NULL);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `prestamos`
--
CREATE TABLE `prestamos` (
`idPrestamo` int(5) UNSIGNED NOT NULL,
`idCliente` int(5) NOT NULL,
`idPelicula` int(5) NOT NULL,
`tipoTransaccion` char(1) NOT NULL DEFAULT 'P' COMMENT 'P=Prestamo | D=Devolucion',
`timestamp` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `clientes`
--
ALTER TABLE `clientes`
ADD PRIMARY KEY (`idCliente`);
--
-- Indices de la tabla `peliculas`
--
ALTER TABLE `peliculas`
ADD PRIMARY KEY (`idPelicula`);
--
-- Indices de la tabla `prestamos`
--
ALTER TABLE `prestamos`
ADD PRIMARY KEY (`idPrestamo`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `clientes`
--
ALTER TABLE `clientes`
MODIFY `idCliente` int(5) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT de la tabla `peliculas`
--
ALTER TABLE `peliculas`
MODIFY `idPelicula` int(5) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT de la tabla `prestamos`
--
ALTER TABLE `prestamos`
MODIFY `idPrestamo` int(5) UNSIGNED NOT NULL AUTO_INCREMENT;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;