Q&A

Q1:Does SQL provide a FOR loop?
A1: Programming constructs such as the FOR loop, the WHILE loop, and the CASE statement are extensions to ANSI SQL. Therefore, the use of these items varies widely among different database systems. For instance, Oracle provides the FOR loop, whereas Transact-SQL (SQL Server) does not. Of course, a WHILE loop can increment a variable within the loop, which can simulate the FOR loop.
Q2:I am developing a Windows (or Macintosh) application in which the user interface consists only of Windows GUI elements, such as windows and dialog boxes. Can I use the PRINT statement to issue messages to the user?
A2: SQL is entirely platform independent. Therefore, issuing the PRINT statement will not pop up a message box. To ...

Get Sams Teach Yourself SQL in 21 Days, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.