Connect correct answers connect is a module function that takes a filename and results a
connection object
- .connect("test.db")
- .connect(:memory:)
Cursor correct answers A Cursor object represents a database cursor(not important what that
means), it is where we'll execute SQL statements28
Execute correct answers The execute method on the Cursor objecttakes a string (query) and
returns an iterableobject or None, depending on if the queryreturns rows from the database.29
abs(x) correct answers returns the absolute value of its argument
lower(x) correct answers returns a copy of a string in lower case
upper(x) correct answers guess what this does
random(x) correct answers returns an random, signed 64-bit integer
typeof(x) correct answers returns the type ("null", "integer", "real", "text","blob") of x
round(x, y) correct answers returns a floating-point value x rounds to ydigits after the decimal
point
create_function correct answers The create_function method on the connection object takes three
parameters:
, - name - a string giving the name the function will be called by in SQL
- num_params - the number of parameters the function requires
- func - the function (in Python) to be called
The create_function can return correct answers any of the SQLite supported types (bytes, str, int,
float, and None)34
trim(x, y) correct answers returns a copy of string x with y characters removed from each end
Aggregate Functions correct answers Aggregators (aggregate functions) take 0 or more values
and return some form of summary or those values.
ex: count(x), max(x)
create_aggregate correct answers the create_aggregate method of the SQLite3 Connection class
has three arguments:
- name - the SQL name to call the aggregate function by
- num_params - the number of parameters for the aggregate
function- aggregate_class - the Python class to pass data to
The aggregate class must have three methods: correct answers - __init__(self) - the init method
that initializes the class (usually an attribute to 0)