What is SQL? Your first queries
Every FiveM server uses a database - for player data, vehicles, inventory, and money. SQL is the language you talk to it with. This lesson covers the four commands you'll use every day: SELECT to read, INSERT to create, UPDATE to change, and DELETE to remove. Four commands. That's it.
Build it
SELECT - read data
-- Get all players
SELECT * FROM players;
-- Get only the name and money columns
SELECT name, money FROM players;
-- Get players with money over 5000
SELECT name, money FROM players WHERE money > 5000;
-- Get the top 5 richest players
SELECT name, money FROM players ORDER BY money DESC LIMIT 5;
*means "all columns"WHEREfilters rowsORDER BYsorts (DESC = highest first)LIMITcaps the number of results