Unit 4 Module 4 - SQL and Databses Flashcards

1
Q

What do you call an organized collection of information or data?

A

A Database

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

What do you call a structed database containing tables that are related to eachother?

A

Relational Database

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

What do you call a column where every row has a unique entry?

A

Primary Key

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

What do you call a table that is a primary key in another table?

A

Foreign Key

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

What is a programming language used to create, interect with, and request information from a database?

A

SQL (Structured Query Language)

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

What do you call a request for data from a database table or a combination of tables?

A

Query

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

What do you call a record of events that occur within an organizations system?

A

Log

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

What is the command to access SQL from Linux?

A

sqlite3

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

What 3 ways do Linux and SQL filter data differently?

A

Structure, Joining Tables, Best uses

Structure - SQL offers more structure and tidyness rather than Linux

Joining Tables - SQL allows analysts to join multiple tables together when returning data, Linux does not.

Best uses - Sometimes looking for certain files that aren’t text SQL can’t format it.

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

In SQL, what command indicates which columns to return?

A

SELECT

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

In SQL, what command indicates which table to query?

A

FROM

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

In SQL, what command sorts a specified keyword in a column?

A

ORDER BY

Ex) ORDER BY city;

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

In SQL, what command sorts a specified keyword in a column by descending order?

A

DESC

Ex) ORDER BY city DESC;

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

What will this SQL command do to the columns?

SELECT customerid, city, country
FROM customers
ORDER BY country, city;

A

SQL then sorts the output by country, and for rows with the same country, it sorts them based on city.

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

What do you call selecting data that matches a certain condition?

A

Filtering

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

What do you call a symbol or keyword that represents an operation?

A

Operator

17
Q

What command in SQL indicates there condition for a filter?

A

WHERE

SELECT firstname, lastname, title, email
FROM employees
WHERE title = ‘IT Staff’;

Ex) Want to filter by country?
WHERE country = ‘USA’

18
Q

What command in SQL uses WHERE to search for a pattern in a column?

A

LIKE

19
Q

When filtering in SQL where should you put the ; ?

A

At the end of a query

20
Q

What do you call a special character that can be substituted with any other character? Also, what are they?

A

Wildcard

% and _

21
Q

In order to use the wildcard command ( %, _ ) in SQL , what other command do you need?

A

LIKE

22
Q

What do you call data consisting of numbers?

A

Numeric Data

23
Q

What do you call data representing a date and/or time?

A

Date and time data

24
Q

What operator filters for numbers or dates within a range?

A

BETWEEN

SELECT firstname, lastname, hiredate
FROM employees
WHERE hiredate BETWEEN ‘2002-01-01’ AND ‘2003-01-01’;

25
Q

What are the 6 different operator symbols? What do they do?

A

< - less than
> - Greater than
= - Equal to
<= - Less than or equal to
>= - Greater than or equal to
<> - Not equal to

26
Q

What command specifies that both condition must be met simultaneously?

A

AND

SELECT firstname, lastname, email, country, supportrepid
FROM customers
WHERE supportrepid = 5 AND country = ‘USA’;

27
Q

What command specifies that either condition can be met?

A

OR

SELECT firstname, lastname, email, country
FROM customers
WHERE country = ‘Canada’ OR country = ‘USA’;

28
Q

What command negates a condition?

A

NOT

SELECT firstname, lastname, email, country
FROM customers
WHERE NOT country = ‘USA’;

29
Q

What command returns rows matching on a specified column that exists in more than one table ?

A

INNER JOIN

30
Q

What command returns all of the records of the first table, but only returns rows of the second table that match on a specified column?

A

LEFT JOIN

31
Q

What command returns all of the records of the second table, but only returns rows from the first table that match on a specified column?

A

RIGHT JOIN

32
Q

What command returns all records from both tables?

A

FULL OUTER JOIN

33
Q

What do you call the functions that perform a calculation over multiple data points and return the result of the calculation? What are 3 of them?

A

Aggregate functions

1) COUNT - returns a single number that represents the number of rows returned from your query.
2) AVG - Returns a single number that represents the average of the numerical data in a column.
3) SUM - returns a single number that represents the sum of the numerical data in a column.