Implementing Index Scans (SQL for Data Analytics)

Hi there !
I hope you’re doing good!

I’ve a question about the final project of the SQL course, in the ‘Implementing Index Scans’ part to be more precise. The goal is to create index to perform our queries.

I don’t know why, but I can’t make the question #4 with that answer below

create index ix_ip_where on customers(ip_address) where ip_address = '';

I got the same case with the question #6:
create index ix_jr on customers(suffix)

I tried to remove the indexes but it’s still wrong… do you have any ideas?

Thanks!! :slight_smile:



Hey Jacques!

Hmm I’m not sure why that isn’t working for you - it seems to be working on my end…

Are you checking the tasks in order? If you run \d customers after you complete the fourth task, what do you see? The last three rows (showing the indexes) should look like:

"customers_ip_address_idx" btree (ip_address)
"ix_customers_customer_id" btree (customer_id)
"ix_ip_where" btree (ip_address) WHERE ip_address = ''::text


Hi Lorraine, thanks for getting me back quickly!

Hmm, that’s weird. I started the exercise from scratch. I dropped all the indexes and started replying to the questions in the order.
The index works in the 2nd question but not in the 4th, and the 7th neither. The index seems to be created but the score mark said my reply is not right…

My answer is the same than yours tho:
create index ix_ip_where on customers(ip_address) where ip_address = '';

But I think it worked when I did this exercise for the first time. Do you know if I can delete all my data from this exercise? Do you have an idea about how I can make it in another way? I would really like to get all my progress full accomplished!! :slight_smile:

Thanks again for your time :slight_smile:



Hey Jacques,

I’ve reset your database for this activity so you can start from scratch! Note that, even though some of the tasks are already marked as complete, you’ll have to recreate a generic index based on the IP address column (Task 2) before you attempt to create the detailed index (Task 4) again.

Let me know if you’re still running into issues!


Hi Lorraine,

I hope you’re fine today.

Everything went well, thank you very much for your help again! :slight_smile:



1 Like