-
-
Save parzibyte/d96ebd77d2f06282f62456c7a8059658 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS clientes( | |
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
nombre VARCHAR(255) NOT NULL, | |
departamento VARCHAR(255) NOT NULL, | |
edad INT NOT NULL, | |
fecha_registro VARCHAR(10) NOT NULL | |
); | |
CREATE TABLE IF NOT EXISTS ventas_clientes( | |
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
id_cliente BIGINT UNSIGNED NOT NULL, | |
monto DECIMAL(9,2) NOT NULL, | |
fecha VARCHAR(10) NOT NULL, | |
FOREIGN KEY (id_cliente) REFERENCES clientes(id) ON UPDATE CASCADE ON DELETE CASCADE | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment