GA - Fundamentals of Databases & SQL Flashcards

1
Q

What does a Structured Query Language (SQL) do?

A

It is used to communicate with databases to return data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are some of the capabilities of SQL?

A
‣Store and work with with very large amounts
of data (millions or billions of rows). 

‣Impose structure on data

‣Ability to access a dataset to rule them
all, which lots of people can access simultaneously

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When is SQL and Databases commonly used?

A

‣ When there’s lots of data.
‣ When many people need to access the data.
‣ When the data is being updated regularly.
‣ When data needs to be clean and well structured.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does a database do?

A

It houses large amounts of info in the form of data tables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the purpose of a data table?

A

It provides relational information. Those creating a table use columns and rows to arrange the various data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why do databases typically live off your computer on a server (basically a
computer-connected to the internet)?

A

Due to their size and to allow for easier

access.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you download an SQL Query into a file (typically

a .csv)?

A

N/A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the most common forms of SQL?

A
There are a number of implementations of databases, including: 
‣ PostgreSQL (what we will be using)
‣ MySQL
‣ MS SQL
‣ Oracle
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are relational databases?

A

It is when the overall data is broken up into logical sets of
information, with KEYS or IDs enabling linking between tables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is transactional data?

A

It is when large volumes of data are updated frequently. e.g. daily_dog_sales

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is reference data?

A

It is data that rarely changes and is relatively small in volume. e.g. types_of_dog

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the three main clauses used to comm specific request/questions to databases?

A

Select
From
Where

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does the SELECT clause comm?

A

“I WANT THESE COLUMNS”

‣ Allows you to select certain columns from a table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does the FROM clause comm?

A

“FROM THIS DATA TABLE”

‣ Specifies the tables from which the query extracts data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does the WHERE clause comm?

A

“ONLY WHEN THESE THINGS ARE TRUE“

‣ Determines which rows are selected from the tables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does “*” mean in SQL?

A

It stands for “every column”

17
Q

What does SELECT DISTINCT mean in SQL?

A

The SELECT DISTINCT statement is used to return only distinct (different) values.

Inside a table, a column often contains many duplicate values; and sometimes you only want to list the different (distinct) values.

18
Q

What does ORDER BY do in SQL?

A

It sorts your results in an ascending (ASC) or descending (DESC) order, depending on which you choose.

After the ORDER BY is a number or column name that indicates which column you are sorting by; you either leave it blank or place a desc to determine if you will sort ascending (blank) or descending (desc).

19
Q

What do we need to take into acct when you want to implement multiple conditions in SQL?

A

You should consider using the AND, OR, AND CAST clauses

20
Q

What does the AND clause do?

A

It returns TRUE if both conditions are true

21
Q

What does the OR clause do?

A

It returns FALSE if neither condition is true (True if either is true)

22
Q

What does the CAST (field AS type) clause do?

A

It converts the contents of “field” to the specified data type