Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started