Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask DBMS Expert


Home >> DBMS

Task

Indexing

A user CSCI315 used the following CREATE TABLE statements to create a sample database.

CREATE TABLE ORDERS(
O_ID NUMERIC(10) NOT NULL, /* Unique ID of order */
O_C_ID NUMERIC(10) NOT NULL, /* Customer ID */
O_DATE TIMESTAMP NOT NULL, /* Order date an time */
O_TOTAL NUMERIC(15,2) NOT NULL, /* Total for this order */
CONSTRAINT ORDERS_PKEY PRIMARY KEY (O_ID) );

CREATE TABLE ORDER_LINE(
OL_O_ID NUMERIC(10) NOT NULL, /* Order ID */
OL_ITEM NUMERIC(10) NOT NULL, /* Item name */
OL_QTY NUMERIC(3) NOT NULL, /* Quantity of item */
CONSTRAINT ORDER_LINE_PKEY PRIMARY KEY (OL_O_ID, OL_ITEM),
CONSTRAINT ORDER_LINE_FKEY2 FOREIGN KEY (OL_O_ID)
REFERENCES ORDERS(O_ID) );

(1) Write SELECT statements that implement the following queries.

(i) Find the total number of orders submitted in 2015.

(ii) List all distinct customer IDs (O_C_ID) who submitted the largest number of orders in 2014.

(iii) Find the total number if orders submitted by each customer.

(iv) Find the distinct names of items (OL_ITEM) included in at least one order.

(v) Find the total number of values in a column OL_ITEM.

(vi) Find a name of item ordered with the largest quantity.

(vii) Find the total number of rows in a relational table ORDERS.

(viii) Find the total (O_TOTAL) of all orders in each year.

(2) Write smallest number of CREATE INDEX statement such that each one of the queries listed above is processed through "index-only" computations. It means the indexes must be created in such a way such that there is no need to access the relational tables listed above to find the results of queries and the indexes must be "shared" by the possibly largest number of queries.

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M91560189
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in DBMS

Backgrounda new training organization called abc

Background A new training organization called ABC TechTraining is opening soon and they have approached you to help design their new database. They have just completed the refurbishment of the premises and are now lookin ...

In sql developercreate a table userpermissions provide

IN SQL DEVELOPER Create a table UserPermissions (provide create and insert statements code) Document UserName Policy SYSTEM Menu JDOW W2 USAM Permissions SYSTEM W2 JDOW Form 1040 USAM Policy JDOW W2 SYSTEM Write a PL/SQL ...

Sqlquery 1 how many products have standard price less than

SQL Query 1. How many products have standard price less than 1000? Query 2: Display all attributes for products made of "Cherry" from Product table w/o referring to column names. Query 3: Display all product names having ...

Assignmentqueries functions and triggersdatabase

Assignment Queries, Functions and Triggers Database Systems Aims The aims of this assignment are to: formulate SQL queries; populate an RDBMS with a real dataset, and analyse the data; design test data for testing SQL qu ...

In sql database questions phase-1 in 100 words what steps

In SQL Database Questions: Phase-1 In 100 words, what steps can one take to avoid losing work? Which command is used to save changes to the database? What is the syntax for this command? Phase-2 In 100 words, explain the ...

Question 1 a- consider that you are asked to design an

Question: 1. (a)- Consider that you are asked to design an entity relationship diagram based on the below scenario: A university consists of a number of departments (id, d_name) and each department offers some courses. A ...

Assignmenta restaurant is designing a database to keep

Assignment A restaurant is designing a database to keep track of customer services. A customer is defined as a customer ID, name, address and a telephone number. Customers are served by employees. Each employee is define ...

This is a starting out with visual basic programming

This is a starting out with visual basic programming problem, meaning its a basic programming nothing advanced. Question: Add a linq statement to the combo box text-changed event to dispaly the city field of the selected ...

In this section the student is required to develop a

In this section, the student is required to develop a technical debate based on his/her understanding using available scientific literature. The answer to this question should not exceed three A4 Pages. In the traditiona ...

Database design amp development assignment -assignment

Database Design & Development Assignment - Assignment title - Design and Implement a Relational Database for a local Print and Ink Refill Business. Learning Outcome - Use an appropriate design tool to design a relational ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As