Concepts / SQL Fundamentals: SELECT, INSERT, UPDATE, DELETE

SQL Fundamentals: SELECT, INSERT, UPDATE, DELETE

The Database Browser for SQLite is a visual tool that reads SQLite database files and displays their contents in a user-friendly interface, allowing you to create tables, insert data, edit values, and run queries without coding.

  • Programming

A Database as a File

A SQLite database is stored in a file on your computer. Unlike a text document, the contents of a SQLite database are stored in a binary format designed for fast retrieval, so opening the file in a text editor does not produce information that is easy for a person to understand. Database Browser for SQLite acts as a visual window into that file: it reads the database and presents its tables, rows, columns, and structure through an interface you can see and click.

In the real world

Example origin: generated. Imagine that you have a database file containing information about books. Database Browser can show you the table, the columns that describe each book, and the rows containing the stored books. You do not need to write Python merely to inspect a few records.

Four Fundamental Operations

The four operation names describe four common ways to work with database data. SELECT is used to inspect or query data. INSERT adds new data. UPDATE edits existing data. DELETE removes data. Together, these operations separate reading data from changing it: SELECT is the read-oriented operation, while INSERT, UPDATE, and DELETE change what is stored.

OperationPurposeEffect on stored data
SELECTView or query dataReads data; does not change the stored records
INSERTAdd dataCreates additional stored records
UPDATEEdit dataChanges existing stored values
DELETERemove dataRemoves selected stored records

The four operations differ mainly in whether they read, add, edit, or remove stored data.

Stored recordsrecords presentStored recordssame recordsStored recordsrecords presentStored records plusnew recordadditional recordStored recordold valueStored recordedited valueStored recordrecord presentRemaining recordsselected record absentSELECTINSERTUPDATEDELETE
What changes in the database after each operation, and which operation only reads data?

From File to Visible Result

The browser connects what is stored on disk with what you can inspect on screen. First, you open a SQLite database file. The browser reads its binary structure. It then displays the available tables and lets you select a table to see its rows and columns. From the same interface, you can use forms and controls to create tables, insert data, edit values, and run queries.

SQLite databasefilebinary dataDatabase Browserreads and translatesTablesvisible structureRows and columnsvisible dataQuery resultsdisplayed outputreaddisplaydisplayshow
How does data move from the SQLite database file into the browser interface and appear as tables or query results?

A Browser-Based Workflow

Worked example

Inspecting and Changing a Small Database

Example origin: generated. You need to inspect a SQLite database, create a table for a small experiment, add a few records, and correct one value.

  1. 1
    Open the file

    Open the SQLite database file in Database Browser. The browser reads the file and presents its structure through the interface.

  2. 2
    Inspect the contents

    View the list of tables, then select a table to inspect its rows and columns. A query can also be run when you need to examine data through a query result.

  3. 3
    Create the structure

    Create a table when the experiment needs a new place to store data.

  4. 4
    Add records

    Insert a few rows through the browser's visual controls. This is an example of a small operation for which the browser is intended to be convenient.

  5. 5
    Correct a value

    Edit the relevant value through the interface. This corresponds to updating existing data rather than adding another record.

  6. 6
    Check the result

    Inspect the table or run a query again so that the visible result reflects the current contents of the database.

Result

The database has been inspected and modified through a visual interface without writing code.

Open database fileView tables andrecordsCreate tableInsert dataEdit valueCheck resultread fileprepare structureadd recordscorrect valueinspect again
What happens next when a learner opens a database file, views its contents, creates a table, inserts data, and modifies a value?

Browser or Python

Database Browser for SQLitePython
Best for small, one-time operationsBest for complex operations and automation
Useful for checking data and adding a few rowsUseful for large-scale data processing
Uses point-and-click controls and formsExpresses logic through a program
Convenient for learning, prototyping, and quick correctionsUseful for repeated processes, loops, and systematic error handling
Works interactively with the database fileCan work repeatedly with the same database file through code

Both tools can interact with the same SQLite file; the appropriate choice depends on the task.

Use Database Browser when you are inspecting a database, learning how tables and data are organized, prototyping a design, adding a few rows, or making a one-time correction. Choose Python when the work involves many operations, complex transformations, large datasets, repeated execution, or systematic error handling. These choices are not mutually exclusive: both tools interact with the same SQLite file on disk, so the browser and Python can be used together.

In the real world

Example origin: generated. Checking a table after a small manual change is a browser task. Applying a complex transformation repeatedly across a large dataset is a Python task. The difference is not that one tool is able to see the database and the other is not; both work with the same SQLite file. The difference is the scale and complexity of the work.

Mistakes to Avoid

  • Common mistake

    Treating a SQLite database file like a text file

    What it looks like

    Opening the file in a text editor and expecting its binary contents to be understandable.

    Why it fails

    The database is stored in a binary format optimized for retrieval, not for human reading.

    Do this instead

    Use Database Browser for SQLite or Python to interact with the database.

  • Common mistake

    Using Python for every small database change

    What it looks like

    Writing a full program just to inspect data or add a few rows once.

    Why it fails

    Small, immediate operations are often faster and more intuitive through the browser.

    Do this instead

    Use the browser for simple, one-time tasks and reserve Python for work that benefits from logic or automation.

  • Common mistake

    Confusing SELECT with a data-changing operation

    What it looks like

    Expecting a query that displays records to add, edit, or remove them.

    Why it fails

    SELECT is the read-oriented operation; it is used to inspect or query data.

    Do this instead

    Use INSERT to add, UPDATE to edit, and DELETE to remove stored records.

  • Common mistake

    Assuming the browser and Python use different databases

    What it looks like

    Editing a database through the browser and then looking for a separate database when using Python.

    Why it fails

    Both tools can interact with the same SQLite file on disk.

    Do this instead

    Treat the SQLite file as the shared database and choose the interface that fits the task.

  • Common mistake

    Changing data without checking the result

    What it looks like

    Editing a value and never inspecting the table or running a query afterward.

    Why it fails

    The browser is valuable partly because it lets you see the current structure and data.

    Do this instead

    After an insert, update, or delete, inspect the relevant table or query result.

Practice the Decision

EASY

Example origin: generated. You need to inspect a database, add three sample records, and correct one value once. Would you begin with Database Browser for SQLite or Python? Explain your choice using the size, complexity, and repeatability of the task.

Hints
  • Identify whether the task is small or large.
  • Ask whether it needs automation or repeated execution.
  • Remember that both tools can work with the same SQLite file.

What do you think happens?

You need to see whether a value is present in a table, but you do not want the operation to change the stored records. Which operation fits this goal?

  • SELECT

  • INSERT

  • UPDATE

  • DELETE

Reveal answer
Answer:

SELECT

SELECT is used to inspect or query data. INSERT adds data, UPDATE edits existing data, and DELETE removes data.

Key Takeaways

  1. 1
    Database Browser for SQLite reads SQLite database files and presents their structure and contents in a visual interface.
  2. 2
    SELECT inspects or queries data, INSERT adds data, UPDATE edits existing data, and DELETE removes data.
  3. 3
    The browser is well suited to learning, inspection, prototyping, small changes, and one-time corrections.
  4. 4
    Python is better for complex operations, automation, repeated work, and large-scale data processing.
  5. 5
    The browser and Python can interact with the same SQLite file, so they can be used together.

At a glance

  • Database Browser for SQLite turns a binary database file into a visible, interactive representation of tables and data.
  • SELECT reads data, while INSERT, UPDATE, and DELETE change the stored records in different ways.
  • A typical browser workflow is to open the file, inspect its tables and records, create or modify data, and check the result.
  • Use the browser for convenient small tasks and Python for complex, automated, or large-scale processing.

More concepts starting with S