Note, all commands are ended by a ;
All commands are case sensitive
To insert data, start a command with INSERT, like:
-- INSERT INTO *table* (*fields, fields...*)
INSERT INTO ... (..., ..., ...)
-- VALUES (*data to insert*)
VALUES (...);- Currently this is a fixed table schema of (id, stop_name, rail_line)
-- Sample insert
INSERT INTO Mbta (id, stop_name, rail_line)
VALUES (100, 'Englewood ave.', 'G');- Commands don't need newlines to run, so the above example could also be run like:
-- Sample insert
INSERT INTO Mbta (id, stop_name, rail_line) VALUES (100, 'Englewood ave.', 'G');To query data, start a command with SELECT, like:
-- SELECT FROM *table* (*fields, fields...*)
SELECT FROM ... (...);-- Sample query
SELECT FROM Mbta (stop_name); -- will return all stop names in dbCurrently a subset of predicates are supported:
- Equals:
== - Not equal:
<> - greater than, less than, etc. :
>,>=,<,<=
-- SELECT FROM *table* (*fields...*) WHERE predicate...
SELECT FROM ... (...)
WHERE ... == ...; -- Sample query
SELECT FROM Mbta (stop_name)
WHERE rail_line <> 'G'; -- Returns all stops not on the greenline (thank god).help;-> Prints out help menu.tree;-> Prints out current tree layout and ids.exit;-> Exits SQCaml
That's all I have for now! 🐫︎