Sql Flashcards

1
Q

is a lightweight, serverless, and embedded relational
database management system. It is integrated into Python
through the sqlite3 module, which provides a simple and
efficient way to interact with structured data. The ease of use
and portability of SQLite make it ideal for small to medium-
scale applications, local storage, and prototyping.

A

SQLite

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

Establishes a connection to an SQLite database. If the database
file doesn’t exist, it will create a new one

A

Database Connection — sqlite3.connect

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

Creates a cursor object used to execute SQL commands.

A

Cursor Object
connection.cursor()

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

Executes a single SQL query or command.

A

cursor.execute()

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

Executes a query multiple times with different parameters sets.

A

cursor.executemany()

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

Executes multiples SQL Statements in a single string.

A

cursor.executescript()

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

Retrieves all rows of a query result.

A

cursor.fetchall()

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

Retrieves the next row of a query result.

A

cursor.fetchone()

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

Retrieves a specified number of rows from a query result.

A

cursor.fetchmany(size)

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

Commits the current transaction to the database.

A

Transactions
connection.commit()

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

Rolls back any changes madde during the current
transaction.

A

connection.rollback()

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

Closes the connection to the database.

A

Connection Management
connection.close()

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

Gets or sets the isolation level for transactions..

A

connection.isolation_level()

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

Creates an in-memory database that disappears when the
connection is closed.

A

Connection Management
sqlite3.connect(‘:memory:’)

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

Base class for all SQLite exeptions.

A

Error Handling
v/ sqlite3.Error

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

Creates a new table in the database.

A

CREATE TABLE

17
Q

Adds new rows of data to a table.

A

INSERT INTO

18
Q

Retrieves data from one or more tables.

19
Q

Modifies existing data in a table.

20
Q

Removes rows from a table.

21
Q

Deletes a table from the database.

A

DROP TABLE

22
Q

Specifies conditions for data retrieval or modification.

23
Q

Sorts retrieved data based on one or more columns.

24
Q

Restricts the number of rows returned by a query.

25
Q

— Inserting data into the table using INSERT INTO.

A

Create Operation

26
Q

— Read data into the table using SELECT.

A

Read Operation

27
Q

— Update data into the table using UPDATE.

A

Update Operation

28
Q

— Delete data into the table using DELETE.

A

Delete Operation

29
Q

— Always close the database connection when
done.

A

Closing the connection