Comandos para crear una base de datos y tablas en MySQL

Bamos a usar como ejemplo fracmentos de una base de datos de un cementerio.

Créate database cementerio;

Use cementerio;

Créate table administradores

(Nombre varchar (25) not null,

Apellido varchar (25) not null,

Cedula integer primary key not null references facturas (id_administrativo),

Dirección varchar (30),

Teléfono integer);


Créate table factura

(Nit integer primary key not null,

Cantidad integer not null,

Valor integer not null,

Fecha date not null,

Id_familiar integer not null references familiar (cedula),

Id_administrativo integer not null references administradores (cedula));



Comentarios