2024-04-24 06:44:30 +00:00
|
|
|
create database universidad;
|
|
|
|
drop database universidad;
|
2024-05-21 17:35:35 +00:00
|
|
|
|
2024-04-24 06:44:30 +00:00
|
|
|
CREATE USER 'UserRemoto' @'localhost' IDENTIFIED BY 'password123';
|
2024-05-21 17:35:35 +00:00
|
|
|
|
2024-04-24 06:44:30 +00:00
|
|
|
DROP USER 'UserRemoto'@'localhost';
|
2024-05-21 17:35:35 +00:00
|
|
|
GRANT ALL PRIVILEGES ON universidad.* TO 'UserRemoto'@'LOCALHOST';
|
2024-04-24 06:44:30 +00:00
|
|
|
FLUSH PRIVILEGES;
|
|
|
|
|
2024-05-21 17:35:35 +00:00
|
|
|
|
2024-04-24 06:44:30 +00:00
|
|
|
use universidad;
|
|
|
|
|
2024-05-21 17:35:35 +00:00
|
|
|
create table usuario(
|
2024-04-24 06:44:30 +00:00
|
|
|
id integer auto_increment primary key,
|
2024-05-21 17:35:35 +00:00
|
|
|
nombre varchar(40) not null,
|
|
|
|
apellido varchar(100) not null,
|
|
|
|
matricula varchar(40) not null UNIQUE,
|
|
|
|
contrasena varchar(40) not null,
|
|
|
|
correo varchar(40) not null,
|
|
|
|
nacionalidad varchar(30),
|
|
|
|
tipoSangre varchar(6),
|
|
|
|
fecha_nacimiento date,
|
|
|
|
curp varchar(18),
|
|
|
|
rol varchar(30) not null,
|
|
|
|
idCarrera integer references carrera,
|
|
|
|
inscrito BIT
|
2024-05-06 14:37:54 +00:00
|
|
|
);
|
2024-05-06 14:04:39 +00:00
|
|
|
|
2024-05-21 17:35:35 +00:00
|
|
|
create table carrera(
|
2024-05-14 23:46:43 +00:00
|
|
|
id integer auto_increment primary key,
|
2024-05-21 17:35:35 +00:00
|
|
|
nombre varchar(40),
|
|
|
|
area varchar(40)
|
2024-04-24 06:44:30 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
create table tutor(
|
2024-05-21 17:35:35 +00:00
|
|
|
id integer auto_increment primary key,
|
|
|
|
nombre varchar(40),
|
|
|
|
apellido varchar(40),
|
|
|
|
numeroDeTelefono integer,
|
|
|
|
idUsuario integer references usuario
|
2024-04-24 06:44:30 +00:00
|
|
|
);
|
|
|
|
|
2024-05-21 17:35:35 +00:00
|
|
|
create table documento(
|
2024-04-24 06:44:30 +00:00
|
|
|
id integer auto_increment primary key,
|
2024-05-21 17:35:35 +00:00
|
|
|
titulo varchar(40),
|
|
|
|
archivo blob,
|
|
|
|
idUsuario integer references usuario,
|
|
|
|
valido BIT
|
2024-04-24 06:44:30 +00:00
|
|
|
);
|
2024-05-21 17:35:35 +00:00
|
|
|
create table inscripcion(
|
2024-04-24 06:44:30 +00:00
|
|
|
id integer auto_increment primary key,
|
2024-05-21 17:35:35 +00:00
|
|
|
idUusario integer references usuario,
|
|
|
|
idDocumento integer references documento
|
2024-04-24 06:44:30 +00:00
|
|
|
);
|
|
|
|
|
2024-05-21 17:35:35 +00:00
|
|
|
create table registro(
|
|
|
|
id integer auto_increment primary key,
|
|
|
|
matricula varchar(40),
|
|
|
|
descripcion varchar(100)
|
2024-05-06 06:39:02 +00:00
|
|
|
);
|
|
|
|
|
2024-05-21 17:35:35 +00:00
|
|
|
INSERT INTO carrera (nombre, area) VALUES
|
|
|
|
('Ingeniería de Sistemas', 'Tecnología'),
|
|
|
|
('Medicina', 'Salud'),
|
|
|
|
('Derecho', 'Ciencias Sociales'),
|
|
|
|
('Arquitectura', 'Arte y Diseño'),
|
|
|
|
('Administración de Empresas', 'Negocios'),
|
|
|
|
('Psicología', 'Ciencias Sociales');
|
2024-05-06 14:14:13 +00:00
|
|
|
|
2024-04-24 06:44:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|