[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-573231-105":53,"doc-detail-573231-en":126},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":119,"head_meta":121,"extra_data":123,"updated_unix":125},105,"en","sql-cheat-sheet-fundamentals-quick-sql-syntax-guide","SQL Cheat Sheet - Fundamentals - Quick SQL syntax guide","","Concise SQL cheat sheet covering core query fundamentals and intermediate techniques. Explains how to perform single and multiple calculations in SELECT, rename computed results with AS, and retrieve either whole tables or specific columns with correct clause precedence. Includes examples for limiting rows, adding single-line and block comments, and constructing joins using INNER, LEFT, RIGHT, and FULL OUTER join patterns. Also demonstrates ORDER BY sorting by position, subqueries with limits, combining columns via string concatenation, filtering with LIKE, and conditional logic using CASE and WITH common table expressions.",{"@graph":63,"@context":118},[64,80,101],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/sql-cheat-sheet-fundamentals-quick-sql-syntax-guide/573231/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/sql-cheat-sheet-fundamentals-quick-sql-syntax-guide/573231.png","ImageObject",442,249,{"name":88,"@type":89},"Riley West","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-18","2026-10-13",true,{"@type":98,"interactionType":99,"userInteractionCount":79},"InteractionCounter",{"@type":100},"ViewAction",{"@type":102,"mainEntity":103},"FAQPage",[104,110,114],{"name":105,"@type":106,"acceptedAnswer":107},"How should SQL clauses be ordered when writing a query?","Question",{"text":108,"@type":109},"SQL requires clauses in a specific order of precedence, including FROM before SELECT and LIMIT being applied after. The cheat sheet highlights FROM, SELECT, LIMIT as the key order.","Answer",{"name":111,"@type":106,"acceptedAnswer":112},"What are common ways to join tables in SQL?",{"text":113,"@type":109},"The cheat sheet provides examples for INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL OUTER JOIN, each with ON join constraints. It also shows joining more than two tables using repeated JOIN clauses.",{"name":115,"@type":106,"acceptedAnswer":116},"How do you add conditional logic and reuse query results in SQL?",{"text":117,"@type":109},"Use CASE with WHEN/THEN/ELSE to create a computed column based on comparisons. For reuse, the sheet demonstrates the WITH clause (common table expressions) and shows how to chain multiple WITH statements.","https://schema.org",{"og:url":78,"og:type":120,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":122,"canonical":78},"index,follow",{"doc_id":124,"site_id":56},573231,1792014832,{"code":4,"msg":5,"data":127},{"doc_id":124,"user_id":128,"nickname":88,"user_avatar":129,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":130,"file_id":131,"file_url":132,"file_type":133,"file_size":134,"view_count":79,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":73,"language":135,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":136,"faqs":137,"seo_title":138,"seo_description":61,"update_tm":139,"read_time":9},1099523885074,"https://ap-avatar.wpscdn.com/davatar_9964176cb1d06d4a9deccf72a44ae3dc","SQL Cheat Sheet: Fundamentals  \nPerforming calculations with SQL  \nPerforming a single calculation:  \nSELECT  \n1320+17;  \nPerforming multiple calculations:  \nSELECT  \n1320+17, 1340-3, 7*191, 8022/6;  \nPerforming calculations with multiple numbers:  \nSELECT  \n1*2*3, 1+2+3;  \nRenaming results:  \nSELECT 2*3 AS mult, 1+2+3 AS nice_sum;  \nSelecting tables, columns, and rows:  \nRemember: The order of clauses matters in SQL. SQL uses the following order of precedence: FROM, SELECT, LIMIT.  \nDisplay the whole table:  \nSELECT FROM  \n*  \ntable_name;  \nSelect speciﬁc columns from a table:  \nSELECT FROM  \ncolumn_name_ 1, column_name_2 table_name;  \nDisplay the ﬁrst 10 rows on a table:  \nSELECT FROM LIMIT  \n* table_name; 10 ;  \nAdding comments to your SQL queries  \nAdding single-line comments:  \n--First comment  \nSELECT column_ 1, column_ 2, column_3--Second comment FROM table_name; --Third comment  \nAdding block comments:  \n/*  \nThis comment spans over  \nmultiple lines */  \nSELECT column_ 1, column_ 2, column_3 FROM table_name;  \nSQL Intermediate:  \nJoins & Complex Queries  \nMany of these examples use table and column names from the real SQL databases that learners work with in our interactive SQL courses. For more information, sign up for a free account and try one out!  \nJoining data in SQL:  \nJoining tables with INNER JOIN:  \nSELECT column_name_ 1, column_name_2 FROM table_name_ 1 INNER JOIN table_name_2 ON table_name_ 1 .column_name_ 1 = table_name_2 .column_name_ 1;  \nJoining tables using a LEFT JOIN:  \nSELECT * FROM facts  \nLEFT JOIN cities ON cities .facts_id = [facts.id](facts.id) ;  \nJoining tables using a RIGHT JOIN:  \nSELECT [f](f.name)[.name](f.name) country, [c](c.name)[.name](c.name) city FROM cities c  \nRIGHT JOIN facts f ON [f](f.id = c.facts)[.id =](f.id = c.facts)[ c](f.id = c.facts)[.facts](f.id = c.facts) ;  \nJoining tables using a FULL OUTER JOIN:  \nSELECT [f](f.name)[.name](f.name) country, [c](c.name)[.name](c.name) city  \nFROM cities c  \nFULL OUTER JOIN facts f ON [f](f.id = c.facts_id)[.id =](f.id = c.facts_id)[ c](f.id = c.facts_id)[.facts_id](f.id = c.facts_id) ;  \nSorting a column without specifying a column name:  \nSELECT name, migration_ rate FROM FACTS  \nORDER BY 2 desc ; --2 refers to migration_ rate column  \nUsing a join within a subquery, with a limit:  \nSELECT [c](c.name)[.name](c.name) capital_city, [f](f.name)[.name](f.name) country FROM facts f  \nINNER JOIN (  \nSELECT * FROM cities  \nWHERE capital = 1  \n) c ON c .facts_id = f .id INNER 10  \nJoining data from more than two tables:  \nSELECT [column_names] FROM [table_name_one]  \n[join_type] JOIN [table_name_two] ON [join_constraint]  \n[join_type] JOIN [table_name_three] ON [join_constraint]...  \n...  \n...  \n[join_type] JOIN [table_name_three] ON [join_constraint]  \nOther common SQL operations:  \nCombining columns into a single column:  \nSELECT  \nalbum_id,  \nartist_id,  \n\"album id is \" || album_id col_ 1,\"artist id is \" || artist_id col2,  \nalbum_id || artist_id col3 FROM album LIMIT 3 ;  \nMatching part of a string:  \nSELECT  \nfirst_name,  \nlast_name,  \nphone FROM customer  \nWHERE first_name LIKE \"%Jen%\" ;  \nUsing if/then logic in SQL with CASE:  \nCASE  \nWHEN [comparison_ 1] THEN [value_ 1]  \nWHEN [comparison_ 2] THEN [value_ 2] ELSE [value_ 3]  \nEND  \nAS [new_column_name]  \nUsing the WITH clause:  \nWITH track_info AS (  \nSELECT  \n[t.name](t.name) ,  \n[ar.name](ar.name) artist,  \nal.title album_name, FROM track t  \nINNER JOIN album al ON al.album_id = t .album_id  \nINNER JOIN artist ar ON ar .artist_id = al.artist_id)  \nSELECT * FROM track_info  \nWHERE album_name = \"Jagged Little Pill\" ;  \nCreating a view:  \nCREATE VIEW chinook.customer_2 AS SELECT * FROM chinook.customer;  \nImportant Concepts and Resources: Reserved words  \nDropping a view  \nDROP VIEW chinook.customer_ 2;  \nSelecting rows that occur in one or more SELECT statements:  \n[select_statement_one] UNION  \n[select_statement_two];  \nSelecting rows that occur in both SELECT statements:  \nSELECT *","cbCaiodKHgILy9SI","https://ap.wps.com/l/cbCaiodKHgILy9SI","pdf",2869815,"English","# Performing calculations with SQL\n## Performing a single calculation\n## Performing multiple calculations\n## Renaming results with AS\n# Selecting tables, columns, and rows\n## Clause order precedence\n## Displaying a whole table\n## Selecting specific columns\n## Limiting rows\n# Comments in SQL\n## Single-line comments\n## Block comments\n# Joins & Complex Queries\n## INNER JOIN\n## LEFT JOIN\n## RIGHT JOIN\n## FULL OUTER JOIN\n## ORDER BY\n## Joins inside subqueries with a limit\n## Joining more than two tables\n# Other common SQL operations\n## Combining columns into a single column\n## String matching with LIKE\n## Conditional logic with CASE\n## Using the WITH clause\n## Creating a view\n## UNION, INTERSECT, EXCEPT\n## Chaining WITH statements","[{\"question\":\"How should SQL clauses be ordered when writing a query?\",\"answer\":\"SQL requires clauses in a specific order of precedence, including FROM before SELECT and LIMIT being applied after. The cheat sheet highlights FROM, SELECT, LIMIT as the key order.\"},{\"question\":\"What are common ways to join tables in SQL?\",\"answer\":\"The cheat sheet provides examples for INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL OUTER JOIN, each with ON join constraints. It also shows joining more than two tables using repeated JOIN clauses.\"},{\"question\":\"How do you add conditional logic and reuse query results in SQL?\",\"answer\":\"Use CASE with WHEN/THEN/ELSE to create a computed column based on comparisons. For reuse, the sheet demonstrates the WITH clause (common table expressions) and shows how to chain multiple WITH statements.\"}]","SQL Cheat Sheet - Fundamentals - Quick SQL syntax guide | PDF",1791935274]