No database selected
		SELECT c.code, c.name, COUNT(*) AS tip_count
		FROM tiptext t
			LEFT JOIN tipcategory c
				ON t.tipcategory_id = c.id
		GROUP BY t.tipcategory_id
		ORDER BY c.name