Structured Query Language (SQL) - Cultural View of Technology

Structured Query Language (SQL) - Cultural View of Technology Structured Query Language (SQL) - Cultural View of Technology

culturalview.com
from culturalview.com More from this publisher
23.10.2012 Views

View (database) 118 Advanced view features Various database management systems have extended the views from read-only subsets of data. The Oracle database introduced the concept of materialized views: pre-executed, non-virtual views commonly used in data warehousing. They give a static snapshot of the data and may include data from remote sources. The accuracy of a materialized view depends on the frequency or trigger mechanisms behind its updates. DB2 provides so-called "materialized query tables" (MQTs) for the same purpose. Microsoft SQL Server introduced in its 2000 version indexed views which only store a separate index from the table, but not the entire data. Equivalence A view is equivalent to its source query. When queries are run against views, the query is modified. For example, if there exists a view named Accounts_view with the content as follows: accounts view: ------------- SELECT name, money_received, money_sent, (money_received - money_sent) AS balance, address, ... FROM table_customers c JOIN accounts_table a ON a.customerid = c.customer_id then the application could run a simple query such as: Sample query ------------ SELECT name, balance FROM accounts_view The RDBMS then takes the simple query, replaces the equivalent view, then sends the following to the optimiser: Preprocessed query: ------------------ SELECT name, balance FROM (SELECT name, money_received, money_sent, (money_received - money_sent) AS balance, address, ... FROM table_customers c JOIN accounts_table a ON a.customerid = c.customer_id ) From this point on the optimizer takes the query, removes unnecessary complexity (for example: it is not necessary to read the address, since the parent invocation does not make use of it) and then sends the query to the SQL engine

View (database) 119 for processing. External links • Views in Microsoft SQL Server 2005 [1] • Views in MySQL [2] • Views in PostgreSQL [3] • Views in SQLite [4] • Views in Oracle [5] • Materialized Views in Oracle [6] References [1] http://msdn.microsoft.com/en-us/library/ms187956.aspx [2] http://dev.mysql.com/doc/refman/5.1/en/views.html [3] http://www.postgresql.org/docs/current/interactive/tutorial-views.html [4] http://www.sqlite.org/lang_createview.html [5] http://download.oracle.com/docs/cd/E11882_01/server.112/e10713/schemaob.htm#CNCPT311 [6] http://download.oracle.com/docs/cd/E11882_01/server.112/e10713/schemaob.htm#CNCPT411 WQL Windows Management Instrumentation Query Language (WQL) is Microsoft's implementation of the CIM Query Language (CQL), a query language for the Common Information Model standard from the Distributed Management Task Force (DMTF). It is a subset of the standard ANSI SQL with minor semantic changes. [1] A basic WQL query remains fairly understandable for people with basic SQL knowledge. WQL is dedicated to WMI and is designed to perform queries against the CIM repository to retrieve information or get event notifications. Example As an example, the following WQL query selects all the drives on a computer that have less than 2 MB of free space: [2] SELECT * FROM Win32_LogicalDisk WHERE FreeSpace < 2097152 See also • Windows Management Instrumentation • Common Information Model • Web-Based Enterprise Management • Windows PowerShell

<strong>View</strong> (database) 119<br />

for processing.<br />

External links<br />

• <strong>View</strong>s in Micros<strong>of</strong>t <strong>SQL</strong> Server 2005 [1]<br />

• <strong>View</strong>s in My<strong>SQL</strong> [2]<br />

• <strong>View</strong>s in Postgre<strong>SQL</strong> [3]<br />

• <strong>View</strong>s in <strong>SQL</strong>ite [4]<br />

• <strong>View</strong>s in Oracle [5]<br />

• Materialized <strong>View</strong>s in Oracle [6]<br />

References<br />

[1] http://msdn.micros<strong>of</strong>t.com/en-us/library/ms187956.aspx<br />

[2] http://dev.mysql.com/doc/refman/5.1/en/views.html<br />

[3] http://www.postgresql.org/docs/current/interactive/tutorial-views.html<br />

[4] http://www.sqlite.org/lang_createview.html<br />

[5] http://download.oracle.com/docs/cd/E11882_01/server.112/e10713/schemaob.htm#CNCPT311<br />

[6] http://download.oracle.com/docs/cd/E11882_01/server.112/e10713/schemaob.htm#CNCPT411<br />

WQL<br />

Windows Management Instrumentation <strong>Query</strong> <strong>Language</strong> (WQL) is Micros<strong>of</strong>t's implementation <strong>of</strong> the CIM<br />

<strong>Query</strong> <strong>Language</strong> (CQL), a query language for the Common Information Model standard from the Distributed<br />

Management Task Force (DMTF). It is a subset <strong>of</strong> the standard ANSI <strong>SQL</strong> with minor semantic changes. [1] A basic<br />

WQL query remains fairly understandable for people with basic <strong>SQL</strong> knowledge.<br />

WQL is dedicated to WMI and is designed to perform queries against the CIM repository to retrieve information or<br />

get event notifications.<br />

Example<br />

As an example, the following WQL query selects all the drives on a computer that have less than 2 MB <strong>of</strong> free<br />

space: [2]<br />

SELECT * FROM Win32_LogicalDisk WHERE FreeSpace < 2097152<br />

See also<br />

• Windows Management Instrumentation<br />

• Common Information Model<br />

• Web-Based Enterprise Management<br />

• Windows PowerShell

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!