How many rows does UNION ALL return with LIMIT 3 at the end?

The query combines department names and customer names into a single list. A LIMIT 3 appears after the union. How many rows will the query return? The result depends on the DBMS. Choose a DBMS and answer for it. If the query fails, select “Error.”

Predict the resultSubqueries, CTEs, EXISTS / IN, UNIONMiddleAnalystData EngineerBackend
Input data · iv_customers
idnamecity
1AliceBerlin
2BobParis
3CarolNULL
4DanBerlin
5EveParis
Input data · iv_departments
idname
1Sales
2Engineering
3Analytics
4Legal

Query

SELECT name FROM iv_departments
UNION ALL
SELECT name FROM iv_customers
LIMIT 3