Other Important Database Objects

There's actually much more to physical database design than tables, rows, and constraints. However, it was necessary to discuss queries in some detail before we introduced other important database objects. I call them “important” because they can play a role in tuning an application for performance and scalability. We'll discuss the “how” part later. For now, let's review what these objects are.

Views

A view is a “pseudo-table” derived from a legal query. For example, consider the query

SELECT emp_name FROM employee;

which returns the following data:

Hannah Smith
Dan Dessens
Jill Arroyo

We can create a view EMPLOYEE_V for this query with the following SQL:

 CREATE VIEW employee_v AS SELECT emp_name FROM employee; ...

Get Building Scalable and High-Performance Java™ Web Applications Using J2EE™ Technology 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.