From 311bcfc6b3acdd6fd152798c7f287ddf74fa2a98 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 16 Apr 2024 21:46:48 +0200 Subject: Adding upstream version 15.4. Signed-off-by: Daniel Baumann --- doc/src/sgml/html/tutorial-views.html | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 doc/src/sgml/html/tutorial-views.html (limited to 'doc/src/sgml/html/tutorial-views.html') diff --git a/doc/src/sgml/html/tutorial-views.html b/doc/src/sgml/html/tutorial-views.html new file mode 100644 index 0000000..607d019 --- /dev/null +++ b/doc/src/sgml/html/tutorial-views.html @@ -0,0 +1,26 @@ + +3.2. Views

3.2. Views

+ Refer back to the queries in Section 2.6. + Suppose the combined listing of weather records and city location + is of particular interest to your application, but you do not want + to type the query each time you need it. You can create a + view over the query, which gives a name to + the query that you can refer to like an ordinary table: + +

+CREATE VIEW myview AS
+    SELECT name, temp_lo, temp_hi, prcp, date, location
+        FROM weather, cities
+        WHERE city = name;
+
+SELECT * FROM myview;
+

+

+ Making liberal use of views is a key aspect of good SQL database + design. Views allow you to encapsulate the details of the + structure of your tables, which might change as your application + evolves, behind consistent interfaces. +

+ Views can be used in almost any place a real table can be used. + Building views upon other views is not uncommon. +

\ No newline at end of file -- cgit v1.2.3