CREATE TABLE authors (authid DECIMAL, lname TEXT, fname TEXT)
CREATE TABLE inst (instid DECIMAL, name TEXT, country TEXT)
CREATE TABLE papers (paperid DECIMAL, title TEXT)
CREATE TABLE authorship (authid DECIMAL, instid DECIMAL, paperid DECIMAL, authorder DECIMAL)

Which author has written the most papers? Find his or her last name.
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.fname, t1.lname ORDER BY COUNT(*) DESC LIMIT 1
SELECT "t1"."lname" FROM "authors" AS "t1" JOIN "authorship" AS "t2" ON "t1"."authid" = "t2"."authid" JOIN "papers" AS "t3" ON "t2"."paperid" = "t3"."paperid" GROUP BY "t1"."fname", "t1"."lname" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 1