SurrealDB is a multi-model database combining document, relational, and graph capabilities in a single engine. SurrealQL extends SQL with graph traversal operators, first-class record IDs, SCHEMALESS/SCHEMAFULL table modes, and fine-grained row-level permissions.
0 / 5 completed
1 / 5
What makes SurrealQL different from standard SQL when dealing with relationships between records?
SurrealQL supports graph traversal using arrow operators: ->relation->target navigates outgoing edges and <-relation<-source navigates incoming edges. This allows traversing relationships without explicit JOINs, similar to graph databases like Neo4j.
2 / 5
In SurrealDB, what is a Record ID and how is it structured?
SurrealDB Record IDs are structured as table:identifier, for example person:john or product:01HZXYZ. You can use strings, numbers, ULIDs, or UUIDs as the identifier part. Record IDs are first-class values that can be stored and traversed directly.
3 / 5
A developer writes SELECT * FROM person WHERE ->knows->person.name = 'Alice' in SurrealQL. What does this query do?
This SurrealQL query uses graph traversal in a WHERE clause to filter person records that have a ->knows-> outgoing edge to another person named 'Alice'. SurrealQL allows graph path expressions anywhere a value is expected.
4 / 5
What is the purpose of DEFINE TABLE ... SCHEMALESS vs SCHEMAFULL in SurrealDB?
SCHEMALESS tables in SurrealDB accept any fields without prior definition, enabling flexible document-style storage. SCHEMAFULL tables enforce that only explicitly DEFINE FIELD-declared columns can be stored, providing strict data validation at the database level.
5 / 5
Which SurrealDB feature allows defining access rules that restrict what data each user can read or write?
DEFINE TABLE ... PERMISSIONS in SurrealDB lets you write SurrealQL expressions that control row-level access per operation (SELECT, CREATE, UPDATE, DELETE). For example, FOR select WHERE user = $auth.id ensures users only see their own records.