Nested views can make sense. Just be careful that you don't make them too general.
I did see a system that had a view with 14 tables mentioned explicitly, some of them connected with outer self-joins, and some of the 'tables' were themselves views. I didn't like it much, but the DBMS coped with it astonishingly well (given that it was back in the late 80s). A lot of the schema was machine generated by a data modelling tool.
CREATE VIEW IBB_V_Project AS
SELECT A.Project_Iref,
A.Section_Iref,
B.Section_Eref,
N.Company_Iref,
N.Company_Name,
A.Product_Desc,
A.Project_Type_Iref,
D.Project_Type,
A.Person_Iref,
F.Full_Name,
A.Respon_Iref,
G.Post_Location,
A.Project_Stat_Iref,
E.Project_Status,
A.Source_Iref,
I.Source,
A.Sic_Iref,
L.Sic_Eref,
A.Op_Activity_Iref,
M.Op_Activity_Desc,
A.Involve_Iref,
K.IBB_Involvement,
A.Nature_Iref,
C.Nature_Of_Next_Act,
A.Internat_Mobile,
A.Whether_Cop_Case,
A.Closed_Ind,
A.Next_Action_Date,
A.Creation_Date,
A.Last_Edit_Date,
A.Last_Editor_Iref,
H.Logname
FROM IBB_Project A,
IBB_Section B,
IBB_R_Proj_Type D,
IBB_R_Project_Stat E,
IBB_Personnel H,
OUTER IBB_R_Next_Act C,
OUTER IBB_Personnel F,
OUTER (IBB_Post_Respon X, OUTER IBB_V_Post_Resp2 G),
OUTER IBB_R_Source I,
OUTER IBB_R_Involvement K,
OUTER IBB_Sic L,
OUTER IBB_Op_Act M,
OUTER IBB_V_Proj_Co2 N
WHERE A.Section_Iref = B.Section_Iref
AND A.Project_Type_Iref = D.Project_Type_Iref
AND A.Project_Stat_Iref = E.Project_Stat_Iref
AND A.Last_Editor_Iref = H.Person_Iref
AND A.Nature_Iref = C.Nature_Iref
AND A.Person_Iref = F.Person_Iref
AND A.Respon_Iref = X.Respon_Iref
AND X.Respon_Iref = G.Person_Iref
AND A.Source_Iref = I.Source_Iref
AND A.Sic_Iref = L.Sic_Iref
AND A.Op_Activity_Iref = M.Op_Activity_Iref
AND A.Project_Iref = N.Project_Iref
AND A.Involve_Iref = K.Involve_Iref;
The outer join notation is specific to Informix (which now supports the SQL standard notation too).
Note that IBB_V_Post_Resp2 and IBB_V_Proj_Co2 are both themselves views.
In fact, IBB_V_Proj_Co2 was a 3-table view, exact details unknown but of
the form:
CREATE VIEW IBB_V_Proj_Co2 AS
SELECT A.Project_Iref,
A.Some_Other_Col col01,
B.Xxxx_Iref,
B.Some_Other_Col col02,
C.Yyyy_Iref,
C.Some_Other_Col col03
FROM IBB_Project A,
OUTER (IBB_R_Xxxx B, IBB_R_Yyyy C)
WHERE A.Xxxx_Iref = B.Xxxx_IrEf
AND B.Yyyy_Iref = C.Yyyy_Iref;
This means that the IBB_V_Project view has an outer self-join on
IBB_Project. The IBB_V_Post_Resp2 view probably involved 3 tables
too (my notes on that were a bit unclear, way back in 1993, when I recorded this information).
CREATE VIEW IBB_V_Post_Resp2 AS
SELECT A.Person_Iref,
A.Some_Other_Col col01,
B.Xxxx_Iref,
B.Some_Other_Col col02,
C.Yyyy_Iref,
C.Some_Other_Col col03
FROM IBB_Personnel A,
IBB_R_Xxxx B,
IBB_R_Yyyy C
WHERE A.Xxxx_Iref = B.Xxxx_Iref
AND B.Yyyy_Iref = C.Yyyy_Iref;
The Zzzz_Iref columns were either SERIAL or INTEGER foreign keys
referencing a SERIAL key.
The primary view definition refers to 14 tables, with 4 inner joins and 9
outer joins. When the cross-referenced views are taken into account, there
are 18 tables in total, with 7 inner joins and 10 outer joins.