Escolar Documentos
Profissional Documentos
Cultura Documentos
create table cliente(num_BI varchar(13) not null PRIMARY KEY, nome varchar(50) not
null, sexo varchar(10) not null, telefone varchar(20) null);
create table servico (id_servico int not null primary key, descricao text not null,
valor float not null);
create table tipo_quarto(id_tipo varchar(20) not null primary key, descricao text
not null, valor float not null);
create table quarto(num_quarto int not null primary key, andar int null, id_tipo
varchar(20) not null foreign key(id_tipo) references tipo_quarto(id_tipo), status_
text not null);
create table reserva(id_reserva int not null primary key, num_BI varchar(13) foreign
key(num_BI) references cliente(num_BI), num_quarto int foreign key(num_quarto)
references quarto(num_quarto), dt_reserva date not null, qtd_dias int not null,
data_entrada date not null, status_ text not null);
create table hospedagem(id_hospedagem int not null primary key, num_BI varchar(13)
foreign key(num_BI) references cliente(num_BI), num_quarto int foreign
key(num_quarto) references quarto(num_quarto), data_entrada date not null,
data_saida date null, status_ text not null);
create table atendimento(id_atendimento int not null primary key, id_servico int
foreign key(id_servico) references servico(id_servico), id_hospedagem int foreign
key(id_hospedagem) references hospedagem(id_hospedagem));
Gerente
USE [master]
GO
CREATE LOGIN [loginGerente] WITH PASSWORD=N'', DEFAULT_DATABASE=[hotel],
CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
USE [hotel]
GO
CREATE USER [_Gerente] FOR LOGIN [loginGerente]
GO
atendente
USE [master]
GO
CREATE LOGIN [loginAtendente] WITH PASSWORD=N'', DEFAULT_DATABASE=[hotel],
CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
USE [hotel]
GO
CREATE USER [atendente] FOR LOGIN [loginAtendente]
GO
atendente
USE [master]
GO
CREATE LOGIN [loginEstagiario] WITH PASSWORD=N'', DEFAULT_DATABASE=[hotel],
CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
USE [hotel]
GO
CREATE USER [estagiario] FOR LOGIN [loginEstagiario]
GO