Está en la página 1de 2

create database msisasistencia;

use msisasistencia;

create table Horario (


Id_Hor char (4) not null,
HoEntrada datetime,
MiTolrncia datetime,
HoLimite datetime,
HoSalida datetime,
primary key (Id_Hor)
) engine InnoDB;

create table Rol (


Id_rol char (7) not null,
NomRol varchar (50),
primary key (Id_rol)
) engine InnoDB ;

create table TipoDoc (


IdTipo int not null,
NombreTipo varchar (50),
Serie varchar (3),
Numero_T varchar (5),
primary key (IdTipo)
) engine InnoDB;

create table Distrito (


Id_Distrito char (7) not null,
Distrito varchar (50) not null,
primary key (Id_Distrito)
) engine InnoDB;

create table Pusuario (


Id_Usu char (8) not null,
Nombre_Completo varchar (150),
Avatar varchar (250),
Nom_Usuario varchar (8),
Estado_Usu varchar (15),
Id_rol char (7) not null,
primary key (Id_Usu)
) engine InnoDB;
use CONTROLPERSONAL
go

--alter table PUsuario add Id_Rol char (7)


-- go

Create view V_Usuarios_Roles


As
Select Id_Usu,Nombre_Completo,Password, Avatar,
U.Id_Rol ,U.Estado_USu
From PUsuario U, ROL R
Where U.Id_Rol=R.Id_Rol
Go

Select * from V.Usuarios_Roles


Go
Alter Procedure Sp_Usuario_Login(

También podría gustarte