Skip to main content

Cursors vs Set-Based SQL

Learn Cursors vs Set-Based SQL (Cursors, MySQL) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Introduction SQL is a set-based language: you describe the whole result and the optimiser chooses how to compute it with indexes, joins and parallel-friendly storage code. A cursor forces row-by-row ("RBAR") processing in the stored-program interpreter. Whenever one statement can express the work, it should win.

More lessons in Cursors