What I need is to take the primary key from the Phone table and insert it into the FK of the Client table. How do I?

Asked

Viewed 52 times

1

CREATE TABLE Cliente (
    id_Cliente INTEGER PRIMARY KEY IDENTITY(1,1),
    nome_Cliente VARCHAR(50),
    fk_ID_Telefone INTEGER
)

CREATE TABLE Telefone (
    id_Telefone INTEGER PRIMARY KEY IDENTITY(1,1),
    fone_Telefone VARCHAR(11)
)
  • when asking a question see how to format it to get more organized.

  • As stated in the answer you can make a insert with select but for that you must specify to which customer that phone belongs. I don’t know if that’s really what you want. Try explaining again what you need and demonstrate through examples.

1 answer

-1


Browser other questions tagged

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