SQL: what is the difference between joining tables and creating views? [Archive] - Glock Talk

PDA

View Full Version : SQL: what is the difference between joining tables and creating views?


betyourlife
08-31-2008, 14:27
It seems to me that joining tables through query language is uneccessary if you just create a view using the tables and columns from those tables you want to query. A view is essentially a simplified way of joining the information in tables and running a normal query without all the JOIN, ON, AS hoopla isn't it?

I have done it both ways and really it seems to me that they are both two different means to the same goal.

MadeByMattell
08-31-2008, 23:15
I don't do a whole lot of SQL, but when I do, I always create views.
The reason is, the end users want to write their own reports. Most are very simple queries. However, they aren't technical enough to understand the concept of multiple tables of data and the relationships between them. We map the relationships in a view and have them create their report from the view, not the tables directly. This way they aren't confused by data they don't need to see and they don't make any idiotic choices trying to define relationships themselves.