Structure-free Query Language

From Esolang
Jump to navigation Jump to search

The Structure-free Query Language is an alternative to the popular Structured Query Language (SQL). It was created in 2015 by User:OriginalOldMan.

Data

As suggested by its name, data in the Structure-free Query Language has absolutely no structure. The Structure-free Query Language's databases are called pools. This is because when data is inserted into a pool, it floats around aimlessly with little hope of being retrieved.

Each bit of data is stored in the pool as a base-36 integer, with the digits represented from 1-z.

Commands

Like most programming languages, the Structure-free Query Language allows programmers to use various commands to manipulate data. For example the command to insert data into the pool is INSERT.

Just like data, commands in the Structure-free Query Language have no structure.

The following code inserts hello into the pool:

INSERT hello INTO POOL

However, this code does the same:

INTO POOL INSERT hello

As does this:

hello POOL INTO INSERT

As does this:

POOL INTO hello INSERT

Other "useful" commands:

Command Meaning
DELETE FROM POOL Removes all data from the pool.
SELECT DATA FROM POOL Selects a (random) piece of data from the pool.
SELECT * FROM POOL Selects all the data in the pool.
SET EQUAL TO DATA Sets the selected data to a random piece of data from the pool.
INTERMINGLE WITH DATA Intermingles the digits of the selected data and a random piece of data from the pool. For example, if the selected data was aaaa and the random piece was bbbb, the end result would be abababab.
DO MATH WITH DATA Performs a random math operation (+,-,*,/,%) between the selected data and a random piece of data, then sets the selected data equal to the result.

Example Programs

The following program has a 20% chance of adding 1+1:

POOL 1 INTO INSERT
INSERT POOL INTO 1
DO DATA MATH WITH

This is the closest one can get to a "Hello, world!" program in the Structure-free Query Language:

INSERT POOL INTO hello
world POOL INTO INSERT