Warning, file /frameworks/syntax-highlighting/autotests/html/test.sql.html was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 <!DOCTYPE html> 0002 <html><head> 0003 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> 0004 <title>test.sql</title> 0005 <meta name="generator" content="KF5::SyntaxHighlighting - Definition (SQL) - Theme (Breeze Light)"/> 0006 </head><body style="background-color:#ffffff;color:#1f1c1b"><pre> 0007 <span style="color:#898887;">-- comment</span> 0008 0009 <span style="font-weight:bold;">CREATE</span> <span style="font-weight:bold;">TABLE</span> stuff <span style="font-weight:bold;">COLUMNS</span>(col1 <span style="color:#0057ae;">INT</span>, col2 <span style="color:#0057ae;">Varchar</span>); 0010 <span style="font-weight:bold;">SELECT</span> <span style="color:#ca60ca;">*</span> <span style="font-weight:bold;">FROM</span> stuff <span style="font-weight:bold;">WHERE</span> <span style="font-weight:bold;">id</span> <span style="color:#ca60ca;">=</span> <span style="color:#bf0303;">'string'</span>; 0011 <span style="font-weight:bold;">select</span> <span style="color:#ca60ca;">*</span> <span style="font-weight:bold;">from</span> stuff <span style="font-weight:bold;">where</span> <span style="font-weight:bold;">id</span> <span style="color:#ca60ca;"><</span> <span style="color:#b08000;">0.42</span>; 0012 <span style="font-weight:bold;">Select</span> col1, col2 <span style="font-weight:bold;">From</span> stuff <span style="font-weight:bold;">Where</span> stuff.col1 <span style="font-weight:bold;">IS</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NuLL</span>; 0013 0014 <span style="font-weight:bold;">CREATE</span> <span style="font-weight:bold;">TABLE</span> Persons ( 0015 <span style="font-weight:bold;">ID</span> <span style="color:#0057ae;">int</span> <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span> AUTO_INCREMENT, 0016 LastName <span style="color:#0057ae;">varchar</span>(<span style="color:#b08000;">255</span>) <span style="font-weight:bold;">NOT</span> <span style="font-weight:bold;">NULL</span>, 0017 FirstName <span style="color:#0057ae;">varchar</span>(<span style="color:#b08000;">255</span>), 0018 Age <span style="color:#0057ae;">int</span>, 0019 <span style="font-weight:bold;">PRIMARY</span> <span style="font-weight:bold;">KEY</span> (<span style="font-weight:bold;">ID</span>) 0020 <span style="font-weight:bold;">CONSTRAINT</span> CHK_Person <span style="font-weight:bold;">CHECK</span> (Age<span style="color:#ca60ca;">>=</span><span style="color:#b08000;">18</span> <span style="font-weight:bold;">AND</span> City<span style="color:#ca60ca;">=</span><span style="color:#bf0303;">'Sandnes'</span>) 0021 ); 0022 0023 <span style="font-weight:bold;">SELECT</span> column_name(s) 0024 <span style="font-weight:bold;">FROM</span> table1 0025 <span style="font-weight:bold;">FULL</span> <span style="font-weight:bold;">OUTER</span> <span style="font-weight:bold;">JOIN</span> table2 <span style="font-weight:bold;">ON</span> table1.column_name <span style="color:#ca60ca;">=</span> table2.column_name; 0026 0027 <span style="font-weight:bold;">SELECT</span> <span style="color:#ca60ca;">*</span> <span style="font-weight:bold;">FROM</span> Customers 0028 <span style="font-weight:bold;">WHERE</span> City <span style="font-weight:bold;">LIKE</span> <span style="color:#bf0303;">'[bsp]%'</span>; 0029 0030 <span style="font-weight:bold;">SELECT</span> <span style="color:#644a9b;">Count</span>(<span style="color:#ca60ca;">*</span>) <span style="font-weight:bold;">AS</span> DistinctCountries 0031 <span style="font-weight:bold;">FROM</span> (<span style="font-weight:bold;">SELECT</span> <span style="font-weight:bold;">DISTINCT</span> Country <span style="font-weight:bold;">FROM</span> Customers) 0032 <span style="font-weight:bold;">GROUP</span> <span style="font-weight:bold;">BY</span> Country 0033 <span style="font-weight:bold;">HAVING</span> <span style="color:#644a9b;">COUNT</span>(CustomerID) <span style="color:#ca60ca;">></span> <span style="color:#b08000;">5</span> 0034 <span style="font-weight:bold;">ORDER</span> <span style="font-weight:bold;">BY</span> <span style="color:#644a9b;">COUNT</span>(CustomerID) <span style="font-weight:bold;">DESC</span>; 0035 0036 <span style="font-weight:bold;">SELECT</span> <span style="color:#bf0303;">'Customer'</span> <span style="font-weight:bold;">As</span> <span style="font-weight:bold;">Type</span>, ContactName, City, Country 0037 <span style="font-weight:bold;">FROM</span> Customers 0038 <span style="font-weight:bold;">UNION</span> 0039 <span style="font-weight:bold;">SELECT</span> <span style="color:#bf0303;">'Supplier'</span>, ContactName, City, Country 0040 <span style="font-weight:bold;">FROM</span> Suppliers; 0041 0042 <span style="font-weight:bold;">SELECT</span> <span style="color:#644a9b;">COUNT</span>(ProductID), <span style="color:#644a9b;">AVG</span>(Price) 0043 <span style="font-weight:bold;">FROM</span> Products; 0044 0045 <span style="font-weight:bold;">SET</span> lock_timeout <span style="color:#ca60ca;">=</span> <span style="color:#b08000;">0</span>; 0046 <span style="font-weight:bold;">SET</span> client_encoding <span style="color:#ca60ca;">=</span> <span style="color:#bf0303;">'UTF8'</span>; 0047 <span style="font-weight:bold;">SET</span> standard_conforming_strings <span style="color:#ca60ca;">=</span> <span style="font-weight:bold;">on</span>; 0048 <span style="font-weight:bold;">SET</span> check_function_bodies <span style="color:#ca60ca;">=</span> <span style="font-weight:bold;">false</span>; 0049 <span style="font-weight:bold;">SET</span> client_min_messages <span style="color:#ca60ca;">=</span> warning; 0050 <span style="font-weight:bold;">SET</span> default_tablespace <span style="color:#ca60ca;">=</span> <span style="color:#bf0303;">''</span>; 0051 0052 <span style="font-weight:bold;">DROP</span> <span style="font-weight:bold;">TABLE</span> <span style="font-weight:bold;">IF</span> <span style="font-weight:bold;">EXISTS</span> employees; 0053 0054 <span style="font-weight:bold;">ALTER</span> <span style="font-weight:bold;">TABLE</span> <span style="font-weight:bold;">ONLY</span> employees 0055 <span style="font-weight:bold;">ADD</span> <span style="font-weight:bold;">CONSTRAINT</span> fk_employees_employees <span style="font-weight:bold;">FOREIGN</span> <span style="font-weight:bold;">KEY</span> (reportsto) <span style="font-weight:bold;">REFERENCES</span> employees; 0056 0057 <span style="font-weight:bold;">CREATE</span> <span style="font-weight:bold;">VIEW</span> [<span style="font-weight:bold;">Current</span> Product <span style="font-weight:bold;">List</span>] <span style="font-weight:bold;">AS</span> 0058 <span style="font-weight:bold;">SELECT</span> ProductID, ProductName 0059 <span style="font-weight:bold;">FROM</span> Products 0060 <span style="font-weight:bold;">WHERE</span> Discontinued <span style="color:#ca60ca;">=</span> <span style="font-weight:bold;">No</span>; 0061 0062 <span style="font-weight:bold;">SELECT</span> <span style="color:#ca60ca;">*</span> <span style="font-weight:bold;">FROM</span> [<span style="font-weight:bold;">Current</span> Product <span style="font-weight:bold;">List</span>]; 0063 0064 <span style="font-weight:bold;">SELECT</span> <span style="color:#ca60ca;">*</span> <span style="font-weight:bold;">FROM</span> [<span style="font-weight:bold;">Category</span> Sales <span style="font-weight:bold;">For</span> <span style="color:#b08000;">1997</span>] 0065 <span style="font-weight:bold;">WHERE</span> CategoryName <span style="color:#ca60ca;">=</span> <span style="color:#bf0303;">'Beverages'</span>; 0066 0067 <span style="font-weight:bold;">begin</span> 0068 <span style="font-weight:bold;">end</span> 0069 <span style="color:#924c9d;">/</span> 0070 <span style="color:#ca60ca;">/</span> 0071 <span style="color:#ca60ca;">/</span> u 0072 0073 <span style="color:#898887;">/* nested /* comments */ for */</span> PostgreSQL 0074 </pre></body></html>