Bash script for querying PostgreSQL database entirely made from scratch via CLI for freeCodeCamp's Relational Database Certification
-
You should rename the
weight
column toatomic_mass
-
You should rename the
melting_point
column tomelting_point_celsius
and theboiling_point
column toboiling_point_celsius
-
Your
melting_point_celsius
andboiling_point_celsius
columns should not accept null values -
You should add the
UNIQUE
constraint to thesymbol
andname
columns from theelements
table -
Your
symbol
andname
columns should have theNOT NULL
constraint -
You should set the
atomic_number
column from theproperties
table as a foreign key that references the column of the same name in theelements
table -
You should create a
types
table that will store the three types of elements -
Your
types
table should have atype_id
column that is an integer and the primary key -
Your
types
table should have atype
column that's aVARCHAR
and cannot benull
. It will store the different types from thetype
column in theproperties
table -
You should add three rows to your
types
table whose values are the three different types from theproperties
table -
Your
properties
table should have atype_id
foreign key column that references thetype_id
column from thetypes
table. It should be anINT
with theNOT NULL
constraint -
Each row in your
properties
table should have atype_id
value that links to the correct type from thetypes
table -
You should capitalize the first letter of all the
symbol
values in theelements
table. Be careful to only capitalize the letter and not change any others -
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 toDECIMAL
for this. Be careful not to change the value -
You should add the element with atomic number
9
to your database. Its name isFluorine
, symbol isF
, mass is18.998
, melting point is-220
, boiling point is-188.1
, and it's anonmetal
-
You should add the element with atomic number
10
to your database. Its name isNeon
, symbol isNe
, mass is20.18
, melting point is-248.6
, boiling point is-246.1
, and it's anonmetal
-
You should create a
periodic_table
folder in theproject
folder and turn it into a git repository withgit init
-
Your repository should have a
main
branch with all your commits -
Your
periodic_table
repo should have at least five commits -
You should create an
element.sh
file in your repo folder for the program I want you to make -
Your script (
.sh
) file should have executable permissions -
If you run
./element.sh
, it should outputPlease provide an element as an argument.
and finish running. -
If you run
./element.sh 1
,./element.sh H
, or./element.sh Hydrogen
, it should outputThe 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.
-
If you run
./element.sh
script with another element as input, you should get the same output but with information associated with the given element. -
If the argument input to your
element.sh
script doesn't exist as anatomic_number
,symbol
, orname
in the database, the output should beI could not find that element in the database.
-
The message for the first commit in your repo should be
Initial commit
-
The rest of the commit messages should start with
fix:
,feat:
,refactor:
,chore:
, ortest:
-
You should delete the non existent element, whose
atomic_number
is1000
, from the two tables -
Your
properties
table should not have atype
column -
You should finish your project while on the
main
branch. Your working tree should be clean and you should not have any uncommitted changes