[DAY 96-98] I built a script that gets info from a periodic table database

Hi everyone! Welcome back to another blog where I document the things I learn in web development. I do this because it helps retain the information and concepts through active recall.

On days 96-98, I learned Git and built a periodic table database. 


This content originally appeared on DEV Community and was authored by Thomas Cansino

Hi everyone! Welcome back to another blog where I document the things I learn in web development. I do this because it helps retain the information and concepts through active recall.

On days 96-98, I learned Git and built a periodic table database. 
Image description

I followed through the freecodecamp database course to learn Git. It taught me about making branches to add a feature or fix a bug and merging those branches to the main one to have a good system for version control. This was a good course because Git is used when building projects with a team.
Image description

The next thing I did was a project where I built a periodic table database. This is part 4 out of 5 projects needed to complete to get the database certificate from freecodecamp.
Image description

What I did first is to make a database with 3 tables: elements, properties, and types.

After that, I assigned primary keys for each table:

  • atomic_number for elements and properties table
  • type_id for types table

I also linked the tables with foreign keys:

  • atomic_number to link elements and properties table
  • type_id to link properties and types table

Lastly, I created a bash script that gets information about the chemical elements from the periodic table database. 
Image description
Image description

Example: 

Type in ./element.sh on the terminal.

Next, let’s say I wanna get information about Fluorine. So type in ./element.sh fluorine.

Finally, the terminal will output: 

The element with atomic number 9 is Fluorine (F). It's a nonmetal, with a mass of 18.998 amu. Fluorine has a melting point of -220 celsius and a boiling point of -188.1 celsius.

Anyways, that’s all for now. More updates in my next blog! See you there!


This content originally appeared on DEV Community and was authored by Thomas Cansino


Print Share Comment Cite Upload Translate Updates
APA

Thomas Cansino | Sciencx (2024-08-11T13:58:56+00:00) [DAY 96-98] I built a script that gets info from a periodic table database. Retrieved from https://www.scien.cx/2024/08/11/day-96-98-i-built-a-script-that-gets-info-from-a-periodic-table-database/

MLA
" » [DAY 96-98] I built a script that gets info from a periodic table database." Thomas Cansino | Sciencx - Sunday August 11, 2024, https://www.scien.cx/2024/08/11/day-96-98-i-built-a-script-that-gets-info-from-a-periodic-table-database/
HARVARD
Thomas Cansino | Sciencx Sunday August 11, 2024 » [DAY 96-98] I built a script that gets info from a periodic table database., viewed ,<https://www.scien.cx/2024/08/11/day-96-98-i-built-a-script-that-gets-info-from-a-periodic-table-database/>
VANCOUVER
Thomas Cansino | Sciencx - » [DAY 96-98] I built a script that gets info from a periodic table database. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/08/11/day-96-98-i-built-a-script-that-gets-info-from-a-periodic-table-database/
CHICAGO
" » [DAY 96-98] I built a script that gets info from a periodic table database." Thomas Cansino | Sciencx - Accessed . https://www.scien.cx/2024/08/11/day-96-98-i-built-a-script-that-gets-info-from-a-periodic-table-database/
IEEE
" » [DAY 96-98] I built a script that gets info from a periodic table database." Thomas Cansino | Sciencx [Online]. Available: https://www.scien.cx/2024/08/11/day-96-98-i-built-a-script-that-gets-info-from-a-periodic-table-database/. [Accessed: ]
rf:citation
» [DAY 96-98] I built a script that gets info from a periodic table database | Thomas Cansino | Sciencx | https://www.scien.cx/2024/08/11/day-96-98-i-built-a-script-that-gets-info-from-a-periodic-table-database/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.