QuestLab Plataforma Inteligente de Questões
Questão pública

Questão de Informática

FCC - SEFAZ BA - Auditor Fiscal - 2019 • FCC • 2019

Em um banco de dados aberto e em condições ideais há uma tabela chamada Contribuinte cuja chave primária é idContribuinte. Há também uma tabela chamada Imposto cuja chave primária é idimposto. Para criar uma tabela de associação chamada Contribuinte_imposto cuja chave primária é composta pelos campos idContribuinte e idImposto, que são chaves estrangeiras resultantes da relação dessa tabela com as tabelas Contribuinte e Imposto, utiliza-se a instrução SQL
A
CREATE TABLE Contribuinte_Imposto(idContribuinte INT, idImposto INT, PRIMARY KEY (idContribuinte), FOREIGN KEY (idContribuinte) REFERENCES Contribuinte (idContribuinte), PRIMARY KEY (idImposto), FOREIGN KEY (idContribuinte) REFERENCES Contribuinte (idContribuinte));
B
CREATE TABLE Contribuinte_Imposto(idContribuinte INT NOT NULL, idImposto INT NOT NULL, PRIMARY KEY (idContribuinte, idImposto), CONSTRAINT fk1 FOREIGN KEY (idContribuinte) REFERENCES Contribuinte (idContribuinte), CONSTRAINT fk2 FOREIGN KEY (idImposto) REFERENCES Imposto (idImposto));
C
CREATE TABLE Contribuinte_Imposto(idContribuinte INT NOT NULL, idImposto INT NOT NULL, PRIMARY KEY (idContribuinte, idImposto), FOREIGN KEY (idContribuinte) SOURCE Contribuinte (idContribuinte), FOREIGN KEY (idImposto) SOURCE Imposto (idImposto));
D
CREATE TABLE Contribuinte_Imposto(idContribuinte INT NOT NULL, idImposto INT NOT NULL, PRIMARY KEY (idContribuinte, idImposto), FOREIGN KEY (idContribuinte, idImposto) REFERENCES (Contribuinte!idContribuinte, Imposto!idImposto));
E
CREATE TABLE Contribuinte_Imposto(idContribuinte INT NOT NULL, idImposto INT NOT NULL, PRIMARY KEY (idContribuinte, idImposto), FOREIGN KEY (idContribuinte, idImposto) REFERENCES all parents);
Quer responder esta questão e acompanhar seu desempenho?

Entre na QuestLab para responder, acessar a AURA, estatísticas, cadernos, anotações e outros recursos da plataforma.