Clustering Tables   «Prev  Next»

Sizing Oracle Cluster - Exercise

Creating Hash Cluster

Objective:Create a cluster in the COIN database

Exercise scoring

This exercise is worth a total of 20 points, 10 points for each SQL statement that you complete correctly. You may not receive full credit for the answer if your syntax is only partially correct. Once you complete your answer, submit your answer.

Background/overview

In previous courses, you created tables for the COIN database.
Two of these tables have a master-detail relationship, the LOT table and the COINS_IN_LOT table, so you might want to consider creating a cluster with those two tables. The following is a simplified form of the SQL statements that were used to create these two tables.

CREATE TABLE LOT (auction_id NUMBER, lot_id NUMBER, 
min_prince NUMBER(11,2), winning_bid NUMBER(11,2), 
winning_bidder NUMBER, CONSTRAINT pk_lot PRIMARY KEY 
(auction_id, lot_id));

CREATE TABLE COINS_IN_LOT (auction_id NUMBER, lot_id NUMBER, 
coin_id NUMBER, CONSTRAINT pk_coins_in_lot PRIMARY KEY 
(auction_id, lot_id, coin_id));

As mentioned above, you must consider multiple variables before you create a cluster, such as if the data in the tables will be accessed through a full table scan. Depending on the usage of these tables in your application, you may or may not want to make them a cluster in real life.

Download files

You can download a correct version of the script for this exercise from the Resources page.

Instructions

You will write SQL statements to create a cluster that contains the LOT and COINS_IN_LOT tables.

Hints

You need to go through two separate steps to create the cluster and the tables in the cluster.
You should give the cluster a size of 512 K. The cluster key for this cluster will contain two columns.

Submitting your exercise

Enter your answer in the text area below and click the Submit button when you are ready to submit your answer.