show databases;

use nomedadatabase;

create table alunos (

matricula int(12) not null,

nome varchar(80) not null,

sobrenome varchar(80) not null,

diciplina varchar (100) not null,

primary key (matricula)

);

desc nome da tabela;mostra a tabela

alter table aula add decimal(4) null after sobrenome;

alter table alunos change diciplina disciplina varchar (100);

alter table alunnos rename aluno;



insert into alunos (matricula, nome, sobrenome, disciplina, notas)

values (01,'jose','antonio','php',100);

select * from alunos;



crete table empregadoprojeto

(rgempregado in not null,

codprojeto int not null,

horas int,

prmary key (rgempregado,codprojeto));



select d.nome from departamento d, empregadp e where d.coddepto = e.coddepto;

select distinct d.nome from departamento d, empregado e where d.coddepto = e.coddepto;

Comandos mysql

  • 1.
    show databases; use nomedadatabase; createtable alunos ( matricula int(12) not null, nome varchar(80) not null, sobrenome varchar(80) not null, diciplina varchar (100) not null, primary key (matricula) ); desc nome da tabela;mostra a tabela alter table aula add decimal(4) null after sobrenome; alter table alunos change diciplina disciplina varchar (100); alter table alunnos rename aluno; insert into alunos (matricula, nome, sobrenome, disciplina, notas) values (01,'jose','antonio','php',100); select * from alunos; crete table empregadoprojeto (rgempregado in not null, codprojeto int not null, horas int, prmary key (rgempregado,codprojeto)); select d.nome from departamento d, empregadp e where d.coddepto = e.coddepto; select distinct d.nome from departamento d, empregado e where d.coddepto = e.coddepto;