19.1. SQL Part 1 - Introduction and Azure Data Studio

Note

As you read through the articles in the SQL lessons, you may find that you want to try out the queries the authors describe. You have access to a database called AdventureWorks2019 if you would like to try out some of these queries. Doing so is additional practice separate from the exercises.

Read the following articles, follow along where instructed:

19.1.1. Introduction to SQL

  1. What is SQL?

  2. What Is a Database?

  3. Learn to write SQL queries in 5 minutes!

  4. Learn to write basic SQL Queries.

  5. SQL Basics — Hands-On Beginner SQL Tutorial Analyzing Bike-Sharing

    1. As you read this article, skip the “Installation and Setup” section.

    2. Stop at the “Join” section.

    3. The article uses SQLite3, while we are using T-SQL. The biggest difference in sytax is that T-SQL uses TOP instead of LIMIT.

Additional Resources

Optional reading:

  1. Glossary: Databases and SQL

  2. SQL Tutorial: Essential SQL For The Beginners

19.1.2. Check Your Understanding

Question

What does SQL stand for?

Question

Why do we use SQL?

Question

Is Microsoft Excel a database?

  1. True

  2. False

Question

How are a Relational Database’s items structured?

Question

What does the * return?

SELECT *
FROM TABLE;

Question

Match the following terms:

Table

Command which is used to retrieve the desired information.

Row

Collection of data.

Column

Known as a tuple/record.

Query

Represents a unique field.

Question

Match the following Keyword with its definition:

WHERE

Filters the data that falls into the defined begin and end value.

SELECT

Sort the data according to the specified column.

FROM

Filter the data according to specified conditions.

BETWEEN

Used to eliminate duplicate data from the specified columns.

ORDER BY

Used to retrieve data from the data table.

DISTINCT

Specify the table name to retrieve data from.

Question

What does the Keyword AS do?

Question

In T-SQL what expression would return the first 50 rows?