If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Newbie SQL Help on Indexes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-30-03, 00:38
smarque1 smarque1 is offline
Registered User
 
Join Date: Sep 2003
Posts: 14
Newbie SQL Help on Indexes

Hello!

Need some help on this 2 part question dealing with indexes. The table structure is below. Any help or suggestions would be appreciated. - Thanks for your time

1.) Create and index (call it OWED) using AMTOWED on ENAME.

------- I have entered the following code:

SQL> CREATE INDEX index_owed
2 ON employee(amtowed, ename);

Index created.

2.) Create an index (call it DOCEMP) on two concatenated columns DNAME and EMPNO. Make sure that each tuple in EMPLOYEE is unique with respect to theconcatenated columns.

--------The trouble i have here is the code for the concatenated column and placing the distinct clause so there are no dups.

SQL> DESC employee;
Name Null? Type
----------------------------------------------------- -------- ------------------------------------
DNAME VARCHAR2(20)
EMPNO NUMBER(3)
ENAME VARCHAR2(20)
ADDRESS VARCHAR2(30)
AMTOWED NUMBER(5)
Reply With Quote
  #2 (permalink)  
Old 09-30-03, 06:44
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: Newbie SQL Help on Indexes

By "concatenated" it just means an index on the 2 columns (same as question 1). Use "CREATE UNIQUE INDEX" to ensure no duplicate entries.
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On