“Whoever gives heed to instruction prospers, and blessed is the one who trusts in the LORD.”
Main Source: Practical SQL: A Beginner’s Guide To StoryTelling With Data by Anthony Debarros (2nd Edition). [Amazon Link]
However, this post will have variations to the text.
This post will focus on creating a database in PostgreSQL using the GUI tool pgAdmin.
PostgreSQL
PostgreSQL is a database management system (DBMS) that lets you “define, manage, and query data stored in databases.” PostgreSQL was created from the POSTGRES project, which has been around for awhile.
While PostgreSQL DBMS comes with a default database, it is good practice to avoid cluttering one single database with multiple unrelated tables.
CLEAR YOUR QUERY
Step 1: I like to clear my query in pgAdmin 4.
How do you clear your query?
Well, there are two ways that I know:
(1) Option #1 – Above your Query Editor, click the downward arrow next to the pencil icon. This will open a dropdown menu. On the dropdown menu, select “Clear Query”.
(2) Option #2 – Use the “Clear Query” shortcut on your keyboard.
“(Alt + Ctrl + L)”
Step 2: CREATE DATABASE
In your Query Editor, insert this SQL command: CREATE DATABASE
You should get an error similar to this:
This error exists because the database is missing it’s name.
Let’s clear the query: (Alt + Ctrl + L).
Now, in the Query Editor, insert this SQL command: CREATE DATABASE testingThisOut;
In reality, as of this writing, the table name is not CASE-SENSITIVE, so capitalization should not matter.
If your creation is successful, you will get this message:
HINT: If you already created the database, you will get this message:
To view your newly created database in the Object Explorer window, you may need to RELOAD your View.
After reloading my view, I can see the newly created database: testingthisout.
“Whoever gives heed to instruction prospers, and blessed is the one who trusts in the LORD.”
Leave a Reply