Lesson 1 Flashcards
SELECT * FROM (7 cards)
Every SQL query you write to pull data will use ____ and ____, which are ____.
Every SQL query you write to pull data will use SELECT
and FROM
, which are SQL clauses.
SQL is / is not case sensitive
SQL is NOT case sensitive
What is a database?
(preview for end of course)
A database is built up of a bunch of different tables that are related together in some way (usually connected with IDs using joins in SQL)
How can you write SQL code so you don’t look like a newbie?
__________________________
Why is this important?
Hint: everything on one line? Write code example and answer
Make sure you don’t type all your queries on one line like this:
SELECT * FROM orders
_______________________________________________________________
Instead:
- Put everything on a new line
- Indent everything that falls under each SQL clause
- So that all the SQL clauses are all the way to the left
SELECT * FROM orders
- This will keep all your SQL queries nice and organized, and make it really easy for someone else to read
How can you pull everything from the orders
table?
(write code)
SELECT * FROM orders
How can you pull the order_id
column from the orders
table?
(write code)
SELECT order_id FROM orders
How can you pull the order_id
, customer_id
, and product_name
columns from the orders
table?
(write code)
SELECT order_id, customer_id, product_name FROM orders