General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>>>Code column seems to identify the product, I think it can be used as PK.
>>
>>A sales invoice might have product codes more than once.
>>So code column can not be used as primary key.
>
>So, what is the key - the invoice_no, product code + date ?
I think no,
Please imagine what will be the primary key if table has data like this
vou_no--code---Product---qty---rate--Amount
---1-------1401----Apple------10----15----150
---1-------1402----mango-----20----15----300
---1-------1401----Apple------10----12----120
---1-------1401----Apple------12----16----180
---1-------1402----mango-----20----13----260
code 1401 was used 3 times due to different rates
code 1402 was used 2 times due to different rates
In this situation, is there any chance to create ID?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only