Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
n sei o nome (30.10)
--tafera outubro BD, 1D --criando a tabela alunos create table alunos( matricula int primary key, nome varchar(50), classe char(2)); --inserindo valores na tabela alunos insert into alunos values(5599, 'Luna Lovegood', '1D'),(9221, 'Olívio Wood', '1D'),(1408, 'Fred Weasley', '1D'),(8440, 'Ginny Weasley', '1D'), (2922, 'Hermione Granger', '1D'),(3959, 'Lilá Brown', '1D'),(7053, 'Harry Potter', '1D'),(2561, 'Draco Malfoy', '1D'),(7449, 'Pansy Parkinson', '1D'), (7256, 'Ronald Weasley', '1D'); --selecionando tudo da tabela alunos select * from alunos; --alterando dados da tabela alunos, adicionando uma nova coluna alter table alunos add sexo varchar(1); --selecionando tudo da tabela alunos select * from alunos; --atualizando dados da tabela para adicionar os sexos update alunos set sexo = 'F'; update alunos set sexo = 'M' where matricula = 9221; update alunos set sexo = 'M' where matricula = 2561; update alunos set sexo = 'M' where matricula = 1408; update alunos set sexo = 'M' where matricula = 7053; update alunos set sexo = 'M' where matricula = 2561; update alunos set sexo = 'M' where matricula = 7256; --selecionando tudo da tabela alunos select * from alunos; --adicionando mais 4 registros na tabela alunos insert into alunos values(16590,'Antônio de Carvalho','3D','M'),(15987,'Joseane de Oliveira','2D','F'),(25132,'Angelo Siqueira','2D','M'), (16599,'Catarina Peixoto','3D','F') --selecionando tudo da tabela alunos select * from alunos; --deletando o alunos Angelo Siqueira da tabela delete from alunos where matricula = 25132; --selecionando tudo da tabela alunos select * from alunos;
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Tablestudent
viernes_ alumnos
ERROR
Libros
Extracting Id No
bc160401882
MY SQL
Demo
SQL_leetcode
Trim numbers
Please log in to post a comment.