SQLMastery Flashcards
What is a database?
database -
Collection of data stored in a format that can be easily accesssed
How do we manage our databases?
Using a software system -
Database Management System (DBMS)
How?
We connect to a DBMS, give it instructions like query / modify, DBMS executes instructions and sends back results

What two types of Database Management Systems (DBMS) do we have?
Relational and Non-Relational (noSQL)
How is data stored in relational databases?
In tables that are linked to eachother using relationships
Each table stores data about a specific object
SQL is language we use to work with these

What are the popular relational database management systems?
MySQL
SQL Server
Oracle
**all based on standard SQL specification
What is the most popular, open source database management system in the world?
MySQL
Used in this course!
Do noSQL (non relational database management systems) understand SQL?
NO!
NoSQL systems don’t understand SQL
They have their own query language!!
Where was SQL invented?
1970 at IBM
Structured English Query Language
What will we be learning in this course?
SQL (Query language) with MySQL (DB management)
What is covered in this course?
Essential Skills -
Retrieve, insert, update, delete data
(90% will apply to other DBMS)
Core skills -
summarize data, complex queries and subqueries, built in MySQL functions, views, stored procedues
(will apply to other DBMS)
Advanced skills -
triggers, events, transactions, concurrency
Top performer skills -
designing databases (systematic approach), indexing for high performance (speed queries), securing databases (user accounts, privledges)
**if you follow and complete excercise - can use SQL in any project and pass any interview questions
What is the first step to getting data from a database?
Select the database
query will be executed against database

Is SQL a case sensitive language?
No.
However, by convention:
SQL statments are uppercase,
lowercase for everything else

What is the SELECT clause?
Allows us to choose the columns
Select
* - all columns in a table
column_names - certain columns

How do we put a comment in SQL syntax?
double hyphen “ – “

Does order matter when using the SELECT statement (SELECT, FROM, WHERE, ORDER BY)?
Yes, it does:
SELECT – column or *
FROM – table name
WHERE –filter data
ORDER BY – column to order entries
**cannot change the order of these clauses or get syntax error
**FROM, WHERE, ORDER BY ARE OPTIONAL

Can we use arithmetic operators with SQL?
Yes.

How is math executed in SQL?

Using order of operations
If you want to change order, can use parentheses

How can we change the name of a result column?

AS keyword
can give alias
can use ’ ‘ around word if has parentheses
Ex. ‘discount factor’

What is the DISTINCT keyword?

Removes duplicates

What is a SQL excercise?


What is the WHERE clause?

Used to filter data
Conditional Operaters:
>
<
<=
=
!= or <>

What is an excercise using the WHERE statement?


What is the AND operator?
Used to filter data based on multiple conditions
WHERE (condition) AND (condition)
**BOTH Conditions are TRUE

What is the OR operator?
WHERE (condition) OR (condition)
satisfy one condition only!
















































































































































































































































































































































































