· 6 years ago · Apr 05, 2019, 11:28 AM
1create database viajespanda;
2use viajespanda;
3
4create table if not exists usuarios(
5cod int primary key auto_increment not null,
6nombre varchar(50) not null,
7apel1 varchar(50) not null,
8apel2 varchar(50) not null,
9dni varchar(12) not null,
10email varchar(150)not null,
11fnaci date,
12falta date,
13fbaja date,
14edad int,
15sexo varchar(20),
16observaciones long
17);
18
19create table if not exists viajes(
20cod int primary key auto_increment not null,
21titulo varchar(50),
22pais varchar(100),
23tipo varchar (150),
24imagen1 varchar(200),
25imagen2 varchar(200),
26descrip long,
27observ long
28
29);
30
31create table if not exists ventas(
32codu int,
33codv int,
34fecha timestamp default current_timestamp,
35fsalida date,
36fregreso date,
37observ long,
38dto int,
39pax int,
40foreign key (codu) references usuarios(cod),
41foreign key (codv) references viajes(cod)
42);