Question: 3. We have a database of documents. Each document consists of several sections, each section contains several words: Doc (docID, docTitle) -documents Section (docID, secNumber,

3. We have a database of documents. Each document consists of several sections, each section contains several words: Doc (docID, docTitle) -documents Section (docID, secNumber, secTitle) -sections Wordocc (docID, secNumber, word) word occurrences Section (docID)is a foreign key to Doc (docID) Wordocc (docID, secNumber) is a foreign key to Section (docID, secNumber) Each document has at least one section; each section has at least one word. (a) (2 points) write an sQL query that computes for each document the total number of distinct words used in that document. The answer should consist of attributes: document id, document title, and word count. 3. We have a database of documents. Each document consists of several sections, each section contains several words: Doc (docID, docTitle) -documents Section (docID, secNumber, secTitle) -sections Wordocc (docID, secNumber, word) word occurrences Section (docID)is a foreign key to Doc (docID) Wordocc (docID, secNumber) is a foreign key to Section (docID, secNumber) Each document has at least one section; each section has at least one word. (a) (2 points) write an sQL query that computes for each document the total number of distinct words used in that document. The answer should consist of attributes: document id, document title, and word count
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
