This presentation focuses on the keywords Top, Limit, Fetch First, and Row Number in SQL. These keywords are important for specifying or restricting the number of records returned by an SQL query. The use of these keywords varies across different database management systems as they are vendor-specific.
Top
.Limit
.Fetch First N Rows Only
and Row Number
.Top
in Microsoft SQL ServerSELECT TOP 3 * FROM employee
Top
is available in Microsoft SQL Server and Microsoft Access.Top
with PercentageSELECT TOP 50% * FROM employee
Limit
in MySQLSELECT * FROM employee LIMIT 3
Limit
is used in MySQL.Fetch First
in OracleSELECT * FROM employee ORDER BY Department FETCH FIRST 3 ROWS ONLY
Row Number
in OracleSELECT * FROM employee WHERE rownum <= 3
Fetch First
and Row Number
depends on Oracle version.Understanding these keywords and which database management systems support them is essential for effectively limiting records in SQL queries. Always refer to the documentation to verify compatibility with the system version you are using.
I hope the session is informative. Thank you for watching.