SQL - Part 1 Published June 17rd, 2019
SQL stands for Structured Query Language.
SQL describes a "language" that allows us to manipulate databases. With SQL we can create databases, tables and records as well edit/alter and delete/drop them. As there are many different "databases" such as Microsoft's SQL Server and Access. We also have MySQL, PostgreSQL, Db2, Oracle, etc. The SQL language may vary from database to database but the concepts are realatively the same.
Let's discuss briefly what a database is. A database is a collection of data. Let's say that you work at XYZ Company... you might have a XYZ database. That database would be broken down into similar pieces of data called tables. XYZ may have a customer table filled with customer contact information. There may also be an invoice table that contains customer invoices. A parts table would contain the parts that XYZ sells. Finally, each table is filled with records and these records have fields. So, a record in the customer table might contain the fields of Customer Number, Customer First Name, Customer Last Name, Customer Address, City, State, Zip Code, Phone Number, etc. Databases can contain much more than just tables, but for now, just know that.
SQL gives you the ability to look at and/or change and/or delete records in the tables that make up the database.
I'll be using Microsoft SQL Server Management Studio to show SQL in action.
Our first SQL statement
Let's look at our first statement: SELECT FirstName, MiddleName, LastName FROM Person.Person
SELECT is telling us what fields (the highlighted words - FirstName, MiddleName and LastName) we want to display FROM which table (the red words - Person.Person). See how some of the middle names contain NULL? This means that no information was provided. The user simply skipped over the middle name field when filling out the form.
We will expand on this in our next post.