
Picture a quiet, unassuming library, residing modestly within your computer. SQLite is a humble database system that allows you to organise your data with a sense of calm efficiency. It uses a language called SQL (Structured Query Language) to manage this data, but unlike those grand databases that require an imposing server and speak many dialects of SQL, SQLite is content in a single file with its own specific version of the language.
Simplicity: It offers a refreshingly straightforward approach.
Portability: Carry it with you; it demands little.
Efficiency: It performs its tasks without fanfare or complaint.
DB Browser is a reserved tool that provides a subdued interface for managing your SQLite database. It allows you to tend to your data with quiet ease, creating databases, defining tables, and manipulating data, all without needing to write raw SQL commands.
Imagine acquiring a new, empty bookcase for your quiet library. Before you can begin organising your collection, you must first prepare the shelves. In the world of SQLite, this translates to creating a database and defining its structure with tables.
A database is like that bookcase – a container to hold and organise your information. In SQLite, this container is a single file, residing unobtrusively on your computer. To create this file, we'll use DB Browser for SQLite:

You've now brought your new, empty bookcase into existence. It awaits the careful arrangement of your information.
Within your bookcase, you'll want to organise your books into categories. Perhaps you'll have a shelf for fiction, another for non-fiction, and another for poetry. In SQLite, these categories are called tables.
A table is a structured collection of data, organised into rows and columns. Each row represents a single item (like a book), and each column represents a specific attribute of that item (like its title, author, or genre).
Let's create a table to store information about books:

You've now created your first table, akin to adding a new shelf to your bookcase and labelling it "books". It's ready to receive the details of your literary collection.
Now that we've laid the groundwork, it's time to populate our newly created database. This involves the core of database interaction: CRUD operations.
CRUD is an acronym that stands for:
These four operations are the fundamental building blocks for interacting with any database, and SQLite is no exception.
Imagine carefully placing books onto your newly built shelves. Each book represents a record, a single entry in your database table. To add a book to your "books" table, we'll use the "Browse Data" tab in DB Browser:


You've just added your first record to the database, akin to placing a carefully chosen book onto your shelf.

Solidify your understanding by adding ten more books to your "books" table using the straightforward interface of DB Browser. Select titles from your own collection or those you aspire to read, and observe how easily you can manage your data without writing any code. This modest practice will prepare you for further exploration of CRUD operations.
Add 10 more books to the database. Alternatively, open the 'bookshelf.db' found in the resources folder if you want to cheat.
Having diligently populated your database, it's time to delve into the art of retrieval. In the hushed confines of our library analogy, this equates to selecting a book from its designated shelf and perusing its contents. Within DB Browser, this translates to viewing and filtering your data with quiet efficiency.
DB Browser offers a straightforward way to view your data without the need for complex commands. To view the contents of your "books" table:

To see the same view as the above screenshot, load the 'bookshelf.db' from the lesson resource folder.
The table's contents will be displayed, revealing the fruits of your earlier labours. Each row represents a book, and each column displays a specific attribute. Observe the unassuming orderliness with which your data is presented.
DB Browser also allows you to filter your data, akin to searching for a specific book on your shelf. To filter your data, you can use the search bar at the top of the table view. For instance, to find all books with "the" in the title, simply type "the" into the search bar. DB Browser will quietly update the display, showing only the matching records.
While this graphical approach offers a certain ease, there lies a more powerful method for retrieving data: SQL commands. These commands provide a precise and flexible way to query your database, allowing you to retrieve specific information with surgical precision. We shall explore this intriguing avenue in due course.
For now, familiarise yourself with the subdued elegance of DB Browser's graphical interface.
Use the search bar to filter the book list for:


Even in our meticulously organised collections, change is inevitable. In our library analogy, this might involve correcting a book's details, such as its author or genre. DB Browser allows us to modify existing records with ease.
To modify a record in your "books" table:

In this example, I've updated the genre of the book to "Computer Science" instead of "Media Studies"
DB Browser facilitates these alterations with quiet efficiency.
Occasionally, the need arises to remove items from our carefully curated collections. In our library analogy, this might involve discarding a worn-out volume or removing a title that no longer aligns with our interests. DB Browser provides a straightforward means to delete records from your database.

DB Browser executes this task with its characteristic quiet efficiency, leaving no trace of the departed record.
In this lesson, we've embarked on our journey into the world of SQLite and DB Browser. We've learned how to create a new database, define tables, and interact with our data using CRUD operations.
Having explored the subdued comforts of DB Browser's graphical interface, it's time to consider the broader landscape of SQLite interaction. While DB Browser provides an approachable entry point, the true power of SQLite lies in its command-line interface and its ability to integrate with programming languages like Python.
Beneath the unassuming exterior of DB Browser lies the command-line interface, where you can interact with SQLite using SQL commands. These commands offer a precise and flexible way to manipulate your database, allowing for more complex operations and fine-grained control over your data. For instance, you can use SQL commands to:
While the command-line interface may seem austere at first glance, it offers a deeper level of engagement with SQLite, allowing you to harness its full potential.