[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-572123-105":53,"doc-detail-572123-en":127},{"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":120,"head_meta":122,"extra_data":124,"updated_unix":126},105,"en","sql-cheat-sheet-quick-reference-sql-commands","SQL CHEAT SHEET - Quick reference SQL commands","","SQL CHEAT SHEET provides a compact reference for common SQL statements and patterns. It covers querying data with SELECT, filtering with WHERE, distinct selection, sorting with ORDER BY, paging with LIMIT/OFFSET, aggregation and grouping with GROUP BY/HAVING, and joins across multiple tables. The sheet also includes SQL set operators (UNION, INTERSECT, MINUS), string pattern matching with LIKE, table management (CREATE/DROP/ALTER/TRUNCATE), views and indexes, aggregate functions, constraints, data modification (INSERT/UPDATE/DELETE), and trigger creation/removal.",{"@graph":63,"@context":119},[64,80,102],{"@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":51,"@type":70,"position":76},"https://docshare.wps.com/template/general/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/sql-cheat-sheet-quick-reference-sql-commands/572123/",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-quick-reference-sql-commands/572123.png","ImageObject",442,249,{"name":88,"@type":89},"adawds","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-23","2026-10-13",true,{"@type":98,"interactionType":99,"userInteractionCount":101},"InteractionCounter",{"@type":100},"ViewAction",8,{"@type":103,"mainEntity":104},"FAQPage",[105,111,115],{"name":106,"@type":107,"acceptedAnswer":108},"How do I select specific columns and all rows in SQL?","Question",{"text":109,"@type":110},"Use SELECT c1, c2 FROM t; to pick specific columns and SELECT * FROM t; to query all columns and rows from a table.","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"How can I join multiple tables in SQL?",{"text":114,"@type":110},"Use INNER JOIN ... ON condition for matching rows, LEFT JOIN for keeping all rows from the left table, RIGHT JOIN for keeping all rows from the right table, FULL OUTER JOIN for all matches from both, and CROSS JOIN for a Cartesian product.",{"name":116,"@type":107,"acceptedAnswer":117},"How do I create and modify table structure with constraints?",{"text":118,"@type":110},"Use CREATE TABLE to define columns, then add/alter/remove columns and constraints with ALTER TABLE. Constraints examples include PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK, and NOT NULL.","https://schema.org",{"og:url":78,"og:type":121,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":123,"canonical":78},"index,follow",{"doc_id":125,"site_id":56},572123,1792097070,{"code":4,"msg":5,"data":128},{"doc_id":125,"user_id":129,"nickname":88,"user_avatar":130,"doc_module":9,"category_id":50,"category_name":51,"doc_title":59,"doc_description":61,"doc_content":131,"file_id":132,"file_url":133,"file_type":134,"file_size":135,"view_count":101,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":76,"language":136,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":137,"faqs":138,"seo_title":139,"seo_description":61,"update_tm":140,"read_time":9},3985747872983,"https://ap-avatar.wpscdn.com/davatar_994ba38a5ba835b3df7d355c54d3ed8d","SQL CHEAT SHEET [http://www.sqltutorial.org](http://www.sqltutorial.org)  \nQUERYING DATA FROM A TABLE  SELECT c1, c2 FROM t;  \nQuery data in columns c1, c2 from a table  \nSELECT * FROM t;  \nQuery all rows and columns from a table  \nSELECT c1, c2 FROM t WHERE condition;  \nQuery data and filter rows with a condition  \nSELECT DISTINCT c1 FROM t WHERE condition;  \nQuery distinct rows from a table  \nSELECT c1, c2 FROM t ORDER BY c1 ASC [DESC];  \nSort the result set in ascending or descending order  \nSELECT c1, c2 FROM t ORDER BY c1  \nLIMIT n OFFSET offset;  \nSkip offset of rows and return the next n rows  \nSELECT c1, aggregate(c2)  \nFROM t  \nGROUP BY c1;  \nGroup rows using an aggregate function  \nSELECT c1, aggregate(c2)  \nFROM t  \nGROUP BY c1 HAVING condition;  \nFilter groups using HAVING clause  \nQUERYING FROM MULTIPLE TABLES   \nSELECT c1, c2  \nFROM t1  \nINNER JOIN t2 ON condition;  \nInner join t1 and t2  \nSELECT c1, c2  \nFROM t1  \nLEFT JOIN t2 ON condition;  \nLeft join t1 and t1  \nSELECT c1, c2  \nFROM t1  \nRIGHT JOIN t2 ON condition;  \nRight join t1 and t2  \nSELECT c1, c2  \nFROM t1  \nFULL OUTER JOIN t2 ON condition;  \nPerform full outer join  \nSELECT c1, c2  \nFROM t1  \nCROSS JOIN t2;  \nProduce a Cartesian product of rows in tables  \nSELECT c1, c2 FROM t1, t2;  \nAnother way to perform cross join  \nSELECT c1, c2  \nFROM t1 A  \nINNER JOIN t2 B ON condition;  \nJoin t1 to itself using INNER JOIN clause  \nUSING SQL OPERATORS  \nSELECT c1, c2 FROM t1  \nUNION [ALL]  \nSELECT c1, c2 FROM t2;  \nCombine rows from two queries  \nSELECT c1, c2 FROM t1  \nINTERSECT  \nSELECT c1, c2 FROM t2;  \nReturn the intersection of two queries  \nSELECT c1, c2 FROM t1  \nMINUS  \nSELECT c1, c2 FROM t2;  \nSubtract a result set from another result set  \nSELECT c1, c2 FROM t1  \nWHERE c1 [NOT] LIKE pattern;  \nQuery rows using pattern matching %, _  \nSELECT c1, c2 FROM t  \nWHERE c1 [NOT] IN value_list;  \nQuery rows in a list  \nSELECT c1, c2 FROM t  \nWHERE c1 BETWEEN low AND high;  \nQuery rows between two values  \nSELECT c1, c2 FROM t  \nWHERE c1 IS [NOT] NULL;  \nCheck if values in a table is NULL or not  \nSQL CHEAT SHEET [http://www.sqltutorial.org](http://www.sqltutorial.org)  \nMANAGING TABLES  \nCREATE TABLE t ( id INT PRIMARY KEY,  \nname VARCHAR NOT NULL, price INT DEFAULT 0  \n);  \nCreate a new table with three columns  \nDROP TABLE t ;  \nDelete the table from the database  \nALTER TABLE t ADD column;  \nAdd a new column to the table  \nALTER TABLE t DROP COLUMN c ;  \nDrop column c from the table  \nALTER TABLE t ADD constraint;  \nAdd a constraint  \nALTER TABLE t DROP constraint;  \nDrop a constraint  \nRename a table from t1 to t2  \nALTER TABLE t1 RENAME c1 TO c2 ;  \nRename column c1 to c2  \nTRUNCATE TABLE t;  \nRemove all data in a table  \nUSING SQL CONSTRAINTS  \nCREATE TABLE t(  \nc1 INT, c2 INT, c3 VARCHAR, PRIMARY KEY (c1,c2)  \n);  \nSet c1 and c2 as a primary key  \nCREATE TABLE t1( c1 INT PRIMARY KEY,  \nc2 INT,  \nFOREIGN KEY (c2) REFERENCES t2(c2)  \n);  \nSet c2 column as a foreign key  \nCREATE TABLE t( c1 INT, c1 INT, UNIQUE(c2,c3)  \n);  \nMake the values in c1 and c2 unique  \nCREATE TABLE t ( c1 INT, c2 INT,  \nCHECK(c1> 0 AND c1 >= c2)  \n);  \nEnsure c1 > 0 and values in c1 >= c2  \nCREATE TABLE t( c1 INT PRIMARY KEY,  \nc2 VARCHAR NOT NULL );  \nSet values in c2 column not NULL  \nMODIFYING DATA  \nINSERT INTO t(column_list) VALUES(value_list);  \nInsert one row into a table  \nINSERT INTO t(column_list) VALUES (value_list),  \n(value_list),….;  \nInsert multiple rows into a table  \nINSERT INTO t1(column_list) SELECT column_list  \nFROM t2;  \nInsert rows from t2 into t1  \nUPDATE t  \nSET c1 = new_value;  \nUpdate new value in the column c1 for all rows  \nUPDATE t  \nSET c1 = new_value,  \nc2 = new_value WHERE condition;  \nUpdate values in the column c1, c2 that match the condition  \nDELETE FROM t;  \nDelete all data in a table  \nDELETE FROM t WHERE condition;  \nDelete subset of rows in a table  \nSQL CHEAT SHEET [http://www.sqltutorial.org](http://www.sqltutorial.org)  \nMANAGING VIEWS  \n","cbCaijYiLwMcZ1Ly","https://ap.wps.com/l/cbCaijYiLwMcZ1Ly","pdf",230259,"English","# Querying Data from a Table\n# Querying from Multiple Tables\n# SQL Operators\n# Managing Tables\n# Using SQL Constraints\n# Modifying Data\n# Managing Views\n# Managing Indexes\n# SQL Aggregate Functions\n# Managing Triggers","[{\"question\":\"How do I select specific columns and all rows in SQL?\",\"answer\":\"Use SELECT c1, c2 FROM t; to pick specific columns and SELECT * FROM t; to query all columns and rows from a table.\"},{\"question\":\"How can I join multiple tables in SQL?\",\"answer\":\"Use INNER JOIN ... ON condition for matching rows, LEFT JOIN for keeping all rows from the left table, RIGHT JOIN for keeping all rows from the right table, FULL OUTER JOIN for all matches from both, and CROSS JOIN for a Cartesian product.\"},{\"question\":\"How do I create and modify table structure with constraints?\",\"answer\":\"Use CREATE TABLE to define columns, then add/alter/remove columns and constraints with ALTER TABLE. Constraints examples include PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK, and NOT NULL.\"}]","SQL CHEAT SHEET - Quick reference SQL commands | PDF",1791925678]