Changes for page SQL Query

Last modified by Danniar Firdausy on 2024/09/18 20:00

From version 7.1
edited by Erik Bakker
on 2023/01/23 10:01
Change comment: There is no comment for this version
To version 9.6
edited by Danniar Firdausy
on 2024/09/18 19:59
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.ebakker
1 +XWiki.dfirdausy
Content
... ... @@ -1,5 +1,5 @@
1 1  {{container}}{{container layoutStyle="columns"}}(((
2 -In this microlearning, we will learn the basics of SQL queries. With the help of this information, you can start writing the correct queries to retrieve and write data from and to a database.
2 +In this microlearning, we will explore the fundamentals of SQL queries. By understanding these concepts, you will be equipped to write basic queries to retrieve and modify data in a database.
3 3  
4 4  Should you have any questions, please get in touch with [[academy@emagiz.com>>mailto:academy@emagiz.com]].
5 5  
... ... @@ -37,7 +37,7 @@
37 37  * The column names (id, created date, contents)
38 38  * The value per column (:headers[id], :headers[timestamp], :payload)
39 39  
40 -When combining all of this you will end up with something like this: INSERT INTO mytable (id, created date, contents) values (:headers[id], :headers[timestamp], :payload). As you can see, we want to insert our row into the table called mytable. We want to insert three values in three separate columns (id, created date, contents). Furthermore, you should note that you can use the header values and (part of) the payload as dynamic input for those values. The notation as depicted above is paramount in making this work.
40 +When combining all of this you will end up with something like this: {{code language="sql"}}INSERT INTO mytable (id, created date, contents) values (:headers[id], :headers[timestamp], :payload){{/code}}. As you can see, we want to insert our row into the table called mytable. We want to insert three values in three separate columns (id, created date, contents). Furthermore, you should note that you can use the header values and (part of) the payload as dynamic input for those values. The notation as depicted above is paramount in making this work.
41 41  
42 42  {{info}}When the primary key value already exists in the database, you will receive an error (duplicate key violation). Just as you would expect when calling a POST twice in a row with the same unique identifier.{{/info}}
43 43  
... ... @@ -74,23 +74,24 @@
74 74  
75 75  {{warning}}You should be careful when deleting records in a table! Notice the WHERE clause in the DELETE statement. The WHERE clause specifies which record(s) should be deleted. If you omit the WHERE clause, all records in the table will be deleted!{{/warning}}
76 76  
77 -== 4. Assignment ==
77 +== 4. Key takeaways ==
78 78  
79 -See if you can find any database implementation within the projects you can access. This assignment can be completed with the help of the (Academy) project that you have created/used in the previous assignment.
79 +* These examples cover the basic SQL operations: INSERT (Create), SELECT (Read), UPDATE (Update), and DELETE (Delete).
80 +* SQL queries allow you to perform essential CRUD operations to manage data in a database.
81 +* You can use dynamic values in SQL queries through SpEL expressions, making your queries more adaptable and flexible.
82 +* While SQL is commonly used, other databases may require different query languages or syntax for similar operations.
83 +* Always ensure conditions (like WHERE clauses) are applied to avoid unintentional modifications or deletions of data.
80 80  
81 -== 5. Key takeaways ==
85 +== 5. Suggested additional readings ==
82 82  
83 -* These examples cover the basics of the SQL language
84 -* The SQL language has its form of CRUD operations
85 -* You can dynamically fill the values of the SQL properties with the help of SpEL expressions
86 -* Other types of databases might require other queries
87 +If you are interested in this topic and want more information on it, please read the help text provided by eMagiz and see the following links:
87 87  
88 -If you are interested in this topic and want more information, please read the help text provided by eMagiz and read more information on the following link:
89 -
90 -* [[SQL Explained>>https://www.w3schools.com/sql/default.Asp||target="blank"]]
91 -
92 -== 7. Silent demonstration video ==
93 -
94 -As this is more of theoretical microlearning, there is no video accompanying the microlearning.
95 -
89 +* [[eMagiz Store (Menu)>>doc:Main.eMagiz Store.Accelerators.WebHome||target="blank"]]
90 +** [[Accelerators (Navigation)>>doc:Main.eMagiz Store.Accelerators.WebHome||target="blank"]]
91 +*** [[Database Connectivity (Explanation)>>doc:Main.eMagiz Store.Accelerators.Database Connectivity.WebHome||target="blank"]]
92 +* [[Expert Level (Menu)>>doc:Main.eMagiz Academy.Microlearnings.Expert Level.WebHome||target="blank"]]
93 +** [[Solution Architecture (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Expert Level.Solution Architecture.WebHome||target="blank"]]
94 +*** [[H2 Database for other applications (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Expert Level.Solution Architecture.expert-solution-architecture-h2-database-for-other-applications||target="blank"]]
95 +* [[SQL Query (Search Results)>>url:https://docs.emagiz.com/bin/view/Main/Search?sort=score&sortOrder=desc&highlight=true&facet=true&r=1&f_space_facet=0%2FMain.&l_space_facet=10&f_type=DOCUMENT&f_locale=en&f_locale=&f_locale=en&text=%22sql+query%22||target="blank"]]
96 +* [[SQL Explained (External)>>https://www.w3schools.com/sql/default.Asp||target="blank"]]
96 96  )))((({{toc/}}))){{/container}}{{/container}}