Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
FOREIGN KEY
CREATE TABLE colaborador( id_colaborador INT NOT NULL, nome VARCHAR(50) NOT NULL, automovel VARCHAR(20) NOT NULL, placa CHAR(7) NOT NULL, CONSTRAINT PK_colaborador PRIMARY KEY (id_colaborador) ); CREATE TABLE reembolso( id_reembolso INT NOT NULL, id_colab INT NOT NULL, tipo VARCHAR(10) NOT NULL, dt_lanc DATE NOT NULL, PRIMARY KEY (id_reembolso), ); ALTER TABLE reembolso ADD CONSTRAINT PK_colaborador_reembolso FOREIGN KEY (id_colab) REFERENCES colaborador(id_colaborador); INSERT INTO colaborador VALUES (1,'Rafael Rodrigo','Corsa','123esde') INSERT INTO reembolso VALUES (1,1,'KM','08-15-2018') SELECT colaborador.nome AS 'NOME COMPLETO', colaborador.automovel AS 'AUTOMOVEL', colaborador.placa AS 'PLACA', reembolso.id_reembolso AS 'REEMBOLSO', reembolso.tipo AS 'TIPO DE LANÇAMENTO', reembolso.dt_lanc AS 'DATA DO LANÇAMENTO' FROM colaborador INNER JOIN reembolso ON colaborador.id_colaborador = reembolso.id_colab
run
|
edit
|
history
|
help
0
sql6
Recursion and cte
Employee
db2
FIGURA5.1
Task_6_Final
tFuncionario
SQL Server NULL replacement with dynamic value
GKM_JOIN
Library Datebase