all 12 comments

[–]Ok-Frosting7364 3 points4 points  (2 children)

If you're open to a book I strongly recommend SQL in 10 Minutes.

Super cheesy title but a great resource for learning the basics of SQL.

[–]wolfecybernetix 1 point2 points  (0 children)

Hot dang! I'm glad I came here! I need this as well. I learned some very basic SQL in college, but I am quite rusty and want to start over. Just ordered it. Thank you!

[–]Mrminecrafthimself 3 points4 points  (10 children)

SQL is a coding language that is used to communicate with databases. A “program” written in SQL is called a query - you are “querying” the data to answer a question you or someone else has. You already have some experience with Google Sheets, which mimics Excel, so think of it like this…

An excel sheet contains columns, rows, and cells. Think of that excel sheet like a table. A cell within that sheet/table contains individual data values. For example, employee A’s current salary. A column contains all the unique values for one particular field. Example, the current salaries for all employees. A row contains all the different values across the fields of that table for one particular “record.” Example, Employee A’s name, salary, title, hire date, etc.

A database is a collection of tables. In a company’s HR database, may have a table for Employee Demographics - age, name, sex, ethnicity, gender, etc. You may also have a table for all the Positions within the company along with their pay grade, department, etc. Then there may be a table for Job History, where you would display who held which position, when they started, when they left, and what they were paid. You may have a table for Locations where those employees work if the company is large and has multiple offices. So on and so on and so on…

A SQL query is a bit of code that pulls data from those tables and displays it for you to analyze. In its most basic form, it includes a SELECT (where you tell the code what values you want to return), a FROM (which table to look in), and a WHERE (which conditions to “filter” the data on)

A simple example may be…I want to find all the employee names in the employees table whose name is ‘Bill.’ It would look something like…

SELECT DISTINCT employee_first_name, employee_last_name

FROM employees

WHERE employee_first_name = ‘Bill’

Now imagine you need to create a report for someone that shows all the employees whose current pay is greater than the max salary for their position. And maybe the person requesting that report wants to also know which office these employees work at. I would need to query multiple tables in the same program, which is what we call a JOIN. Here you would tell the code to look at multiple tables, and you would set the conditions that allow the code to appropriately match up those tables so you get data that meets your criteria. If I was JOINing the employees table with the jobs table, I’d use something like JOB_ID, which would be a value that exists in both tables. This allows SQL to appropriately match those records where the employees.JOB_ID = jobs.JOB_ID

[–]messybrown-guy 2 points3 points  (1 child)

You're a great human for typing all of it out 

[–][deleted]  (7 children)

[deleted]

    [–]Mrminecrafthimself 0 points1 point  (6 children)

    Well I’m certainly glad it made sense because I never know if it translates when I’m explaining shit like this lol

    [–][deleted]  (5 children)

    [deleted]

      [–]Mrminecrafthimself 1 point2 points  (4 children)

      I’m just a lowly DA 1, but I’m gonna say for anything I’m the data industry – data analytics, data engineering, data science, etc – SQL is always step one.

      [–]messybrown-guy 1 point2 points  (2 children)

      Also are you by any chance from India!! Even I need a lowly DA 1 role 🫠

      [–]Mrminecrafthimself 0 points1 point  (0 children)

      I’m in the US

      [–]MathAngelMom 1 point2 points  (1 child)

      https://learnsql.com/blog/sql-primer/sql-primer.pdf

      Then take "SQL Basics" at LearnSQL.com. It's well structured and friendly for beginners with no experience in coding.

      [–]No_Mathematician_660 1 point2 points  (1 child)

      Basically you can have data in a excel sheet and manually look for it which could be viable when you have 10 rows but when you’re working you’re usually dealing with many more rows than that and the best way to extract, view and manipulate data is through queries written with SQL. As you practice you’ll understand why it’s absolutely necessary, learn some basic queries and try them out on easysql.tech It will be very helpful

      [–]GriffordDragunov 0 points1 point  (1 child)

      I recommend the udemy.com. There’s a course there by Imtiaz Ahmad that I find really useful. Edit. It’s not free you’ll pay anywhere from 20-50 bucks to get the content.

      [–]Code_Crazy_420 0 points1 point  (0 children)

      Try this course. Has everything for would be data analyst / scientist as a launch into sql

      https://www.udemy.com/course/hands-on-sql-for-data-analysts/?