ParticleDB speaks PostgreSQL-compatible SQL with extensions for vector search, time-series, and hybrid transactional/analytical workloads. Connect with any PostgreSQL client (psql, JDBC, node-postgres, etc.) and use the SQL you already know.
Statement Description Example CREATE TABLECreate a new table CREATE TABLE orders (id BIGINT PRIMARY KEY, total FLOAT64)DROP TABLERemove a table DROP TABLE IF EXISTS ordersALTER TABLEModify table schema ALTER TABLE orders ADD COLUMN status TEXTTRUNCATERemove all rows from a table TRUNCATE TABLE ordersCREATE INDEXCreate a B-tree or vector index CREATE INDEX idx_total ON orders (total)DROP INDEXRemove an index DROP INDEX IF EXISTS idx_totalCREATE VIEWDefine a named query CREATE VIEW high_value AS SELECT * FROM orders WHERE total > 1000DROP VIEWRemove a view DROP VIEW IF EXISTS high_valueCREATE TYPE ... AS ENUMDefine an enumerated type CREATE TYPE status AS ENUM ('pending', 'shipped', 'delivered')DROP TYPERemove a user-defined type DROP TYPE IF EXISTS statusCREATE PROCEDUREDefine a stored procedure CREATE PROCEDURE archive(cutoff INT64) AS $$ ... $$DROP PROCEDURERemove a stored procedure DROP PROCEDURE IF EXISTS archiveCREATE FUNCTIONDefine a user-defined function CREATE FUNCTION double(x INT64) RETURNS INT64 AS $$ ... $$DROP FUNCTIONRemove a user-defined function DROP FUNCTION IF EXISTS doubleANALYZERefresh table statistics ANALYZE orders
See DDL for full syntax.
Statement Description Example SELECTQuery data SELECT name, price FROM products WHERE price > 50INSERTAdd rows INSERT INTO products (id, name) VALUES (1, 'Widget')INSERT ... ON CONFLICTUpsert INSERT INTO products ... ON CONFLICT (id) DO UPDATE SET name = EXCLUDED.nameUPDATEModify existing rows UPDATE products SET price = 19.99 WHERE id = 1DELETERemove rows DELETE FROM products WHERE discontinued = trueCOPY FROMBulk import (CSV, Parquet, JSON) COPY products FROM '/data/products.csv' WITH (FORMAT CSV)COPY TOBulk export COPY products TO '/data/export.parquet' WITH (FORMAT PARQUET)INSERT INTO ... SELECTInsert from a query INSERT INTO archive SELECT * FROM orders WHERE created_at < '2025-01-01'
See SELECT , INSERT / UPDATE / DELETE .
Statement Description Example BEGINStart a transaction BEGINCOMMITCommit the current transaction COMMITROLLBACKAbort the current transaction ROLLBACKSAVEPOINTCreate a named savepoint SAVEPOINT before_updateRELEASE SAVEPOINTRelease a savepoint RELEASE SAVEPOINT before_updatePREPARE TRANSACTIONPrepare for two-phase commit PREPARE TRANSACTION 'tx_001'COMMIT PREPAREDCommit a prepared transaction COMMIT PREPARED 'tx_001'ROLLBACK PREPAREDRollback a prepared transaction ROLLBACK PREPARED 'tx_001'
See Transactions .
Statement Description Example CREATE ROLECreate a role CREATE ROLE analystCREATE USERCreate a user (role with login) CREATE USER bob WITH PASSWORD 'secret'DROP ROLERemove a role DROP ROLE IF EXISTS analystGRANTGrant privileges or roles GRANT SELECT ON orders TO analystREVOKERevoke privileges or roles REVOKE INSERT ON orders FROM analystALTER ROLEModify role properties ALTER ROLE bob SET PASSWORD 'new_secret'CREATE POLICYDefine row-level security policy CREATE POLICY tenant_iso ON orders FOR SELECT USING (tenant_id = current_user_attr('tenant'))DROP POLICYRemove an RLS policy DROP POLICY tenant_iso ON orders
See DDL for full syntax.
Statement Description Example EXPLAINShow the query plan EXPLAIN SELECT * FROM orders WHERE id = 42EXPLAIN ANALYZEExecute and show actual timings EXPLAIN ANALYZE SELECT COUNT(*) FROM ordersSETSet a session variable SET search_path = 'public'SHOWShow a session variable SHOW server_versionLISTENSubscribe to a notification channel LISTEN order_updatesUNLISTENUnsubscribe from a channel UNLISTEN order_updatesNOTIFYSend a notification NOTIFY order_updates, 'order 42 shipped'CALLExecute a stored procedure CALL archive(30)
Type Aliases Description INT64INT, BIGINT, SMALLINT, TINYINT64-bit signed integer FLOAT64FLOAT, DOUBLE, REAL, DOUBLE PRECISION64-bit IEEE 754 floating point BOOLEANBOOLTRUE or FALSETEXTVARCHAR, STRING, CHARVariable-length UTF-8 string BYTESBYTEA, BLOB, BINARYVariable-length byte array TIMESTAMPMicrosecond-precision UTC timestamp VECTOR(n)Dense array of n 32-bit floats for similarity search JSONJSONBJSON document stored as text ARRAYArray of scalar values ENUMUser-defined enumerated type (via CREATE TYPE)
See Data Types for casting, storage details, and examples.
Operator Description Example =Equal price = 9.99!= or <>Not equal status != 'cancelled'<Less than age < 30<=Less than or equal price <= 100>Greater than score > 90>=Greater than or equal quantity >= 5
Operator Description Example ANDLogical conjunction price > 10 AND price < 50ORLogical disjunction status = 'active' OR status = 'pending'NOTLogical negation NOT is_deleted
Operator Description Example +Addition price + tax-Subtraction total - discount*Multiplication quantity * price/Division total / count%Modulo id % 10
Operator Description Example ||String concatenation first_name || ' ' || last_nameLIKEPattern match (case-sensitive) name LIKE 'Jo%'NOT LIKENegated pattern match email NOT LIKE '%@spam.com'ILIKEPattern match (case-insensitive) name ILIKE '%smith%'
Predicate Description Example IS NULLTest for null email IS NULLIS NOT NULLTest for non-null phone IS NOT NULLIN (...)Set membership status IN ('active', 'pending')NOT IN (...)Negated set membership id NOT IN (1, 2, 3)BETWEEN ... ANDRange test (inclusive) price BETWEEN 10 AND 50EXISTS (subquery)Test for non-empty subquery EXISTS (SELECT 1 FROM orders WHERE customer_id = c.id)ANY / SOMECompare to any subquery row price > ANY (SELECT min_price FROM tiers)ALLCompare to all subquery rows score >= ALL (SELECT threshold FROM rules)CONTAINS(s, sub)True if string contains substring CONTAINS(email, '@gmail.com')
Operator Description Example ->Extract JSON element (returns JSON) data -> 'address'->>Extract JSON element (returns text) data ->> 'name'
Operator Description Example <=>Vector distance (for ORDER BY) ORDER BY embedding <=> '[0.1, 0.2, ...]' LIMIT 10
Function Description Example ABS(x)Absolute value ABS(-42) — 42ROUND(x [, d])Round to d decimal places ROUND(3.14159, 2) — 3.14CEIL(x) / CEILING(x)Round up to nearest integer CEIL(2.3) — 3.0FLOOR(x)Round down to nearest integer FLOOR(2.7) — 2.0PI()Pi constant (3.14159…) PI() — 3.141592653589793SQRT(x)Square root SQRT(144) — 12.0POWER(base, exp) / POWExponentiation POWER(2, 10) — 1024.0EXP(x)Natural exponential (e^x) EXP(1) — 2.718...LN(x)Natural logarithm LN(2.718) — ~1.0LOG(x)Natural logarithm (single arg) LOG(2.718) — ~1.0LOG(base, x)Logarithm with explicit base LOG(2, 1024) — 10.0LOG10(x)Base-10 logarithm LOG10(100) — 2.0LOG2(x)Base-2 logarithm LOG2(8) — 3.0TRUNC(x [, n])Truncate to n decimal places (no rounding) TRUNC(3.14159, 3) — 3.141SIGN(x)Sign of x (-1, 0, or 1) SIGN(-7) — -1CBRT(x)Cube root CBRT(27) — 3.0DIV(a, b)Integer (truncated) division DIV(7, 2) — 3MOD(a, b)Modulo (remainder) MOD(7, 3) — 1DEGREES(x)Radians to degrees DEGREES(3.14159) — ~180.0RADIANS(x)Degrees to radians RADIANS(180) — ~3.14159SIN(x)Sine SIN(0) — 0.0COS(x)Cosine COS(0) — 1.0TAN(x)Tangent TAN(0) — 0.0ASIN(x)Inverse sine ASIN(1) — ~1.5708ACOS(x)Inverse cosine ACOS(1) — 0.0ATAN(x)Inverse tangent ATAN(1) — ~0.7854ATAN2(y, x)Two-argument inverse tangent ATAN2(1, 1) — ~0.7854SINH(x)Hyperbolic sine SINH(1) — ~1.1752COSH(x)Hyperbolic cosine COSH(0) — 1.0TANH(x)Hyperbolic tangent TANH(0) — 0.0COT(x)Cotangent (1/tan) COT(1) — ~0.6421RANDOM() / RAND()Random float in [0.0, 1.0) RANDOM()
Function Description Example UPPER(s)Convert to uppercase UPPER('hello') — 'HELLO'LOWER(s)Convert to lowercase LOWER('HELLO') — 'hello'LENGTH(s) / LEN / STRLENString length LENGTH('hello') — 5SUBSTRING(s, start [, len]) / SUBSTRExtract substring (1-based) SUBSTRING('hello', 2, 3) — 'ell'TRIM(s)Remove leading/trailing whitespace TRIM(' hi ') — 'hi'LTRIM(s)Remove leading whitespace LTRIM(' hi') — 'hi'RTRIM(s)Remove trailing whitespace RTRIM('hi ') — 'hi'LEFT(s, n)First n characters LEFT('hello', 3) — 'hel'RIGHT(s, n)Last n characters RIGHT('hello', 3) — 'llo'REPLACE(s, from, to)Replace all occurrences REPLACE('hello', 'l', 'r') — 'herro'REVERSE(s)Reverse a string REVERSE('abc') — 'cba'REPEAT(s, n)Repeat string n times REPEAT('ab', 3) — 'ababab'INITCAP(s)Capitalize first letter of each word INITCAP('hello world') — 'Hello World'CONCAT(a, b, ...)Concatenate strings (NULL-safe) CONCAT('a', NULL, 'b') — 'ab'POSITION(haystack, needle) / STRPOSFind substring position (1-based, 0 = not found) POSITION('hello', 'ell') — 2STARTS_WITH(s, prefix)True if string starts with prefix STARTS_WITH('hello', 'hel') — TRUEENDS_WITH(s, suffix)True if string ends with suffix ENDS_WITH('hello', 'llo') — TRUECONCAT_WS(sep, a, b, ...)Concatenate with separator (NULL-safe) CONCAT_WS('-', 'a', 'b', 'c') — 'a-b-c'LPAD(s, len [, fill])Left-pad string to length (fill defaults to space) LPAD('42', 5, '0') — '00042'RPAD(s, len [, fill])Right-pad string to length (fill defaults to space) RPAD('hi', 5, '.') — 'hi...'CONTAINS(s, substr)True if s contains substr CONTAINS('hello', 'ell') — TRUESPLIT_PART(s, delim, n)Return the nth token after splitting by delimiter SPLIT_PART('a.b.c', '.', 2) — 'b'CHAR_LENGTH(s) / CHARACTER_LENGTHCharacter length (same as LENGTH) CHAR_LENGTH('hello') — 5OCTET_LENGTH(s)Length in bytes OCTET_LENGTH('hello') — 5BIT_LENGTH(s)Length in bits BIT_LENGTH('hello') — 40TRANSLATE(s, from, to)Replace characters by positional mapping TRANSLATE('hello', 'el', 'ip') — 'hippo'HEX(s) / TO_HEX(s)Encode string as hexadecimal TO_HEX('AB')ASCII(s)ASCII code of the first character ASCII('A') — 65CHR(n)Character for the given ASCII code CHR(65) — 'A'REGEXP_REPLACE(s, pattern, replacement)Regex-based string replacement REGEXP_REPLACE(url, '^https?://([^/]+)/.*', '\1')MD5(s)MD5 hash as hex string MD5('hello')SHA1(s)SHA-1 hash as hex string SHA1('hello')SHA256(s)SHA-256 hash as hex string SHA256('hello')SHA512(s)SHA-512 hash as hex string SHA512('hello')
Function Description Example NOW() / CURRENT_TIMESTAMPCurrent UTC timestamp NOW()CURRENT_DATECurrent UTC date (midnight) CURRENT_DATECURRENT_TIMECurrent time as HH:MM:SS CURRENT_TIMEDATE(expr)Truncate a timestamp to the date part DATE(NOW()) — '2025-04-10'EXTRACT(field FROM ts)Extract part of timestamp EXTRACT(YEAR FROM created_at)DATE_TRUNC(unit, ts)Truncate to specified precision DATE_TRUNC('hour', created_at)DATE_FORMAT(ts, fmt)Format timestamp (MySQL-style) DATE_FORMAT(NOW(), '%Y-%m-%d')TO_CHAR(ts, fmt)Format timestamp with PostgreSQL format codes TO_CHAR(NOW(), 'YYYY-MM-DD HH24:MI:SS')TO_DATE(str, fmt)Parse a date string using a format pattern TO_DATE('2025-04-10', 'YYYY-MM-DD')TIME_BUCKET(interval_secs, ts)Bucket timestamps (time-series) TIME_BUCKET(300, event_time)
Supported EXTRACT fields: YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, QUARTER, WEEK, ISODOW, MILLISECOND.
Function Description Example COALESCE(a, b, ...)First non-null argument COALESCE(nickname, first_name, 'Anonymous')NULLIF(a, b)Returns NULL if a = b, else a NULLIF(discount, 0)GREATEST(a, b, ...)Largest argument GREATEST(score1, score2, score3)LEAST(a, b, ...)Smallest argument LEAST(price, max_price)CASE WHEN ... THEN ... ENDConditional expression CASE WHEN age >= 18 THEN 'adult' ELSE 'minor' END
Function Description Example CAST(expr AS type)Convert to target type (error on failure) CAST('42' AS INT64)TRY_CAST(expr AS type)Convert to target type (NULL on failure) TRY_CAST('abc' AS INT64) — NULLexpr::typePostgreSQL-style cast shorthand '42'::INT64
Function Description Example GEN_RANDOM_UUID()Generate a v4 UUID string GEN_RANDOM_UUID()TYPEOF(expr) / PG_TYPEOFReturn the data type name of an expression TYPEOF(42) — 'INT64'IF(cond, then, else) / IIFInline conditional (shorthand for CASE) IF(x > 0, 'pos', 'non-pos')SESSION_USERCurrent session user name SELECT SESSION_USER
Function Description Example L2_DISTANCE(a, b)Euclidean distance between two vectors L2_DISTANCE(embedding, VECTOR('[0.1, 0.2]'))COSINE_SIMILARITY(a, b)Cosine similarity (1.0 = identical) COSINE_SIMILARITY(embedding, query_vec)INNER_PRODUCT(a, b) / DOT_PRODUCTDot product of two vectors INNER_PRODUCT(embedding, query_vec)
Function Description Example JSON_EXTRACT(json, path)Extract JSON element (via ->) JSON_EXTRACT(data, 'name')JSON_EXTRACT_SCALAR(json, path)Extract JSON element as text (via ->>) JSON_EXTRACT_SCALAR(data, 'email')JSON_PATH(json, path) / JSON_PATH_QUERYExtract element using JSONPath expression (returns JSON) JSON_PATH(data, '$.address.city')JSON_PATH_SCALAR(json, path) / JSON_PATH_QUERY_SCALARExtract element using JSONPath expression (returns text) JSON_PATH_SCALAR(data, '$.name')
Function Description Example COUNT(*)Count all rows SELECT COUNT(*) FROM ordersCOUNT(expr)Count non-null values COUNT(email)COUNT(DISTINCT expr)Count distinct non-null values COUNT(DISTINCT customer_id)SUM(expr)Sum of values SUM(amount)AVG(expr)Arithmetic mean AVG(price)MIN(expr)Minimum value MIN(created_at)MAX(expr)Maximum value MAX(score)MEDIAN(expr)Median value MEDIAN(response_time)MODE(expr)Most frequent value MODE(category)STDDEV(expr) / STDDEV_POPPopulation standard deviation STDDEV(latency)STDDEV_SAMP(expr)Sample standard deviation STDDEV_SAMP(latency)VAR_POP(expr) / VARIANCEPopulation variance VAR_POP(score)VAR_SAMP(expr)Sample variance VAR_SAMP(score)STRING_AGG(expr, sep)Concatenate strings with separator STRING_AGG(tag, ', ')GROUP_CONCAT(expr)Concatenate strings (MySQL compat) GROUP_CONCAT(name)ARRAY_AGG(expr) / JSON_ARRAYAGG / JSONB_AGG / JSON_AGGCollect values into an array ARRAY_AGG(product_id)BOOL_AND(expr)True if all values are true BOOL_AND(is_verified)BOOL_OR(expr)True if any value is true BOOL_OR(has_error)BIT_AND(expr)Bitwise AND across all values in group BIT_AND(flags)BIT_OR(expr)Bitwise OR across all values in group BIT_OR(flags)BIT_XOR(expr)Bitwise XOR across all values in group BIT_XOR(flags)ANY_VALUE(expr)Arbitrary non-null value from group ANY_VALUE(description)FIRST(val, ts)Value with the earliest timestamp FIRST(status, updated_at)LAST(val, ts)Value with the latest timestamp LAST(status, updated_at)ARG_MIN(val, key) / MIN_BY / ARGMINValue where key is minimum ARG_MIN(name, price)ARG_MAX(val, key) / MAX_BY / ARGMAXValue where key is maximum ARG_MAX(name, score)PERCENTILE_CONT(pct)Continuous percentile PERCENTILE_CONT(0.95)PERCENTILE_DISC(pct)Discrete percentile PERCENTILE_DISC(0.5)APPROX_COUNT_DISTINCT(expr)Approximate distinct count (HyperLogLog) APPROX_COUNT_DISTINCT(user_id)
All aggregates support the FILTER (WHERE ...) modifier:
COUNT ( * ) FILTER ( WHERE status = ' shipped ' ) AS shipped
See Aggregations for detailed reference.
Function Description ROW_NUMBER()Sequential row number within partition RANK()Rank with gaps for ties DENSE_RANK()Rank without gaps for ties NTILE(n)Divide rows into n buckets PERCENT_RANK()Relative rank (0.0 to 1.0) CUME_DIST()Cumulative distribution LAG(expr [, offset [, default]])Value from preceding row LEAD(expr [, offset [, default]])Value from following row FIRST_VALUE(expr)First value in the window frame LAST_VALUE(expr)Last value in the window frame NTH_VALUE(expr, n)Nth value in the window frame SUM(expr) OVER (...)Running or partitioned sum AVG(expr) OVER (...)Running or partitioned average COUNT(expr) OVER (...)Running or partitioned count MIN(expr) OVER (...)Running or partitioned minimum MAX(expr) OVER (...)Running or partitioned maximum MOVING_AVG(expr [, window_size])Moving average over a sliding window MOVING_SUM(expr [, window_size])Moving sum over a sliding window EXP_MOVING_AVG(expr [, alpha])Exponential moving average DELTA(expr)Difference from the previous row RATE(expr)Rate of change from the previous row
RANK () OVER ( PARTITION BY department ORDER BY salary DESC ) AS dept_rank,
SUM (salary) OVER ( PARTITION BY department) AS dept_total
See SELECT for window function syntax details.
Function Description Example GENERATE_SERIES(start, stop [, step])Generate a sequence of values SELECT * FROM GENERATE_SERIES(1, 10)UNNEST(array)Expand an array into rows SELECT * FROM UNNEST(ARRAY[1, 2, 3])
ParticleDB supports several SQL extensions beyond the standard dialect for improved ergonomics and analytical power.
Automatically infers which select-list columns belong in the GROUP BY — any column not inside an aggregate function is included automatically.
-- Standard GROUP BY (explicit)
SELECT category, region, SUM (amount) FROM orders GROUP BY category, region;
-- GROUP BY ALL (auto-inferred — equivalent)
SELECT category, region, SUM (amount) FROM orders GROUP BY ALL;
-- Works with multiple aggregates and ORDER BY
SELECT a, b, COUNT ( * ), AVG (c) FROM t GROUP BY ALL ORDER BY COUNT ( * ) DESC ;
Return all columns except the named ones. Useful for wide tables where you want to drop sensitive or internal columns without listing every remaining column.
-- Drop two sensitive columns
SELECT * EXCLUDE( password , ssn) FROM users;
SELECT * EXCLUDE(id) FROM orders WHERE amount > 100 ;
-- Works on subquery results
SELECT * EXCLUDE(rn) FROM (
SELECT * , ROW_NUMBER () OVER ( ORDER BY score DESC ) AS rn FROM students
Filter rows based on the result of a window function — analogous to HAVING for aggregates, but for window functions. Avoids a subquery wrap.
-- Top-3 employees per department by salary
SELECT * , ROW_NUMBER () OVER ( PARTITION BY dept ORDER BY salary DESC ) AS rn
-- Students tied for first place
SELECT * , RANK () OVER ( ORDER BY score DESC ) AS r
CONTAINS(string, substring) returns TRUE if string contains substring. A readable alternative to LIKE '%substr%'.
SELECT * FROM users WHERE CONTAINS(email, ' @gmail.com ' );
-- Compose multiple checks
SELECT CONTAINS( ' nested query ' , ' query ' ) AND CONTAINS( ' test ' , ' es ' );
A trailing comma after the last item in a SELECT list is silently accepted.
created_at, -- trailing comma is fine
INSERT into a table with a primary key now returns an error if a row with the same PK already exists, matching the SQL standard. Use ON CONFLICT to upsert.
CREATE TABLE users (id INT PRIMARY KEY , name TEXT );
INSERT INTO users VALUES ( 1 , ' alice ' );
INSERT INTO users VALUES ( 1 , ' bob ' ); -- ERROR: duplicate key
INSERT INTO users VALUES ( 1 , ' bob ' )
ON CONFLICT (id) DO UPDATE SET name = EXCLUDED . name ;
Function Category Description PI()Math Returns pi (3.14159…) LOG(base, x)Math Two-argument form: log base base of x TRUNC(x [, n])Math Truncate to n decimal places (no rounding) FLOOR(x)Math Parser support added CEIL(x) / CEILING(x)Math Parser support added BIT_AND(expr)Aggregate Bitwise AND over group BIT_OR(expr)Aggregate Bitwise OR over group BIT_XOR(expr)Aggregate Bitwise XOR over group TO_CHAR(ts, fmt)Date PostgreSQL format codes: YYYY, MM, DD, HH24, MI, SS TO_DATE(str, fmt)Date Parse a date string into a timestamp DATE(expr)Date Truncate timestamp to date (midnight UTC) DATE_FORMAT(ts, fmt)Date MySQL-style alias for TO_CHAR CURRENT_TIMEDate Current time as HH:MM:SS SESSION_USERSystem Current session user name EXTRACT(QUARTER ...)Date Quarter of the year (1-4) EXTRACT(ISODOW ...)Date ISO day of week (1=Monday, 7=Sunday) EXTRACT(WEEK ...)Date ISO week number (1-53) EXTRACT(MILLISECOND ...)Date Milliseconds component SPLIT_PART(s, delim, n)String Split and return the nth token LPAD(s, len)String fill now optional (defaults to space)RPAD(s, len)String fill now optional (defaults to space)CONTAINS(s, sub)String Boolean substring membership check CROSS JOINJoin Explicit cross-join syntax fully supported
SELECT PI (); -- 3.141592653589793
SELECT LOG ( 2 , 1024 ); -- 10.0
SELECT TRUNC( 3 . 14159 , 3 ); -- 3.141
SELECT FLOOR ( 2 . 7 ), CEIL( 2 . 3 ); -- 2.0, 3.0
SELECT role , BIT_AND(flags), BIT_OR(flags), BIT_XOR(flags)
SELECT TO_CHAR( NOW (), ' YYYY-MM-DD HH24:MI:SS ' );
SELECT TO_DATE( ' 2025-04-10 ' , ' YYYY-MM-DD ' );
SELECT CURRENT_TIME; -- e.g. '14:32:07'
-- Extended EXTRACT fields
EXTRACT( QUARTER FROM NOW ()), -- 1-4
EXTRACT(ISODOW FROM NOW ()), -- 1=Mon ... 7=Sun
EXTRACT( WEEK FROM NOW ()); -- ISO week 1-53
SELECT SPLIT_PART( ' a.b.c ' , ' . ' , 2 ); -- 'b'
SELECT LPAD( ' 42 ' , 5 ); -- ' 42'
SELECT RPAD( ' hi ' , 5 ); -- 'hi '
Data Types — Type system, casting, and storage
SELECT — Query syntax, WHERE, ORDER BY, window functions
INSERT / UPDATE / DELETE — DML and COPY
Joins — INNER, LEFT, RIGHT, FULL, CROSS, NATURAL
Aggregations — GROUP BY and aggregate functions
Transactions — ACID guarantees and isolation levels
Vector Search — Similarity search with HNSW/IVF indexes
Full-Text Search — LIKE, ILIKE, and text functions
DDL — Schema definition, access control, and administrative statements