Results 1 to 2 of 2

Thread: Indexing

  1. #1
    Join Date
    Feb 2011
    Posts
    7

    Unanswered: Indexing

    Hi,

    Can somebody help me with Indexing. For e.g. I have a data sheet with

    Airline Name (Col A), Sector Traveled (Col B) and Nett Payable (Col C) and then data in all rows.


    Airline Name Sector Encoded Nett Pay
    Kingfisher Delhi-Bhubaneswar 5633
    Kingfisher Delhi-Bhubaneswar 5633
    Kingfisher Delhi-Bhubaneswar 5633
    Kingfisher Bhubaneswar-Delhi 5383
    Kingfisher Bhubaneswar-Delhi 5383
    Kingfisher Bhubaneswar-Delhi 5383
    Indigo Airlines Bhubaneswar-Delhi 5057
    Indigo Airlines Bhubaneswar-Delhi 5057
    Indigo Airlines Delhi-Bhubaneswar 6073
    Indigo Airlines Delhi-Bhubaneswar 9534
    Kingfisher Kolkata-Raipur 5198
    Jet Airways Raipur-Delhi 4068
    Indigo Airlines Delhi-Bhubaneswar 6373
    Kingfisher Bhubaneswar-Delhi 5383
    Spice Jet Delhi-Gauhati 795
    Kingfisher Delhi-Bhubaneswar 5633
    Kingfisher Bhubaneswar-Delhi 5383
    Jet Airways Delhi-Nagpur 840
    Air India Delhi-Hyderabad 8745
    Indigo Airlines Vadodara-Delhi 3413
    Jet Airways Delhi-Vadodara 7149
    Air India Nagpur-Delhi 4281
    Spice Jet Delhi-Nagpur 4014
    Jet Airways Delhi-Jodhpur 7059
    Kingfisher Mumbai-Bangalore 4709
    Jet Airways Bangalore-Mumbai 3359
    Indigo Airlines Delhi-Ahmedabad-Delhi 8775
    Air India Delhi-Raipur 6222
    Indigo Airlines Delhi-Lucknow-Delhi 1680
    Indigo Airlines Delhi-Bangalore 5705

    How can I create a table which would pick common text (Airline Names) and summarize the Nett Pay??

    Airline Name Nett Pay
    Kingfisher 378041
    Jet Airways 540244
    Go Air 17746

    Regards

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    for this query I'd want an index on airline name

    I'd want to use the 'sum' clause
    I'd want to use the 'group by' clause

    id you want to understand the difference between indexing the airline name column then create the query without the indexes and use the explain prefix before and after creating the index and see what effect it has on the queries performance
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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