Results

ARBQ
virginia'stategeorge_washington_birth1
massachusetts'statejohn_adams_birth1
virginia'statethomas_jefferson_birth1
virginia'statejames_madison_birth1
virginia'statejames_monroe_birth1
massachusetts'statejohn_quincy_adams_birth1
south_carolina'stateandrew_jackson_birth1
new_york'statemartin_van_buren_birth1
virginia'statewilliam_harrison_birth1
virginia'statejohn_tyler_birth1
north_carolina'statejames_polk_birth1
virginia'statezachary_taylor_birth1
new_york'statemillard_fillmore_birth1
new_hampshire'statefranklin_pierce_birth1
pennsylvania'statejames_buchanan_birth1
kentucky'stateabraham_lincoln_birth1
north_carolina'stateandrew_johnson_birth1
ohio'stateulysses_grant_birth1
ohio'staterutherford_hayes_birth1
ohio'statejames_garfield_birth1
vermont'statechester_arthur_birth1
new_jersey'stategrover_cleveland_birth1
ohio'statebenjamin_harrison_birth1
ohio'statewilliam_mckinley_birth1
new_york'statetheodore_roosevelt_birth1
ohio'statewilliam_taft_birth1
virginia'statewoodrow_wilson_birth1
ohio'statewarren_harding_birth1
vermont'statecalvin_coolidge_birth1
iowa'stateherbert_hoover_birth1
new_york'statefranklin_roosevelt_birth1
missouri'stateharry_truman_birth1
texas'statedwight_eisenhower_birth1
massachusetts'statejohn_kennedy_birth1
texas'statelyndon_johnson_birth1
california'staterichard_nixon_birth1
nebraska'stategerald_ford_birth1
georgia'statejames_carter_birth1
illinois'stateronald_reagan_birth1
massachusetts'stategeorge_hw_bush_birth1
arkansas'statewilliam_clinton_birth1
connecticut'stategeorge_w_bush_birth1
hawaii'statebarack_obama_birth1
new_york'statedonald_trump_birth1
pennsylvania'statejoseph_biden_birth1

Code

Memelang:  'state

SQL:  SELECT m0.bid AS aid, CONCAT("'", m0.rid) AS rid, m0.aid AS bid, m0.qnt AS qnt FROM meme m0 WHERE m0.rid="state" AND m0.qnt!=0;

Memelang Demo

This is demonstration of translating Memelang to SQL for querying relational databases. See the PHP code in GitHub. A Python implementation is coming soon. Example queries:

Show all data in the database.

qry.all

All about George Washington.

george_washington

Who were children of the presidents?

.child

Which presidents were members of the Whig party?

.party:whig

Which presidents were born before 1820?

.birth.year:ad<1820

Which presidents attended Columbia and were lawyers?

.college:columbia .lawyer

Who were the spouses of the twentieth through thirtieth presidents?

.president_order>=20 .president_order<=30 .spouse

Which presidents did not have children?

.president_order .child=f

Use qry.all to return all memes related to the matching As.

.college:harvard .college:columbia qry.all

Get all about James Carter as well as Ronald Reagan.

james_carter; ronald_reagan

Which presidents were lawyers that attended Harvard or William and Mary?

.lawyer .college:harvard=t1 .college:william_and_mary=t1

What were the professions of the presidents?

?profession

What were the professions of George Washington?

george_washington?profession

Which presidents previously worked for New York state?

new_york'?profession

Which presidents has children that became presidents?

.child.president_order