diff --git a/Databases/SurrealDB/Syntax.md b/Databases/SurrealDB/Syntax.md index d75e7e1..64210b2 100644 --- a/Databases/SurrealDB/Syntax.md +++ b/Databases/SurrealDB/Syntax.md @@ -7,3 +7,28 @@ ## Examples +### Basic `SELECT` examples + +```sql +-- Select all fields from a table +SELECT * FROM person; + +-- Select specific fields from a table +SELECT name, address, email FROM person; + +-- Select all fields from a specific record +SELECT * FROM person:tobie; + +-- Select specific fields from a specific record +SELECT name, address, email FROM person:tobie; + +-- Alias/rename fields +SELECT name AS user_name, address FROM person; + +-- Select just a single record +-- Using the ONLY keyword, just an object for the record in question will be returned. +-- This, instead of an array with a single object. +SELECT * FROM ONLY person:john; +``` + +### \ No newline at end of file