Created
February 17, 2018 18:08
-
-
Save GreyHat147/73d2480536794aa835a0a0f43978c74e to your computer and use it in GitHub Desktop.
Taller
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 DATABASE Concesionario; | |
CREATE TABLE auto ( | |
matricula int, | |
marca varchar(30), | |
modelo varchar(30), | |
color varchar(30), | |
primary key(matricula) | |
); | |
CREATE TABLE cliente( | |
NIF int, | |
nombre varchar(30), | |
direccion varchar(30), | |
ciudad varchar(30), | |
telefono varchar(30), | |
autoId int, | |
primary key (NIF), | |
foreign key (autoId) references auto(matricula) | |
); | |
CREATE TABLE revision ( | |
filtro varchar(30), | |
aceite varchar(30), | |
frenos varchar(30), | |
cliente_id int, | |
foreign key (cliente_id) references cliente(NIF) | |
); | |
INSERT INTO auto values(9999, "Mercedez", "GGG-300", "Negro"); | |
INSERT INTO auto values(1234, "BMW", "GGG-500", "Gris"); | |
INSERT INTO cliente values(234, "Carlos Rojas", "Calle 26", "Bogota", "234567890", 9999); | |
INSERT INTO cliente values(321, "Laura Rojas", "Carrera 32", "Medellin", "234567890", 1234); | |
INSERT INTO revision values("Martes", "Domingo", "Lunes", 234); | |
INSERT INTO revision values("Miercoles", "Jueves", "Viernes", 321); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment