Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Posts
    14

    Unanswered: 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)

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •