Relational Operations

Three specific data retrieval (or query) operations are part of the definition of a relational database management system. The relational operations allow you to tell the system exactly what data you want to see.

  • Projection selects columns.

  • Selection (also called restriction) chooses rows.

  • Join brings together data in related tables.

The physical and logical independence described earlier in this chapter means that you don't have to worry about where the data is physically stored, or how to find it—that's the database management system's problem. SQL is considered a nonprocedural language because it allows you to express what you want without specifying any of the details about where it's located or how to get it.

All three of the data retrieval operations are expressed with the SQL keyword SELECT. This can be confusing: In SQL, you use SELECT not only for the selection operation, but also for projections and joins.

To give you a bit more of the flavor of the all-important SELECT statement, here's a simplified version of its syntax:


SELECT select_list
FROM table_list
WHERE search_conditions

The next subsections explain how this deceptively simple-looking statement is used to express all three relational operations.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.14.235