Squel.js npm install squel var squel = require("squel"); log( squel.select() .from("students") .field("name") .field("MIN(test_score)") .field("MAX(test_score)") .field("GROUP_CONCAT(DISTINCT test_score ORDER BY test_score DESC SEPARATOR ' ')") .group("name") .toString() ); /* SELECT name, MIN(test_score), MAX(test_score), GROUP_CONCAT(DISTINCT test_score ORDER BY test_score DESC SEPARATOR ' ') ..