Results

ARBQ
george_washingtonsurveyorvarious1
george_washingtonplantervarious1
thomas_jeffersonplantervarious1
james_madisonplantervarious1
james_monroeplantervarious1
andrew_jacksonplantervarious1
george_washingtonmilitary_officerusa1
andrew_jacksonmilitary_officerusa1
william_harrisonmilitary_officerusa1
zachary_taylormilitary_officerusa1
franklin_piercemilitary_officerusa1
abraham_lincolnmilitary_officerusa1
ulysses_grantmilitary_officerusa1
james_garfieldmilitary_officerusa1
benjamin_harrisonmilitary_officerusa1
theodore_rooseveltmilitary_officerusa1
dwight_eisenhowermilitary_officerusa1
john_kennedymilitary_officerusa1
james_cartermilitary_officerusa1
john_adamslawyervarious1
thomas_jeffersonlawyervarious1
james_madisonlawyervarious1
james_monroelawyervarious1
andrew_jacksonlawyervarious1
martin_van_burenlawyervarious1
john_tylerlawyervarious1
james_polklawyervarious1
millard_fillmorelawyervarious1
franklin_piercelawyervarious1
james_buchananlawyervarious1
abraham_lincolnlawyervarious1
rutherford_hayeslawyervarious1
chester_arthurlawyervarious1
grover_clevelandlawyervarious1
benjamin_harrisonlawyervarious1
william_mckinleylawyervarious1
william_taftlawyervarious1
calvin_coolidgelawyervarious1
franklin_rooseveltlawyervarious1
barack_obamalawyervarious1
john_adamsdiplomatusa1
thomas_jeffersondiplomatusa1
james_monroediplomatusa1
john_quincy_adamsdiplomatusa1
william_harrisondiplomatusa1
james_buchanandiplomatusa1
thomas_jeffersongovernorvirginia1
james_monroegovernorvirginia1
martin_van_burengovernornew_york1
william_harrisongovernorindiana1
john_tylergovernorvirginia1
james_polkgovernortennessee1
andrew_johnsongovernortennessee1
rutherford_hayesgovernorohio1
grover_clevelandgovernornew_york1
william_mckinleygovernorohio1
theodore_rooseveltgovernornew_york1
woodrow_wilsongovernornew_jersey1
calvin_coolidgegovernormassachusetts1
franklin_rooseveltgovernornew_york1
james_cartergovernorgeorgia1
ronald_reagangovernorcalifornia1
george_w_bushgovernortexas1
james_madisonsecretary_of_stateusa1
john_quincy_adamssecretary_of_stateusa1
james_buchanansecretary_of_stateusa1
john_quincy_adamssenatorusa1
andrew_jacksonsenatorusa1
martin_van_burensenatorusa1
john_tylersenatorusa1
franklin_piercesenatorusa1
james_buchanansenatorusa1
abraham_lincolnsenatorusa1
andrew_johnsonsenatorusa1
benjamin_harrisonsenatorusa1
warren_hardingsenatorusa1
harry_trumansenatorusa1
john_kennedysenatorusa1
lyndon_johnsonsenatorusa1
richard_nixonsenatorusa1
barack_obamasenatorusa1
joseph_bidensenatorusa1
james_polkcongressmanusa1
millard_fillmorecongressmanusa1
franklin_piercecongressmanusa1
abraham_lincolncongressmanusa1
andrew_johnsoncongressmanusa1
rutherford_hayescongressmanusa1
james_garfieldcongressmanusa1
william_mckinleycongressmanusa1
theodore_rooseveltcongressmanusa1
john_kennedycongressmanusa1
lyndon_johnsoncongressmanusa1
richard_nixoncongressmanusa1
gerald_fordcongressmanusa1
george_hw_bushcongressmanusa1
millard_fillmorestate_comptrollernew_york1
chester_arthurport_customs_collectornew_york1
andrew_johnsontailorvarious1
theodore_rooseveltauthorvarious1
william_taftsolicitor_generalusa1
william_taftjudgevarious1
william_taftsecretary_of_warusa1
woodrow_wilsonacademicvarious1
warren_hardingnewspaper_publishervarious1
calvin_coolidgevice_presidentusa1
harry_trumanvice_presidentusa1
lyndon_johnsonvice_presidentusa1
richard_nixonvice_presidentusa1
gerald_fordvice_presidentusa1
george_hw_bushvice_presidentusa1
joseph_bidenvice_presidentusa1
herbert_hooverengineervarious1
herbert_hoovermining_executivevarious1
herbert_hooversecretary_of_commerceusa1
franklin_rooseveltassistant_secretary_of_the_navyusa1
harry_trumanfarmervarious1
harry_trumanclerkvarious1
dwight_eisenhowersupreme_allied_commandervarious1
ronald_reaganactorvarious1
george_hw_bushcia_directorusa1
george_w_bushbusinessmanvarious1
donald_trumpbusinessmanvarious1
barack_obamastate_senatorillinois1
donald_trumptelevision_personalityvarious1

Code

Memelang:  ?profession

SQL:  SELECT m0.aid as aid, CONCAT(m0.rid, ' ', CONCAT("?", m1.rid)) AS rid, CONCAT(m0.bid, ' ', m1.bid) AS bid, CONCAT(m0.qnt, ' ', m1.qnt) AS qnt FROM meme m0 JOIN meme m1 ON m0.rid=m1.aid WHERE m1.rid="profession" AND m0.qnt!=0 AND m1.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