I do EAD for a bank and have very little material to help me do my activities. I have this question to solve, if anyone can help me or help me with some study material path I am very grateful.
Create a stored procedure call sp_generate_quartos
which generates a load of 10 new rooms from each of the 4 existing room types. As for room numbers, they should be random according to the following rule:
Tipo de Quarto Número do Quarto
1 Entre 1000 e 1999
2 Entre 2000 e 2999
3 Entre 3000 e 3999
4 Entre 4000 e 4999
In script , in the meantime, it should be done in such a way that if it is created a fifth room type, script would generate 10 rooms for it also, between the intervals of 5000 and 5999, and thus on.
TABLE ROOM TYPE
CREATE TABLE tb_tipo_quarto
(
cd_tipo_quarto TINYINT NOT NULL AUTO_INCREMENT,
nm_tipo_quarto VARCHAR(50) NOT NULL ,
vl_tipo_quarto_diaria NUMERIC(7,2) NOT NULL,
PRIMARY KEY(cd_tipo_quarto)
) ;