Answered step by step
Verified Expert Solution
Question
1 Approved Answer
All queries in this question are based on the sample schema shown below. Assume that the tables have many more rows than are shown there.
All queries in this question are based on the sample schema shown below. Assume that the tables have many more rows than are shown there.
There are six tables describing employees, departments, buildings, departments in which an employee works and a percentage of the time for each department managers possibly more than one per department and buildings in which an employee works an employee may have more than one office The primary key of each table is the attribute or attributes in capital letters. The database in which these tables are stored supports hash indexes, B tree indexes, and ISAM indexes. Multiattribute indexes are defined in the order that matches the column order. The primary key index for a table is a clustered hash index on the primary key attributes EMP, BUILDING AND DEPT all have unclustered B tree indexes on their name attributes.
What value will the following SQL query produce if run against our sample data?
SELECT COUNTDISTINCT salary
FROM EMP
WHERE salary AND
startdate OR startdate ;
Consider running the following query against the sample data. What will Johns rank field value be
SELECT DENSERANK OVER ORDER BY salary ASC AS rank,
FROM EMP
WHERE startdate IS NOT NULL
ORDER BY rank;
Consider running the following query against the sample data. How many rows will the query produce that have Field in one or more of their columns?
SELECT division, name, sumbudget
FROM DEPT D
GROUP BY ROLLUPdivisionname
ORDER BY division, name;
Now consider that this company creates a snapshot of the EMP table for every decade called EMP followed by the decade name eg EMP EMP etc. to maintain an historical record of its employees that can be used for reporting and OLAP queries. Once the tables are successfully created, they are never updated again. Almost of the queries used for reporting will involved various range predicates on salary. These new tables need not use the same indexing strategy as the EMP table itself. What would be the most efficient choice for indexing the salary column on the decade tables eg EMP EMP etc.
Choice of :Unclustered B Tree index on salary
Choice of :Clustered Hash index on salary
Choice of :Clustered ISAM index on salary
Choice of :The decade tables should have exactly the same indexes as the EMP table.
Choice of :No indexes will be needed for the decade tables.EID values range from to
BUILDING tuples, pages
BID values range from to
DEPT tuples, pages
DID values range from to
INDEPT tuples, pages
INBUILDING tuples, pages
MANAGESDEPT tuples, pages
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