Skip to content

About

The goal was to create a Bash script that queries a PostgreSQL database to retrieve information about chemical elements.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Periodic Table Database 🔬

This project is part of the Relational Database Certification from freeCodeCamp.
The goal was to create a Bash script that queries a PostgreSQL database to retrieve information about chemical elements.


📌 Features

  • Search elements by:
    • Atomic number
    • Symbol
    • Name
  • Validates user input.
  • Displays detailed information:
    • Atomic number
    • Name
    • Symbol
    • Type (metal, nonmetal, metalloid)
    • Atomic mass
    • Melting point (°C)
    • Boiling point (°C)

🛠️ Technologies Used

  • Bash scripting (user input and queries).
  • PostgreSQL (database management and data storage).
  • Gitpod (for running the PostgreSQL in a virtual machine).

🗄️ Database Structure

The PostgreSQL database is named periodic_table and contains three tables:

elements table

Column Type Description
atomic_number INTEGER (PK) Unique identifier of the element
symbol VARCHAR(2) Chemical symbol (e.g., H, He, O)
name VARCHAR(40) Full element name

properties table

Column Type Description
atomic_number INTEGER Foreign key referencing elements
atomic_mass NUMERIC Atomic mass (amu)
melting_point_celsius NUMERIC Melting point in Celsius
boiling_point_celsius NUMERIC Boiling point in Celsius
type_id INTEGER Foreign key referencing types

types table

Column Type Description
type_id SERIAL (PK) Unique identifier of the type
type VARCHAR Category (metal, nonmetal, metalloid)

🎮 Example Usage

$ ./element.sh H

The element with atomic number 1 is Hydrogen (H). It's a nonmetal, with a mass of 1.008 amu. Hydrogen has a melting point of -259.1 celsius and a boiling point of -252.9 celsius.

About

The goal was to create a Bash script that queries a PostgreSQL database to retrieve information about chemical elements.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages