<s>
Q	B-Application
is	O
a	B-Language
programming	I-Language
language	I-Language
for	O
array	B-Data_Structure
processing	O
,	O
developed	O
by	O
Arthur	O
Whitney	O
.	O
</s>
<s>
It	O
is	O
proprietary	B-Application
software	I-Application
,	O
commercialized	O
by	O
Kx	O
Systems	O
.	O
</s>
<s>
Q	B-Application
serves	O
as	O
the	O
query	O
language	O
for	O
kdb+	B-Application
,	O
a	O
disk	O
based	O
and	O
in-memory	B-General_Concept
,	O
column-based	B-General_Concept
database	O
.	O
</s>
<s>
Kdb+	B-Application
is	O
based	O
on	O
the	O
language	O
k	B-Application
,	O
a	O
terse	O
variant	O
of	O
the	O
language	O
APL	B-Language
.	O
</s>
<s>
Q	B-Application
is	O
a	O
thin	O
wrapper	O
around	O
k	B-Application
,	O
providing	O
a	O
more	O
readable	O
,	O
English-like	O
interface	O
.	O
</s>
<s>
The	O
fundamental	O
building	O
blocks	O
of	O
q	B-Application
are	O
atoms	O
,	O
lists	O
,	O
and	O
functions	O
.	O
</s>
<s>
Lists	O
are	O
ordered	O
collections	O
of	O
atoms	O
(	O
or	O
other	O
lists	O
)	O
upon	O
which	O
the	O
higher	O
level	O
data	O
structures	O
dictionaries	B-Application
and	O
tables	B-Application
are	O
internally	O
constructed	O
.	O
</s>
<s>
A	O
dictionary	B-Application
is	O
a	O
map	O
of	O
a	O
list	O
of	O
keys	O
to	O
a	O
list	O
of	O
values	O
.	O
</s>
<s>
A	O
table	O
is	O
a	O
transposed	O
dictionary	B-Application
of	O
symbol	O
keys	O
and	O
equal	O
length	O
lists	O
(	O
columns	O
)	O
as	O
values	O
.	O
</s>
<s>
A	O
keyed	O
table	O
,	O
analogous	O
to	O
a	O
table	O
with	O
a	O
primary	B-Application
key	I-Application
placed	O
on	O
it	O
,	O
is	O
a	O
dictionary	B-Application
where	O
the	O
keys	O
and	O
values	O
are	O
arranged	O
as	O
two	O
tables	B-Application
.	O
</s>
<s>
Expressions	O
to	O
evaluate	O
appear	O
prefixed	O
with	O
the	O
q	B-Application
)	O
prompt	O
,	O
with	O
the	O
output	O
of	O
the	O
evaluation	O
shown	O
beneath	O
:	O
</s>
<s>
These	O
entities	O
are	O
manipulated	O
via	O
functions	O
,	O
which	O
include	O
the	O
built-in	O
functions	O
that	O
come	O
with	O
Q	B-Application
(	O
which	O
are	O
defined	O
as	O
K	B-Application
macros	O
)	O
and	O
user-defined	O
functions	O
.	O
</s>
<s>
Functions	O
are	O
a	O
data	O
type	O
,	O
and	O
can	O
be	O
placed	O
in	O
lists	O
,	O
dictionaries	B-Application
and	O
tables	B-Application
,	O
or	O
passed	O
to	O
other	O
functions	O
as	O
parameters	O
.	O
</s>
<s>
Like	O
K	B-Application
,	O
Q	B-Application
is	O
interpreted	O
and	O
the	O
result	O
of	O
the	O
evaluation	O
of	O
an	O
expression	O
is	O
immediately	O
displayed	O
,	O
unless	O
terminated	O
with	O
a	O
semi-colon	O
.	O
</s>
<s>
The	O
expression	O
"	O
.z.s	O
"	O
is	O
loosely	O
equivalent	O
to	O
'	O
this	O
 '	O
in	O
Java	O
or	O
'	O
self	O
 '	O
in	O
Python	O
-	O
it	O
is	O
a	O
reference	O
to	O
the	O
containing	O
object	O
,	O
and	O
enables	O
functions	O
in	O
q	B-Application
to	O
call	O
themselves	O
.	O
</s>
<s>
The	O
q	B-Application
programming	O
language	O
contains	O
its	O
own	O
table	O
query	O
syntax	O
called	O
,	O
which	O
resembles	O
traditional	O
SQL	B-Language
but	O
has	O
important	O
differences	O
,	O
mainly	O
due	O
to	O
the	O
fact	O
that	O
the	O
underlying	O
tables	B-Application
are	O
oriented	O
by	O
column	O
,	O
rather	O
than	O
by	O
row	O
.	O
</s>
