Periodic Table: Need help with passing test cases for

Although my program seems to output the right message as suggested by the user stories, it’s unable to pass four test cases for

I don’t know if it’s a problem with my code or something else; but it would be nice if someone could give me input on that :smiley:

Here’s my GitHub for periodic_table.sql and Thanks!

Hey @michaelng-creative - I tried taking a look, hopefully I can help you continue.

First, is your repo up to date with those screen shots? When I first ran your script, I was getting errors:
Screen Shot 2022-08-02 at 8.53.05 AM

It says ‘type is ambiguous’ - I don’t see this in your screen shots, so maybe you resolved it. This is due to your join creating multiple ‘type’ columns, so you have to specify which table you want the column from. e.g. change your query to use types.type.

When I first ran the tests, there were three database related tests not passing. I think you just need to adjust the atomic_mass values to pass all those. I would try and get those passing first.

After that, I removed the title your script prints, and the first script test passed. The script should only output exactly what the test asks for. I will make a note to clarify the user stories or make better tests there.

This is probably enough to get you on the right track, but here’s a few more things I see…

Your script needs to allow three different types of input - as the tests suggest, running ./ 1, ./ H, or ./ Hydrogen should all output the information for Hydrogen. You will need to adjust the way you query the database I think for that.

Lastly, I saw one other issue in the database:
Screen Shot 2022-08-02 at 9.02.36 AM
^ The type_id for all the elements there doesn’t match the actual type.

Let us know if you get stuck again :+1:


Uh oh, you’re right… I think I gotta update my repo (since I did resolve some of those database issues in CodeAlly’s VM when taking the screenshots… Sorry)

Anyway, after removing the line of code that prints the title ~~~Periodic Table~~~ from my script, it passes all four tests… effortlessly!

Thanks Tom! I really appreciate your help; you did a wonderful job :smiley:

1 Like