Write an equivalent query in the relational algebra

Assignment Help Basic Computer Science
Reference no: EM131064836

When tuning SQL code, use the following tools. (must be done on oracle express, and include a separate word document with the SQL statements. Include sql file and word document at the end please)

The following settings turn on the execution plan output.

SET AUTOTRACE ON;
SET SERVEROUTPUT ON;
SET TIMING ON;
Set AUTOTRACE to TRACEONLY for queries with voluminous output.
This query lists the current indexes.

SELECT c.index_name, c.table_name, c.column_name, i.index_type

FROM User_Ind_Columns c, User_Indexes i
WHERE c.index_name = i.index_name;
The index types are all set to "normal", the default B-tree; OracleXE doesn't support bitmapped indexes. You can deactivate/activate the indexes using the following command.
ALTER INDEX indexName [INVISIBLE, VISIBLE];
You can create/drop indexes using the following commands.
[CREATE, DROP] INDEX IndexName ON Tablename(fieldList);
You can execute code multiple times using the following anonymous code block.

DECLARE
dummy INTEGER;
BEGIN
FOR i IN 1..1000 LOOP
YourSelectCommand;
END LOOP;
END;
/

With this rather large database in place and these helpful tools, do the following exercises.

Exercise 4.1

Create a view that for the CPDB "birthday czar", which includes each person's full name, age (using

TRUNC(MONTHS_BETWEEN(SYSDATE, birthdate)/12) ) and birthdate (only), and then try the following.

Retrieve the GenX people from the database (i.e., those born from 1961-1975);

Update the Person base table to include a GenX birthdate for some person who had a NULL birthdate before and then re-run your query on the view from the previous question. Do the results of the view query change? Why or why not?

Try to insert a new person using your new view. If this doesn't work, explain (but do not implement) the modifications you'd have to make to your view so that it does. Be sure that you understand what is required for a view to be updateable and what happens to the fields of the inserted record in the base table not included in the view.

DROP your new view - does this affect your base tables in any way?

Exercise 4.2

Do the following for the query on which the view in the previous exercises is based.

Write an equivalent query in the relational algebra

Reference no: EM131064836

Questions Cloud

In a survey of students at a local college : In a survey of students at a local college it was decided to give part-time students twice the chance of selection because of the smaller numbers involved and the diversity of their study patterns.
Firm has a debt issue outstanding : Drogo, Inc., is trying to determine its cost of debt. The firm has a debt issue outstanding with 16 years to maturity that is quoted at 105 percent of face value. The issue makes semiannual payments and has an embedded cost of 10 percent annually. Wh..
Calculate the p-value of the observed sample proportion : State an appropriate null hypothesis and alternative hypothesis for her to consider as the framework for a one-proportion z-test. Calculate the p-value of the observed sample proportion
What is the price of the bill as a percentage of face value : A Treasury bill purchased in December 2015 has 140 days until maturity and a bank discount yield of 1.87 percent. Assume a $100 face value. What is the price of the bill as a percentage of face value?
Write an equivalent query in the relational algebra : Write an equivalent query in the relational algebra
Change the health and doctor-vising habits of individuals : HSAs are gaining in popularity as employers and insurers see them as viable options for shifting the cost of care back to patients. Do you believe that HDHP/HSA plans will change the health and doctor-vising habits of individuals? What about people's..
What is the portfolio expected return : Consider the following information about three stocks: State of Probability of Rate of Return if State Occurs Economy State of Economy Stock A Stock B Stock C Boom 0.3 0.2 0.25 0.60 Normal 0.45 0.15 0.11 0.05 Bust 0.25 0.01 -0.15 -0.50 a. What are th..
Why is self-awareness important for being a good manager : Why is self-awareness important for being a good manager? Describe some negative consequences that might result from a manager with low self-awareness.
Confidence interval for the average number of chips : Create a 95% confidence interval for the average number of chips. Is your confidence interval at all consistent with Nabisco's advertising claim, or does it make it seem unlikely

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd