0% found this document useful (0 votes)
4 views2 pages

Mesde

Uploaded by

himikotoga1123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Mesde

Uploaded by

himikotoga1123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Sqlite3

What it is sqlite3 is a built-in Python module that allows you to interact


with SQLite, a lightweight database engine that stores data in a single file.

Purpose: It’s great for small-scale apps where you need to store data
without the complexity of setting up a full database server.

- Use Case: Perfect for desktop apps, small websites, or local data
storage.

- Basic Example:

Python

Import sqlite3

Connect to a database (or create it)

Conn = sqlite3.connect(‘example.db’)

Cursor = conn.cursor()

Create a table

Cursor.execute(‘’’CREATE TABLE users (id INTEGER PRIMARY KEY, name


TEXT)’’’)

Insert a record

Cursor.execute(“INSERT INTO users (name) VALUES (‘Alice’)”)

Commit and close

Conn.commit()

Conn.close

- When to use: If you need a simple database solution for local or


smaller projects.

2.:nth-child(odd)` (CSS):
- What it is: A CSS pseudo-class used to target every odd-numbered
child element (e.g., 1st, 3rd, 5th, etc.) of a parent element.

- Purpose: Often used to apply alternating styles, like different


background colors, to odd rows or items, improving readability.

- Basic Example:

Tr:nth-child(odd) {

Background-color: #f0f0f0;

In a table, this makes every odd row have a light gray background.

- Common Use Case: Alternating row colors in tables or lists to


differentiate data visually

You might also like