SQL Clauses Operators Functions Reference
SQL Clauses
Clauses | How to Use It | Functionality |
---|---|---|
CREATE TABLE | CREATE TABLE table_name ... | Creates a new table |
INSERT | INSERT INTO table_name ... | Inserts new data into the table |
SELECT | SELECT col1, col2 ... | Retrieves specified columns |
SELECT | SELECT * FROM ... | Retrieves all columns from a table |
FROM | FROM table_name | Specifies the table(s) from which to retrieve data |
WHERE | WHERE col > 5 | Filters rows based on specified conditions |
UPDATE, SET | UPDATE table_name SET column1 = value1; | Updates column values for all rows (or specific |
Python Core Concepts: File I/O, Data Structures & Algorithms
Python File Handling Basics
Common modes for opening files:
open(filename, 'w')
: Open for writing (truncates file if exists, creates if not).open(filename, 'r')
: Open for reading (default mode).open(filename, 'a')
: Open for appending (creates file if not exists).
Common file handle (fh
) methods:
fh.read()
: Reads the entire file content.fh.readline()
: Reads a single line from the file.fh.readlines()
: Reads all lines into a list of strings.fh.write(string)
: Writes a string to the file.fh.writelines(list_
Using the Exam Cheat Sheet Editor
Using the Cheat Sheet Editor
Follow these steps to create your exam cheat sheet:
- Start writing your exam cheat sheet in the editor below.
- Pick the font size and the line height. Letter 5 is recommended for exams.
- Resize the exam cheat sheet by grabbing and moving the bottom right holder of the cheat sheet preview on the right side.
- Add more cheat sheets by pressing the (+) button.
Pandas in Python: Essential Techniques
Pandas – Part 2
Built-in Functions
- Average of column:
df_grades.Column.mean()
- Average of multiple columns:
df_grades[["column1", "column2"]].mean()
- Average of multiple columns:
- Max/min:
df_grades["column name"].max()
or.min()
- Statistical summary:
df_grades.describe()
- Can get all key stats for numeric columns at once with the
describe()
method- Count, mean, std, min, 25%, 50%, 75%, max
- Pick out chunks of the summary by storing the summary in a variable and then use
variable[["column name", "column name"]]
- Can get all key stats for numeric columns at once with the
- Number of each unique value: