Está en la página 1de 2

# mysql -u root -p

MariaDB [(none)]> create database abarrotes;


ariaDB [(none)]> use abarrotes;
MariaDB [abarrotes]> create table empleado
-> (idempleado int not null auto_increment,
-> correo varchar(200) not null,
-> direccion varchar(200) not null,
-> nombre varchar(30) not null,
-> apellido_paterno varchar(30) not null,
-> apellido_materno varchar(30),
-> primary key (idempleado));
MariaDB [(none)]>
MariaDB [abarrotes]> create table producto
-> (codbarras int not null,
-> nombre varchar (30) not null,
-> fecha_de_expiracion date,
-> fecha_de_entrega date,
-> descripcion varchar(200) not null,
-> primary key (codbarras));
MariaDB [abarrotes]> create table cliente
-> (idcliente int not null auto_increment,
-> correo varchar(200) not null,
-> nombre varchar(30) not null,
-> apellido_paterno varchar(30) not null,
-> apellido_materno varchar(30) not null,
-> telefono varchar(30) not null,
-> direccion varchar(30)not null,
-> primary key (idcliente));
MariaDB [abarrotes]> create table compra
-> (idticket int not null auto_increment,
-> cambio int not null,
-> fecha date,
-> iva int not null,
-> n_cliente int not null,
-> cantidad int not null,
-> pago int not null,
-> primary key (idticket));
MariaDB [abarrotes]> create table proveedor
-> (idproveedor int not null auto_increment,
-> telefono varchar(30)not null,
-> nombre varchar(30) not null,
-> direccion varchar(200) not null,
-> apellido_paterno varchar(30) not null,
-> apellido_materno varchar(30) not null,
-> correo varchar(200) not null,
-> primary key (idproveedor));
MariaDB [abarrotes]> create table departamentos
-> (iddepartamento int not null auto_increment,
-> cantidad_maxima int not null,
-> cantidad_minima int not null,
-> nombre varchar(30) not null,
-> descripcion varchar(200) not null,
-> primary key (iddepartamento));
MariaDB [abarrotes]> create table venta
-> (idventa int not null auto_increment,
-> pago int not null,
-> fecha date not null,
-> n_cliente int not null,
-> n_empleado int not null,
-> primary key (idventa));
MariaDB [abarrotes]> create table marca
-> (idmarca int not null auto_increment,
-> nombre varchar(30) not null,
-> descripcion varchar(200) not null,
-> n_proveedor int not null,
-> primary key (idmarca));

También podría gustarte