New to databases? Start here

Database basics

Plain-language explanations of tables, rows, keys, SQL, and every word you will meet in Querly. No experience needed.

You do not need to know anything about databases to start using Querly. This page explains the few ideas that everything else is built on. Read it once, then come back whenever a word looks unfamiliar.

Think of a spreadsheet

A database is an organised place where an app keeps its information: customers, orders, products, messages. It looks a lot like a spreadsheet file with several sheets.

idnameemailcountry
1Mona[email protected]Egypt
2Omar[email protected]Jordan
3LinaNULLEgypt

This small grid is a table called customers. Querly shows every table as a grid just like this one, and lets you search, sort, and edit it.

The words you will see

WordWhat it meansIn the example
DatabaseA collection of tables for one app or project.The whole file or server
TableOne list of similar things.customers
Row (record)One item in a table.Mona's line
Column (field)One kind of detail every row has.email
Primary keyA column whose value is different for every row, so one row can always be told apart from the others. Usually called id.id
Foreign keyA column that holds the id of a row in another table. It is how tables link together, such as an order pointing to its customer.orders.customer_id
NULL"No value". It is different from an empty text or a zero.Lina's email
IndexA shortcut the database keeps so it can find rows quickly, like the index at the back of a book.An index on email
SchemaThe design of the database: which tables and columns exist and how they connect.The list of tables
QueryA question or an instruction you send to the database, written in SQL.See below
ConnectionThe saved details Querly needs to reach a database: where it is, and who you are.The sidebar entry

What a connection needs

SQL in four sentences

SQL is the language used to talk to a database. You can use Querly for a long time without writing any, because the grid lets you click and edit. When you are ready, four statements cover most daily work.

Read rows
SELECT name, email FROM customers WHERE country = 'Egypt';
Add a row
INSERT INTO customers (name, email, country) VALUES ('Sara', '[email protected]', 'Egypt');
Change rows
UPDATE customers SET country = 'Jordan' WHERE id = 3;
Delete rows
DELETE FROM customers WHERE id = 3;

SELECT only looks, so it is always safe. INSERT, UPDATE, and DELETE change data.

The one rule: always use WHERE

UPDATE or DELETE without a WHERE line changes or removes every row in the table. Querly warns you before it runs one, shows how many rows would really change, and can undo it afterwards. Still, make WHERE a habit. See Review and undo writes.

Saving changes

When you edit cells in the grid, nothing is written yet. Querly collects your changes in a pending-changes list. You review them, then press ⌘S to save them all at once. If anything goes wrong, none of the batch is written. See Browse and edit data.

Where to go next

↑↓ move↩ open