SQL Query
SELECT * FROM meme m0 WHERE m0.aid='james_carter' AND m0.qnt!=0 UNION ALL SELECT * FROM meme m0 WHERE m0.aid='ronald_reagan' AND m0.qnt!=0;
Results
ARBQ
james_carterbirthjames_carter_birth1
james_carterchildamy_carter1
james_carterchildjames_earl_carter1
james_carterchildjohn_william_carter1
james_cartercollegeusa_naval_academy1
james_carterelectedpresidential_election_19761
james_cartergovernorgeorgia1
james_cartermilitary_officerusa1
james_carterpartydemocratic1
james_carterpresident_orderfirst39
james_carterspouserosalynn_carter1
james_cartertermlengthyear4
ronald_reaganactorvarious1
ronald_reaganbirthronald_reagan_birth1
ronald_reaganchildmaureen_reagan1
ronald_reaganchildmichael_reagan1
ronald_reaganchildpatti_davis1
ronald_reaganchildron_reagan1
ronald_reagancollegeeureka1
ronald_reagandeathronald_reagan_death1
ronald_reaganelectedpresidential_election_19801
ronald_reagangovernorcalifornia1
ronald_reaganpartyrepublican1
ronald_reaganpresident_orderfirst40
ronald_reaganspousenancy_reagan1
ronald_reagantermlengthyear8
Memelang SQL Demo
This is demonstration of translating Memelang to SQL for querying relational databases. See the PHP code in GitHub. A Python version is coming soon. Example queries:
Show all data in this DB.
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 attended Harvard?
.college:harvard
Which presidents were born before 1820?
.birth.year:ad<1820
Which presidents attended Columbia and were lawyers?
.college:columbia .lawyer
Who were the twentieth through thirtieth presidents?
.president_order>=20 .president_order<=30
Which presidents attended a college that was not Harvard?
.college .college:harvard=f
Which presidents did not have children?
.president_order .child=f
Who were the spouses of the twentieth through thirtieth presidents?
.president_order>=20 .president_order<=30 .spouse
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
Which presidents has children that became presidents?
.child.president_order