Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

basic table relationship question

$
0
0
Just getting started working with primary and foriegn key relationships.  I have a main table called fruitPicking and one of the columns is fruitID (a foriegn key linked to a primary key in a table called fruit).  Anyhow for a single row in the fruitPicking table I need to store more than just one fruitID for a specific day, for example apples and oranges may have been picked that day so for the row in the fruitPicking table I would want to include the foriegn key for both an apple and orange for the same date (date being another field in the fruitPicking table).  Is it correct to just use two rows in the fruitPicking table with the same date, one row with the foriegn key for apple and the next with the foriegn key for orange? Thanks.

Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>