Periodic Table Database - Build a Periodic Table Database

Hey there,
I am doing the periodic table project and I can not make it pass some test from the ‘Fix the database’ part. This are the three test I can not pass.

  • You should remove all the trailing zeros after the decimals from each row of the atomic_mass column. You may need to adjust a data type to DECIMAL for this. Be careful not to change the value

  • You should add the element with atomic number 9 to your database. Its name is Fluorine, symbol is F, mass is 18.998, melting point is -220, boiling point is -188.1, and it’s a nonmetal

  • You should add the element with atomic number 10 to your database. Its name is Neon, symbol is Ne, mass is 20.18, melting point is -248.6, boiling point is -246.1, and it’s a nonmetal.

The two elements are added in the tables already, I guess the problem is with the first test.
Here is a screenshot of a query which extracts all the data from the properties and elements tables joined:

I cant figure out what is wrong here and why the tests dont pass.
Any help is appriciated. Thank you!

What is your understanding of this requirement?

I guess I am suposed to make all values not to have zeros at the right part of decimals.
As I am said not to change the values, I have set the ‘atomic_mass’ type to NUMERIC(5,3). Like this I removed all zeros I can get rid off until I change the value.
I don’t know if I am right on this or not…

i think numeric(5,3) will still keep some values with trailing zeros because it doesn’t actually trim the trailing zeros (it just limits them to 3)

edit:
try reading this

1 Like