Docsity

Final Exam with Resolution - Database Systems | COSC 6340, Exams of Database Management Systems (DBMS)

Toggle sidebar
bg1
Final Exam
COSC 6340 (Data Management)
May 7, 2002
Solution Sketches
Your Name:
Your SSN:
Problem 1 [15]: Relational Database Design
Problem 2 [14]: Internet Computing & XML
Problem 3 [24]: Writing SQL queries & OLAP
Problem 4 [15]: Association Rules
Problem 5 [12]: General Questions
Problem 6 [14]: Object Similarity & Clustering
:
Grade:
The exam is “open books and notes” and you have 145 minutes to complete
the exam.
1
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Final Exam with Resolution - Database Systems | COSC 6340 and more Exams Database Management Systems (DBMS) in PDF only on Docsity!

Final Exam

COSC 6340 (Data Management)

May 7, 2002

Solution Sketches

Your Name:

Your SSN:

Problem 1 [15]: Relational Database Design

Problem 2 [14]: Internet Computing & XML

Problem 3 [24]: Writing SQL queries & OLAP

Problem 4 [15]: Association Rules

Problem 5 [12]: General Questions

Problem 6 [14]: Object Similarity & Clustering

Grade:

The exam is “open books and notes” and you have 145 minutes to complete

the exam.

Relational Database Design [15]

Assume a relation R(A, B, C, D, E) with the following functional dependencies is given: (1) A  BC (2) B  A (3) D  A (4) E  D a) Does BD  CE hold for R? Give reasons for your answer! [4] yes from B->A, use Augmentation, => BD->AD, by Decomposition => BD -> A by Replication rule => BD ->-> A, by MVD Complementation => BD->->CE b) What is (are) the candidate key(s) for R? [1] E c) Transform R into a relational schema that is in BCNF and which does not have any lost dependencies; if this is not possible decompose R into a schema that is in BCNF and has the fewest number of lost functional dependencies. Give the derivation tree for your solution and specify clearly, if and what functional dependencies are lost for a particular relational schema. [10]

ABC, AD, DE

No lost functional dependencies

Details omitted!!

3) Writing SQL Queries & OLAP & Cube Computations [24]

The following relational schema is given: person(ssn, name, education-level, age) , works-for(employee, employer, salary ) and company(C#, c-name, location, sector) with ssn being used as a foreign key for employee in works-for, and C# being used as a foreign key for employer in works-for. You can assume that persons are employed multiple times and receive a salary for each employment. Moreover, you can assume that age is an integer. a) Create a table X(num-of-emp, avg-salary) that gives the average salary that is paid for each employment for persons that have a particular number of employments. For example, if the database contains persons that are employed once, twice, four times, and five times, X would contain 4 tuples specifying the average salary of persons that have 1, 2, 4, and 5 employments. If you prefer you can write a sequence of SQL-queries, instead of a single query, to solve this problem. [10]

Create or replace view X

select ssn, count(*) AS num-of-emp, AVG(sal)

from works-for

group by SSN

select num-of-emp, AVG(sal)

from X

group by num-of-emp

Problem 3 continued b) Now assume want to use OLAP to analyze salaries across dimensions location of the company, and age and education level of a person. Based on the information that can be found in the relations given in step a), define a star schema (graphical representation is enough) that is suitable to do this kind of analysis. Also specify the dimension hierarchies (graphical representation is enough) you would use for the dimensions age and location. [7]

Fact table:

Age Location-Key Education-Key Salary

Dimension table:

Education Education-key “has values none, only_high_school, college, Ba_degree, master_degree, PhD_degree” University “has values univ_degree, no_univ_degree” … Age age age-brackets “has values 0-10, 10-20,…90+” old “has values 0-40 and 40+” Location Location-Key Street City State Country

4) Association Rule Mining [15]

a) Assume you have to apply the APRIORI algorithm assuming that the minimum support is 40% (4 out of 10) to the following set of 10 transactions that involve purchases of items A, B, C, D, E, F, G. T1={A, C, D, E} T6={A, C, D, E} T2={A, D, F} T7={A, B, D, F} T3={D, E, F} T8={A, B, C, D, F} T4={A, B, D, F} T9={A, B, C, E} T5={A, B, F} T10={A, D, E} Describe how Apriori’s Large Item Set Generation algorithm works for the example. List what candidate item sets will be generated in each pass, and which remain in the candidate item set after pruning (use notations of the Han book) [10] Itemset support count {ABF} 4 {ADF} 4 Details omitted!!

b) What is the ‘ Apriori property ’? How is it used by the APRIORI algorithm take advantage of this property make the algorithm more efficient? [5] Apriori property: if a set satisfies min support, then all subset of it also satisfies the min support This property allows speeding up the APRIORI algorithm as follows: a) Item sets for n items can be iteratively computed from item sets that contain n-1 items (an item set containing n items is only a candidate if it is a superset of a frequent item set containing n-1 candidates) b) sets that satisfies min support can be only those subsets from the previous sets. So, if any k-1-element subset of a candidate k itemset is not in Lk-1, it can be removed from CK; this can be used for pruning, avoiding time consuming access to transaction data.

5) Questions [12]

i. Most database systems now support decision tree tools. One key problem in using this technology is to determine the accuracy of a decision tree classifier. What can be done to measure the accuracy of a decision tree classifier? [4] Details omitted. K-fold cross validation, bootstrapping and so on. j. What is data warehousing? How is data warehousing different from approaches that employ wrappers, integrators and mediators? Limit your answer to 4- sentences! [4] Data warehouse is a subject oriented, integrated, time variant and nonvolatile collection of data in support of management’s decision-making process. Data Warehouse Approach: create a separate database by integrating and summarizing data in usually heterogeneous (production) databases. Queries operate on the “data warehouse” database. Mediator Approach: Specify a global query that is decomposed into sets of queries that are executed locally on heterogeneous databases; after the local queries have executed their results have to integrated and presented to the user.