Knowledgebase

Entity-Relationship Diagram - Can an attribute be null, and be part of composite PK?

Posted by Uncle Mad, 01-27-2011, 11:33 PM
Hello, I've a question on Entity-Relationship Diagram, and i hope someone can help me. I have a zero-many to zero-many relationship between a "Registered User" entity and "Document", where the former views the latter. The viewing date is recorded in the database. 1. If we leave it as it is, when converted into tables, i should have a table that'll contain the userID, documentID, and viewDate. Any problem with this? 2. What if, the system needs to support unregistered users as well, where it'll also account to the total document view count? In this case, the userID cannot be captured. documentID and viewDate will be captured. How can this diagram illustrate this? Can a composite primary key have null attributes? Thanks in advance! Attached Thumbnails  

Posted by Uncle Mad, 01-28-2011, 04:13 AM
It should be noted that no attributes of unregistered users are captured at all, except the document that they viewed and the date of viewing!



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
Liquidweb down ? (Views: 657)
Cpanel or rsync? (Views: 606)
[Urgent]Mysql problem (Views: 517)


Language:

Client Login

Email

Password

Remember Me

Search