More SQL fluency! Make sure you put the queries in the exercises file.
-
Create a new database
school
. -
Make another table,
subjects
, that takes in an ID with a serial and a primary key, the subject name (such as Math or Science), and whether or not it's a STEM subject. Insert some subjects that you know, minimum of 5! -
Create a new table,
students
, that takes in an ID with a serial and a primary key, a name, favorite subject that references the subject table's ID, and grade. Add a many students as you want, minimum of 5! -
Add in a NOT NULL constraint to the
students
columns, except for favorite subject. -
Write a query that shows which subject is the most favored by students.
-
Write a query that shows the number of subjects that are STEM, and the number of subjects that are not STEM.
-
In
students
, add a new column that displays their email. -
Write a query that returns all the student emails who has a grade of your choice.
-
Write a query that returns the longest student name.
-
From the Launch School book, practice all the JOIN exercises, as those are also considered fluency! Build up the fluency for that!