troubleshooting Question

Primary key in SQL Database

Avatar of czechmate1976
czechmate1976Flag for United Kingdom of Great Britain and Northern Ireland asked on
Oracle DatabaseMicrosoft SQL Server 2005
7 Comments3 Solutions357 ViewsLast Modified:
I am a bit lost in a little SQL problem, to which I need an answer. It will probably be a triviality to you guys. Nevertheless, I am designing a database (it's a uni exercise) and there is a requirement to keep historical data of prices for products. Thus I have a table PRODUCT and table PRODUCTPRICE. Product has a primary key ProdCode. And PRODUCTPRICE has a primary key ProdCode (it's a foreign key as well) and a StartDate. The combination of ProdCode and StartDate would create a PK. An price record with NULL in the EndDate would be the current price of the product. Please let me know if this make sense to you. Ask any subsequent questions if you need more info please. Thank you a lot guys. I am also uploading a diagram of the exercise, if you could please let me know if it makes sense to you. Please remember this is only a database analysis exercise not a real system.
Relational-Model-v2.pdf
ASKER CERTIFIED SOLUTION
ppinon

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros