Question 1
A SQL Server LiveReport joins two custom reporting views: Revision(DocumentID, RevisionNo, Bytes), with one row per revision, and ClassAssignment(DocumentID, ClassCode), with one row per document-class assignment. It joins on DocumentID, groups by DocumentID, and calculates SUM(Bytes). A document with two 800-byte revisions and two classifications is reported as 3,200 bytes. The requirement is one row per classified document, counting each revision once. Which correction remains valid when revisions have equal sizes?
Show answer & explanation
Correct answer: D - Use a correlated EXISTS against ClassAssignment instead of the join.