SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table alunos( id_aluno int not null primary key auto_increment, ra int not null unique, nome varchar(100) not null, nota decimal(3,1) ); -- show columns from alunos; --visualizando a tabela alunos -- insert into alunos values(null, 3242345, 'julio sou Eu', 5.8); -- insert into alunos values(null, 6767876, 'joão tiro certo', 6.0); -- insert into alunos values(null, 90042349, 'maria da miséria', 7.2); -- insert into alunos values(null, 89700644, 'Jarilene Diacho', 8.3); -- insert into alunos values(null, 432423534, 'jorginho cana braba', 9.0); -- select * from alunos; -- rename table alunos to aluno; -- show tables; --mostra só a tabela aluno. -- alter table aluno add email varchar(40) unique; -- alter table aluno modify email varchar(60) unique; -- alter table aluno change email e_mail varchar(60) unique; -- alter table aluno drop column e_mail; -- antes do insert verificar as caracteristicas das restrições. insert into alunos (id_aluno,ra,nome) values (1,1234,'Marcel'); ALTER TABLE alunos ALTER nome SET DEFAULT 'alunos';
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear