Home > Blockchain >  How to use one column in two different tables in SQL Server
How to use one column in two different tables in SQL Server

Time:01-31

I have two different tables named product and purchase.

The product table consists of product id, product desc, product cost. Now I want to use the same product id in the purchase table which is present in the product table, so that when I enter the product id I can get all the information regarding the product id from both the tables.

CodePudding user response:

You can use one column in two or more different tables just by using foreign_key constraint. after this. use SQL Joins.

  •  Tags:  
  • Related