I don’t know how to insert nxn tables

Asked

Viewed 119 times

0

CREATE TABLE pacotes 
(
    id INT IDENTITY(1,1) PRIMARY KEY NOT NULL,
    nome VARCHAR(100),
    valor FLOAT,
    percentual_max_desconto TINYINT,
);

CREATE TABLE pontos_turisticos 
(
    id INT IDENTITY(1,1) PRIMARY KEY NOT NULL,  
    id_endereco INT,
    nome VARCHAR(100) NOT NULL,
    FOREIGN KEY (id_endereco) REFERENCES enderecos(id)
);


CREATE TABLE pacotes_pontos_turisticos 
(
    id INT IDENTITY(1,1) PRIMARY KEY NOT NULL,
    id_ponto_turistico INT,
    id_pacote INT ,
    FOREIGN KEY (id_ponto_turistico) REFERENCES pontos_turisticos(id),
    FOREIGN KEY (id_pacote) REFERENCES pacotes(id),
); 

I need to do the INSERT but I don’t know how.

  • what would be "nxn"? cardinality "n.. n", is that it? by the way, is it mysql or sql-server?

  • 1

    n for n second my teacher more I managed to tidy up I needed to make a select within another select.

  • include sights; include packages; establish the relationship between packages and sights when including lines in pacotes_pontos_turisticos

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.