Results

ARBQ
yearunitvarious1
year'termlengthgeorge_washington8
year'termlengthjohn_adams4
year'termlengththomas_jefferson8
year'termlengthjames_madison8
year'termlengthjames_monroe8
year'termlengthjohn_quincy_adams4
year'termlengthandrew_jackson8
year'termlengthmartin_van_buren4
year'termlengthwilliam_harrison1
year'termlengthjohn_tyler3
year'termlengthjames_polk4
year'termlengthzachary_taylor1
year'termlengthmillard_fillmore3
year'termlengthfranklin_pierce4
year'termlengthjames_buchanan4
year'termlengthabraham_lincoln4
year'termlengthandrew_johnson3
year'termlengthulysses_grant8
year'termlengthrutherford_hayes4
year'termlengthjames_garfield0.66
year'termlengthchester_arthur4
year'termlengthgrover_cleveland8
year'termlengthbenjamin_harrison4
year'termlengthwilliam_mckinley4
year'termlengththeodore_roosevelt8
year'termlengthwilliam_taft4
year'termlengthwoodrow_wilson8
year'termlengthwarren_harding2
year'termlengthcalvin_coolidge6
year'termlengthherbert_hoover4
year'termlengthfranklin_roosevelt12
year'termlengthharry_truman8
year'termlengthdwight_eisenhower8
year'termlengthjohn_kennedy3
year'termlengthlyndon_johnson5
year'termlengthrichard_nixon5
year'termlengthgerald_ford2
year'termlengthjames_carter4
year'termlengthronald_reagan8
year'termlengthgeorge_hw_bush4
year'termlengthwilliam_clinton8
year'termlengthgeorge_w_bush8
year'termlengthbarack_obama8
year'termlengthdonald_trump4

Code

Memelang:  year qry.all

SQL:  WITH z0 AS (SELECT * FROM meme m0 WHERE m0.aid='year' AND m0.qnt!=0) SELECT * FROM meme WHERE aid IN (SELECT aid FROM z0) UNION ALL SELECT bid AS aid, CONCAT("'", rid), aid as bid, qnt FROM meme WHERE bid IN (SELECT aid FROM z0) UNION ALL SELECT * FROM z0;

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