Complete 2024 Web Development Bootcamp
Dr. Angela Yu
SQL Database
SQL Resources
SQL Usage
Before we can use SQL we need to learn what an SQL Database is. SQL is a "Structured" database where you define, in a very precise manner, table structures that hold our data. SQL works off of the C.R.U.D. process which stands for Create, Read, Update, and Destroy. The following link has more info.
Next you will need to install the SQL application you choose to use. For our class we are going to be using PostgreSQL. Many users like MySQL. I will provide links for both.
Once installed we can start creating and manipulating our database. We are going to be utilizing the Basic SQL Reference from W3Schools. Here are the basic steps:
Once a database has been created, we fill it with tables and data records, and then we can edit and manipulate it.
- View Data in a Database Table
- Modify Existing Records within a Table
- Add/Remove Columns to a Table
- Delete Existing Records in a Table
Next we have to learn about creating relationships between tables. This is often done with Primary Keys as the common relationship, but is also done with other table data such as a Customer ID field. However the relationships are built, they are "linked" through the Foreign Key.
Once our relationships are built, and the Primary/Foreign Keys outlined, we need to "JOIN" our table relationships together. There are many types of "joins", but the one most commonly used is inner join.
Here is a link to the database that was built as example in the class for this lesson.
- SQL Demo Project
- SQL Demo Project (local copy)
For further information, please consult the resources listed above.