Projection

The projection operation allows you to list (in the SELECT list) which columns you want to see. For example, if you want to see all the rows in the table that contain information about publishers, but only the columns that contain the publishers' names and identification numbers, you'd write this data retrieval statement:

SQL
select pub_id, pub_name
from publishers

Here are the results you would get:

Results
						pub_id pub_name
====== ========================================
0736   New Age Books
0877   Binnet & Hardley
1389   Algodata Infosystems
[3 rows]

Once again, don't concern yourself with the SQL syntax at this point. Focus on understanding the conceptual point: A projection specifies a subset of the columns in the table. Note that the ...

Get Practical SQL Handbook, The: Using SQL Variants, 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.