-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 523f3b2
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
CREATE DATABASE db_sistema_de_rh; | ||
|
||
USE db_sistema_de_rh; | ||
|
||
CREATE TABLE funcionarios( | ||
id BIGINT AUTO_INCREMENT, | ||
nome VARCHAR(255) NOT NULL, | ||
cargo VARCHAR(255) NOT NULL, | ||
admissao DATE NOT NULL, | ||
salario DECIMAL NOT NULL, | ||
ctps INT NOT NULL, | ||
PRIMARY KEY(id) | ||
); | ||
|
||
ALTER TABLE funcionarios MODIFY salario DECIMAL(6,2); | ||
|
||
INSERT INTO funcionarios (nome, cargo, admissao, salario, ctps) | ||
VALUES ("Alessandra", "Professora de Inglês", "2022-07-15", "5000.50", "0083183"), | ||
("Irene", "Chefe de Cozinha", "2015-01-01", "3400.75", "0084721"), | ||
("Igor", "Segurança", "2023-07-15", "3000.00", "0086598"), | ||
("Nayla", "Auxiliar de Inclusão", "2023-01-01", "1500.50", "0089998"), | ||
("Max", "Coordenador do Ensino Médio", "2016-04-15", "8200.30", "0081247"); | ||
|
||
SELECT * FROM funcionarios; | ||
|
||
SELECT * FROM funcionarios WHERE salario < 2000; | ||
|
||
SELECT * FROM funcionarios WHERE salario > 2000; | ||
|
||
UPDATE funcionarios SET salario = 1800.50 WHERE id = 4; | ||
|
||
SELECT * FROM funcionarios; |