Intro to SQL

Similar to yesterday’s notes, today’s is the DataCamp’s Intro to SQL. This is a course I’ve now taken definitely 3 times and maybe a 4th time. So, this one was tough to get through on a sheer interest level. A lot of videos with multiple choice questions and a small amount of writing code, or queries. Whatever they’re formally called.

You could say this course is the most important as without it would probably be impossible to ever learn SQL. I guess I’m stating the obvious that’s the whole point of any type of intro course. I will say, the SQL courses I’ve already done through data camp have been very easy to through. Yes, they can be challenging with some parts but they’re good courses so far. Want to say I’ve been through the intro and intermediate already. As you can tell, I’m starting over. Certainly have not been consistent enough.

Onto what this chapter covered….

  1. What a relation database is: from what I understand it’s a database that holds multiple tables that all relate to each other. Think an employee database that is broken up into tables of separate departments with employees in those tables. This is kind of where JOINs come into play but that’s a later course. JOINs have caused me problems in the past. Not looking forward to that

  2. Other definitions/best practices: table names are lowercase and you’ll use underscores as your spaces | nothing is ever really plural in your tables either | rows in tables are referred to as ‘records’ and columns ‘fields’

  3. Schema’s are the full overview of a database. They show how tables are connected in a database and what info is in the tables

  4. One thing I noted as we started ‘writing code’ in this chapter is the star in the code below next to SELECT means the entire table will return in the result. That was something that I overlooked when I first did it. Stupid mistake but happened:

    1. SELECT *

    2. FROM table_name_here

  5. Other forms of code: This returns the authors in the table books

    1. SELECT author

    2. FROM books;

  6. You can also use the word DISTINCT after SELECT which brings back unique values. Example: all 7 Harry Potters are in a table. If you write the code below, JK Rowling will only return once. This will just weed out nonsense that you don’t need when using a lot of data

    1. SELECT DISTINCT author

    2. FROM books;

That’s about it from this chapter. Next chapter in the SQL fundamentals skill track in data camp is intermediate SQL which is way more code and also just a longer chapter. The intro took an hour but I was half paying attention and stopped to talk throughout. And again, if any data people stumble along these notes and I’m using the wrong phrasing please correct me. I’m new at this, I’ll get a lot wrong.

Day 2…complete.

-TJ

Previous
Previous

Intro to Python

Next
Next

Intro to Excel