Please any suggestions of how I can insert information in a table(sql). | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Please any suggestions of how I can insert information in a table(sql).

The table client contains (Id,name,age) The table command contains(id,product,price,name) So name it is a foreign key in the command table So how I can insert values in the command table It give me an error because it says that name it is inside the client command.

1st Apr 2020, 4:03 PM
Amal Gil
Amal Gil - avatar
2 Answers
+ 1
Hi, If name in command table it is the reference to client table, so before inserting a record to command table you should insert a value to client table. Then use this value while inserting records to command table. Hope it help you!)
1st Apr 2020, 4:22 PM
Prokop
Prokop - avatar
+ 1
Actually name is in client table Wich is a foreign key in Command table
1st Apr 2020, 4:28 PM
Amal Gil
Amal Gil - avatar