databasebeginner

Query

A question you ask your database.

What is Query?

When your app needs data — like all users who signed up this week — it sends a query to the database. The database finds the matching records and sends them back. Vibe coding tools write these queries for you.

Queries are written in SQL, but you almost never write them by hand. The AI generates them based on what you describe.

In Vibe Coding

Every time your vibe coded app loads data — showing a list of products, displaying a user profile, checking if someone is logged in — it's running a query. Lovable and Cursor generate these queries automatically from your prompts.

Example

For example: On your app's dashboard, you want to show "total revenue this month." Your app queries the database: give me the sum of all payments where the date is this month.

Related Terms

Related Guides