-1
I do bank EAD and have very little material to help me do my activities. I am with this question to resolve, if anyone can help me or help me with some way of study material I am very grateful.
Create a stored Procedure calling for sp_generate_quartos
which generates a load of 10 new rooms from each of the 4 existing room types. For room numbers, it shall 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 the script, in the meantime, it must be done in such a way that, if it is created a fifth type of room, the script would generate 10 rooms for he also, between the ranges of 5000 and 5999, and so on before.
TABLE TYPE ROOM
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)
) ;
What have you done with the query so far? Share your progress so you can be helped...
– Theotonio
I just got the structure of the Stored, the conditions imposed in the statement I don’t know how to do.
– Walter magni marques