Created
August 15, 2022 16:03
-
-
Save thiagoszbarros/40934c712d1152c13ff1207ba0ab6792 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
DROP TABLE IF EXISTS TB_HEROIS; | |
CREATE TABLE TB_HEROIS ( | |
ID INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY NOT NULL, | |
NOME TEXT NOT NULL, | |
PODER TEXT NOT NULL | |
) | |
--create | |
INSERT INTO TB_HEROIS (NOME, PODER) | |
VALUES | |
('Flash', 'Velocidade'), | |
('Batman', 'Dinheiro'), | |
('Super Man', 'Super Força') | |
--read | |
SELECT * FROM TB_HEROIS; | |
SELECT * FROM TB_HEROIS WHERE NOME='Flash'; | |
SELECT ID FROM TB_HEROIS WHERE NOME='Flash'; | |
--update | |
UPDATE TB_HEROIS | |
SET NOME = 'Goku', PODER = 'Super saiyajin' | |
WHERE ID = 1; | |
--delete | |
DELETE FROM TB_HEROIS WHERE ID=2; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment