tabela de usuarios SQL

an anonymous user · May 27, 2023
-- create a table
CREATE TABLE professores (
  id INTEGER PRIMARY KEY,
  nome TEXT NOT NULL,
  genero TEXT NOT NULL,
  idade INT,
  disciplina text not NULL
);
-- insert some values
INSERT INTO professores VALUES (1, 'Ryan', 'M', 19, 'portugues');
INSERT INTO professores VALUES (2, 'Joanna', 'F', 16, 'exatas');
INSERT INTO professores VALUES (3, 'Samuel', 'M', 32, 'analista de sistemas');
INSERT INTO professores VALUES (4, 'lucas cauã', 'F', 29, 'informatica');
INSERT INTO professores VALUES (5, 'Larissa', 'F', 21, 'informatica');
INSERT INTO professores VALUES (6, 'jayane', 'F', 23, 'Direito');
-- fetch some values
SELECT nome, idade, disciplina FROM professores WHERE disciplina = 'informatica'
Output
(Run the program to view its output)

Comments

Please sign up or log in to contribute to the discussion.