SQL/Python Refresher

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/103

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:36 PM on 5/22/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

104 Terms

1
New cards

SELECT

Retrieve data

2
New cards

FROM

Specify table

3
New cards

WHERE

Filter row before aggregation

4
New cards

ORDER BY

Sort results. ASC/DESC.

SELECT *

FROM warranty_claims

ORDER BY cost DESC;


5
New cards

LIMIT

Restricts num rows returned

6
New cards

GROUP BY

Groups rows for aggregation. (Without: aggregation results in one result, With: aggregation returns one result per group).

SELECT part_id, COUNT(*)

FROM warranty_claims

GROUP BY part_id;

7
New cards

HAVING

Filters grouped results AFTER aggregation

8
New cards

INNER JOIN

Returns matching rows from both tables

9
New cards

LEFT JOIN

Returns all rows from left table plus matches

10
New cards

RIGHT JOIN

Returns all rows from right table

11
New cards

FULL OUTER JOIN

Returns all matching and nonmatching rows

12
New cards

PRIMARY KEY

Unique identifier for a row.

13
New cards

FOREIGN KEY

Column linking one table to another (same id in multiple tables).

14
New cards

COALESCE()

Replaces NULL values


SELECT COALESCE(cost, 0)

FROM claims;

15
New cards

DISTINCT

Removes duplicates

SELECT DISTINCT part_id

FROM claims;

16
New cards

ALIAS

Temporary name for readability


SELECT SUM(cost) AS total_cost

FROM claims;

17
New cards

SUBQUERY

A query inside of another query


SELECT *

FROM claims

WHERE cost > (

    SELECT AVG(cost)

   FROM claims

);

18
New cards

COMMON TABLE EXPRESSION (CTE)

Reusable temporary query

19
New cards

WINDOW

Performs calculations across related rows without collapsing results

20
New cards

ROW_NUMBER()

Gives unique row numbers


SELECT

Employee_name,

   ROW_NUMBER() OVER (ORDER BY salary DESC)

FROM employees;

21
New cards

RANK()

Ties share the same rank (100 100 90) -> (1 1 3)

22
New cards

DENSE_RANK()

 No gaps after ties (100 100 90) -> (1 1 2)

23
New cards

PARTITION BY

Splitting window calculations into groups

24
New cards

OVER()

Defines window function behavior

25
New cards

CASE STATEMENT

SQL equivalent of if/else

26
New cards

UNION

Combines query results. Removes duplicates.

SELECT name FROM employees

UNION

SELECT name FROM managers;

27
New cards

UNION ALL

keeps duplicates/is faster

28
New cards

INDEX

Improves query speed, faster lookups instead of scanning whole table

29
New cards

NORMALIZATION

Organizing tables to reduce redundancy

30
New cards

DENORMALIZATION

Adding redundancy for faster reads

31
New cards

TRANSACTIONS

Group of SQL operations treated as one unit

32
New cards

COMMIT

Saves transaction permanently

33
New cards

ROLLBACK

Undoes transaction

34
New cards

VIEW

Virtual table based on a query

35
New cards

STORED PROCEDURE

Saved SQL program

36
New cards

ETL

Extract: pull data

Transform: clean/process data

Load: store data somewhere else

37
New cards

List

Ordered, mutable collection. Allows duplicates and is indexed.

parts = ["engine", "brake", "transmission"]

38
New cards

Tuple

Ordered, immutable collection. Can’t be modified and is faster than lists. Can be used as dictionary keys.

coords = (10, 20)

39
New cards

Set

Unordered collection of unique values. No duplicates, fast lookups, useful for removing duplicates.

parts = {"engine", "brake"}

40
New cards

Dictionary

Key-value pairs. Provides fast lookup by key and is mutable.

truck = { "model": "579", "year": 2025}

41
New cards

Mutable

Can change after creation (e.g., List, Dictionary, Set).

42
New cards

Immutable

Cannot change after creation (e.g., Tuple, String, Int).

43
New cards

if/elif/else

Conditional logic used to execute code based on the truthiness of conditions.

44
New cards

for

Iterates over collections, allowing you to process elements within a data structure.

45
New cards

while

Repeats a block of code while a specified condition is true.

46
New cards

def

Defines a function.

47
New cards

return

Sends value back from function.

48
New cards

Parameter

Variable in function definition.

def greet(name):

49
New cards

Argument

Value passed into function.

greet("Alex")

50
New cards

Lambda

Small anonymous function, common with sorting, map(), filter().

square = lambda x: x * x

51
New cards

try/except

Handles runtime errors.

try:   x = 10 / 0 except ZeroDivisionError:   print("Cannot divide by zero")

52
New cards

finally

Runs no matter what, even if an error occurs.

53
New cards

len()

Length of collection

54
New cards

type()

Returns data type

55
New cards

range()

Generates sequence of numbers

56
New cards

enumerate()

Returns index + value

57
New cards

zip()

Combines iterables

58
New cards

map()

Applies functions to all items

59
New cards

filter()

Filters by condition

60
New cards

sorted()

Sorted Collection

61
New cards

append()

Add one item

62
New cards

extend()

Adds multiple items

63
New cards

pop()

Removes item

64
New cards

remove()

Removes specific value

65
New cards

sort()

Sorts in place

66
New cards

keys()

Returns keys

67
New cards

values()

Returns values

68
New cards

items()

Returns key-value pairs

69
New cards

get()

Retrieves value

70
New cards

“r””w””a”

read, write, append

71
New cards

With Statement

Automatically closes file/resources

72
New cards

Class

Blueprint for objects

73
New cards

Object

Specific version of class

74
New cards

Constructor

Initializes object

75
New cards

Self

Reference to current object

76
New cards

Inheritance

Class inherits from another class

77
New cards

pandas

Library for data analysis

78
New cards

numpy

Numerical Operations

79
New cards

matplotlib

Data visualization

80
New cards

requests

HTTP/API requests

81
New cards

flask

backend APIs

82
New cards

Dataframe

Table-like data structure

83
New cards

Series

Single column of data

84
New cards

read_csv()

Loads csv file

85
New cards

head()

Shows first rows

86
New cards

describe()

Summary statistics

87
New cards

isnull()

Checks missing values

88
New cards

dropna()

Removes missing values

89
New cards

fillna()

Adds missing values

90
New cards

groupby()

Groups data

91
New cards

merge()

Joins dataframes

92
New cards

apply()

Applies function to rows/columns

93
New cards

REST API

Standard architecture for communication between systems

94
New cards

Endpoint

Specific API URL

95
New cards

GET

Retrieve data

96
New cards

POST

Send/create data

97
New cards

JSON

Common API data format

98
New cards

async/wait

Handles tasks concurrently

99
New cards

Threading

Multiple tasks in same process

100
New cards

Multiprocessing

Multiple CPU processes