My question is if in sqlserver a column can be created by relating two columns of the same table, suppose I have a sales table with the following columns.
Item Price total quantity(price*quantity)
For the total table, it is the result of multiplying price*quantity. Can these two columns (price and quantity) be related to create a third column.
If yes, what is the correct way to do it?
Thank you
When creating the table you can do:
If you already have the table created, you can edit (design in SSMS) the query and put the formula (Price * Quantity) in "Calculated column specification" within the field properties.