Details

Job Ready SQL


Job Ready SQL


1. Aufl.

von: Kimberly A. Weiss, Haythem Balti

28,99 €

Verlag: Wiley
Format: EPUB
Veröffentl.: 19.04.2023
ISBN/EAN: 9781394181056
Sprache: englisch
Anzahl Seiten: 416

DRM-geschütztes eBook, Sie benötigen z.B. Adobe Digital Editions und eine Adobe ID zum Lesen.

Beschreibungen

<p><b>Learn the most important SQL skills and apply them in your job—quickly and efficiently!</b> <p>SQL (Structured Query Language) is the modern language that almost every relational database system supports for adding data, retrieving data, and modifying data in a database. Although basic visual tools are available to help end-users input common commands, data scientists, business intelligence analysts, Cloud engineers, Machine Learning programmers, and other professionals routinely need to query a database using SQL. <p><i>Job Ready SQL </i>provides you with the foundational skills necessary to work with data of any kind. Offering a straightforward ‘learn-by-doing’ approach, this concise and highly practical guide teaches you all the basics of SQL so you can apply your knowledge in real-world environments immediately. Throughout the book, each lesson includes clear explanations of key concepts and hands-on exercises that mirror real-world SQL tasks. <ul> <li>Teaches the basics of SQL database creation and management using easy-to-understand language</li> <li>Helps readers develop an understanding of fundamental concepts and more advanced applications such as data engineering and data science</li> <li>Discusses the key types of SQL commands, including Data Definition Language (DDL) commands and Data Manipulation Language (DML) commands</li> <li>Includes useful reference information on querying SQL-based databases</li></ul><p><i>Job Ready SQL</i> is a must-have resource for students and working professionals looking to quickly get up to speed with SQL and take their relational database skills to the next level. <p>
<p>Acknowledgments v</p> <p>About the Authors vi</p> <p>About the Technical Writer vii</p> <p>About the Technical Editor viii</p> <p>Introduction xix</p> <p><b>Part I: Introduction to Database Concepts 1</b></p> <p><b>Lesson 1: Exploring Relational Databases and SQL 3</b></p> <p>Saving Data 4</p> <p>What Is a Database? 5</p> <p>Database Uses 5</p> <p>Data vs. Information 6</p> <p>Structured vs. Unstructured 6</p> <p>Database vs. DBMS 7</p> <p>Relational Database Concepts 7</p> <p>ACID Compliance 9</p> <p>ACID Properties 10</p> <p>Atomicity 10</p> <p>Consistency 10</p> <p>Isolation 12</p> <p>Durability 12</p> <p>Databases and Log Files 12</p> <p>Entity Integrity 13</p> <p>Ensuring Uniqueness 13</p> <p>Finding Records 14</p> <p>Backup Strategies 15</p> <p>Summary 16</p> <p>Exercises 17</p> <p>Exercise 1.1: Customers and Orders 17</p> <p>Exercise 1.2: Libraries and the Books Within 17</p> <p>Exercise 1.3: Your Scenario 18</p> <p><b>Lesson 2: Applying Normalization 19</b></p> <p>What Is Normalization? 19</p> <p>Data Redundancy Is a Problem 20</p> <p>Storage Reduction 21</p> <p>Functional Dependencies 22</p> <p>Normalizing Data 22</p> <p>First Normal Form 23</p> <p>Top- to- Bottom or Left- to- Right Ordering 23</p> <p>Every Row Can Be Uniquely Identified 24</p> <p>Every Field Contains Only One Value 24</p> <p>Summary of First Normal Form 25</p> <p>Second Normal Form 26</p> <p>Normalize to 1NF 27</p> <p>Composite Keys 28</p> <p>Summary of Second Normal Form 31</p> <p>Third Normal Form 33</p> <p>Denormalization 35</p> <p>Summary 37</p> <p>Exercises 37</p> <p>Exercise 2.1: Employees 38</p> <p>Exercise 2.2: Libraries and the Books Within 38</p> <p>Exercise 2.3: Hotels 39</p> <p>Exercise 2.4: Students and Courses 39</p> <p>Exercise 2.5: On the Menu 40</p> <p><b>Lesson 3: Creating Entity- Relationship Diagrams 41</b></p> <p>Using ERDs 42</p> <p>Available Tools 43</p> <p>ERD Components 45</p> <p>Creating Tables 45</p> <p>Adding Fields 46</p> <p>Identifying Keys 47</p> <p>Including Additional Tables 47</p> <p>Showing Relationships 48</p> <p>ERD of Database 50</p> <p>What About Many- to- Many Relationships? 51</p> <p>Summary 52</p> <p>Exercises 53</p> <p>Exercise 3.1: Customers and Orders 53</p> <p>Exercise 3.2: The Relationship Between Libraries and Books 53</p> <p>Exercise 3.3: Many to Many No More 53</p> <p>Exercise 3.4: Diagramming the Menu 54</p> <p>Exercise 3.5: Database Design Assessment 54</p> <p><b>Lesson 4: Pulling It All Together: Normalizing a Vinyl Record</b></p> <p>Shop Database 57</p> <p>The Vinyl Record Shop Data Overview 58</p> <p>Step 1: Identify the Entities and Attributes 59</p> <p>Step 1 Results 60</p> <p>Step 2: First Normal Form 61</p> <p>Determining Primary Keys 62</p> <p>Resolving Multivalued Fields 63</p> <p>Normalizing the Song Entity 65</p> <p>Step 2 Results 67</p> <p>Step 3: Second Normal Form 69</p> <p>Step 3 Results 69</p> <p>Step 4: Third Normal Form 69</p> <p>Step 4 Results 70</p> <p>ERD in 3NF 71</p> <p>Step 5: Finalize the Structure 73</p> <p>Final Steps 73</p> <p>Summary 75</p> <p><b>Part II: Applying SQL 77</b></p> <p><b>Lesson 5: Working with MySQL Server 79</b></p> <p>MySQL Installation 80</p> <p>Step 1: Get the Download 80</p> <p>Step 2: Skipping the Login 80</p> <p>Step 3: Starting the Install 81</p> <p>Step 4: Tool Selection 82</p> <p>Step 5: Product Configuration 83</p> <p>Step 6: MySQL Router Configuration 87</p> <p>MySQL Notifier 90</p> <p>Command- Line Interface 91</p> <p>Getting Started with MySQL Workbench 93</p> <p>Use MySQL Workbench 96</p> <p>Run a Test Command 101</p> <p>Summary 102</p> <p>Exercises 103</p> <p>Exercise 5.1: Running the Tools 104</p> <p>Exercise 5.2: Listing the Cities 104</p> <p>Exercise 5.3: Small Cities 104</p> <p><b>Lesson 6: Diving into SQL 105</b></p> <p>Introduction to SQL 106</p> <p>SQL Syntax 106</p> <p>Semicolon 107</p> <p>Line Breaks and Indents 107</p> <p>Letter Case 108</p> <p>Commas 109</p> <p>Spaces 110</p> <p>Quotation Marks 110</p> <p>Spelling 111</p> <p>Working with Null Values 111</p> <p>Null vs. Zero 111</p> <p>Nullable Fields 112</p> <p>Consequences of Null Values 113</p> <p>Working with Indexes 116</p> <p>Primary vs. Secondary Storage 117</p> <p>Indexing Fields 117</p> <p>Default Indexes 118</p> <p>Unique and Nonunique Indexes 119</p> <p>Summary 119</p> <p>Exercises 120</p> <p>Exercise 6.1: Remember Your Lines 120</p> <p>Exercise 6.2: Contact Questions 120</p> <p>Exercise 6.3: Missing Contact 121</p> <p><b>Lesson 7: Database Management Using DDL 123</b></p> <p>Database Management 124</p> <p>Create a New Database 124</p> <p>List Existing Databases 125</p> <p>Use a Database 126</p> <p>Delete an Existing Database 127</p> <p>MySQL Data Types 127</p> <p>Data Types 128</p> <p>Numeric Data Types 128</p> <p>Integer Types 128</p> <p>Decimal Types 129</p> <p>String Types 130</p> <p>Date/Time 130</p> <p>Managing Tables in MySQL 131</p> <p>Create a Table 131</p> <p>List Tables 133</p> <p>View a Table 134</p> <p>Change a Table 135</p> <p>Dropping a Field 135</p> <p>Setting a Key Value 135</p> <p>Modifying a Field 136</p> <p>Adding a Field 137</p> <p>Altering Tables with Existing Data 137</p> <p>Delete a Table 137</p> <p>Summarizing the book Table Changes 138</p> <p>Managing Relationships in MySQL 139</p> <p>Define a Foreign Key 139</p> <p>Entity Integrity 141</p> <p>Referential Integrity 141</p> <p>Adding Data to a Foreign Key Field 141</p> <p>Updating Data in a Primary Record 142</p> <p>Deleting Data from a Primary Record 142</p> <p>Work- Arounds for Referential Integrity 142</p> <p>Remove the Foreign Key Constraints 142</p> <p>Using ON UPDATE 142</p> <p>Using ON DELETE 143</p> <p>Summary 143</p> <p>Exercises 144</p> <p>Exercise 7.1: Books Database 144</p> <p>Part 1: Define the Tables 146</p> <p>Part 2: Books Database SQL Scripts 146</p> <p>Part 3: Test the Script 147</p> <p>Exercise 7.2: DDL Activity: Movies Database 147</p> <p>Part 1: Define the Tables 148</p> <p>Part 2: Create the Script 149</p> <p>Part 3: Test the Script 149</p> <p><b>Lesson 8: Pulling It All Together: Building the Vinyl Record</b></p> <p>Shop Database 151</p> <p>Step 1: Examine the Structure 152</p> <p>Organize the Tables 154</p> <p>Create the Script File 155</p> <p>Step 2: Create the Database 155</p> <p>Step 3: Create the Primary Tables 157</p> <p>Column Order 158</p> <p>On Your Own 159</p> <p>Step 4: Create the Related Tables 160</p> <p>Create the song Table 160</p> <p>Create the songAlbum Table 162</p> <p>Create the bandArtist Table on Your Own 164</p> <p>Step 5: Finalize the Script 164</p> <p>Summary 167</p> <p><b>Part III: Data Management and Manipulation 169</b></p> <p><b>Lesson 9: Applying CRUD: Basic Data Management and Manipulation 171</b></p> <p>Data Manipulation Language 172</p> <p>Create a Database 172</p> <p>Create the Database 175</p> <p>Check That the Database Exists 176</p> <p>Insert Data 176</p> <p>Adding Without Columns Identified 177</p> <p>Adding Columns with Column Names 177</p> <p>The Better Option 178</p> <p>Inserting Multiple Rows 179</p> <p>Incrementing Auto- Increment Out of Order 180</p> <p>Inserting a Foreign Key 181</p> <p>Update Data 182</p> <p>Updating One Row 183</p> <p>Preview Before You Update 184</p> <p>Updating Multiple Rows 184</p> <p>Disabling SQL_SAFE_UPDATES 185</p> <p>Delete Data 187</p> <p>Summary 191</p> <p>Exercises 191</p> <p>Exercise 9.1: Setting Up a Book List 192</p> <p>Exercise 9.2: Updating Books 193</p> <p>Exercise 9.3: Removing a Book 193</p> <p><b>Lesson 10: Working with SELECT Queries 195</b></p> <p>Setting Up a Database 196</p> <p>Using the SELECT Keyword 199</p> <p>Using Single- Table SELECT 199</p> <p>Using SELECT * 201</p> <p>Using the WHERE Clause 202</p> <p>Filtering Numbers 205</p> <p>Filtering Dates 207</p> <p>Pattern Matching Text 207</p> <p>NULL: The “Billion- Dollar Mistake” 209</p> <p>Performing Calculations 211</p> <p>Summary 213</p> <p>Exercises 214</p> <p>Exercise 10.1: Complaints 214</p> <p>Exercise 10.2: Personal Trainer 215</p> <p>Instructions 216</p> <p>Activity 1 216</p> <p>Activity 2 216</p> <p>Activity 3 217</p> <p>Activity 4 217</p> <p>Activity 5 217</p> <p>Activity 6 217</p> <p>Activity 7 218</p> <p>Activity 8 218</p> <p>Activity 9 218</p> <p>Activity 10 218</p> <p>Activity 11 219</p> <p>Activity 12 219</p> <p>Activity 13 220</p> <p>Activity 14 220</p> <p>Activity 15 220</p> <p>Activity 16 220</p> <p>Activity 17 221</p> <p>Activity 18 221</p> <p>Activity 19 221</p> <p><b>Lesson 11: Adding JOIN Queries 223</b></p> <p>Starting with a Schema 224</p> <p>Get Data from Multiple Tables 226</p> <p>Use the JOIN Clause 228</p> <p>Inner Join 228</p> <p>Optional Syntax Elements 230</p> <p>Omitting Table Names 230</p> <p>Omitting the INNER Keyword 232</p> <p>Multiple JOINs 232</p> <p>INNER JOIN Limitations 235</p> <p>OUTER JOIN: LEFT, RIGHT, and FULL 236</p> <p>Replacing a NULL Value with Ifnull() 238</p> <p>Projects Without Workers 239</p> <p>Workers Without a Project 241</p> <p>Self- JOIN and Aliases 243</p> <p>Cross Join 246</p> <p>Summary 247</p> <p>Exercises 247</p> <p>Exercise 11.1: User Stories 248</p> <p>Exercise 11.2: Personal Trainer Activities 248</p> <p>Activity 1 (64 Rows) 248</p> <p>Activity 2 (9 Rows) 248</p> <p>Activity 3 (9 Rows) 250</p> <p>Activity 4 (35 Rows) 250</p> <p>Activity 5 (25 Rows) 250</p> <p>Activity 6 (78 Rows) 250</p> <p>Activity 7 (200 Rows) 250</p> <p>Activity 8 (0 or 1 Row) 250</p> <p>Activity 9 (12 Rows) 250</p> <p>Activity 10 (16 Rows) 251</p> <p>Activity 11 (50 Rows) 251</p> <p>Activity 12 (6 Rows, 4 Unique Rows) 251</p> <p>Activity 13 (26 Workouts, 3 Goals) 251</p> <p>Activity 14 (744 Rows) 251</p> <p><b>Lesson 12: Sorting and Limiting Query Results 253</b></p> <p>Using ORDER BY 254</p> <p>Sort by a Single Column 254</p> <p>Sort by Multiple Columns 256</p> <p>Changing the Order of the Columns 258</p> <p>Handling NULL 260</p> <p>Using LIMIT 261</p> <p>Using DISTINCT 263</p> <p>Summary 264</p> <p>Exercises 265</p> <p>Getting Started: World Database 265</p> <p>Generating an ERD for World 266</p> <p>Guidelines 267</p> <p>Exercise 12.1: What’s in the World Database? 267</p> <p>Exercise 12.2: Small Cities (42 rows) 267</p> <p>Exercise 12.3: Cities by Region (4,079 rows) 267</p> <p>Exercise 12.4: Speaking French (22 rows) 267</p> <p>Exercise 12.5: No Independence (47 rows) 268</p> <p>Exercise 12.6: Country Languages (990 rows) 268</p> <p>Exercise 12.7: No Language (6 rows) 268</p> <p>Exercise 12.8: City Population (232 rows) 268</p> <p>Exercise 12.9: Average City Population (7 rows) 268</p> <p>Exercise 12.10: GNP 269</p> <p>Exercise 12.11: Capital Cities (4,079 rows) 269</p> <p>Exercise 12.12: Country Capital Cities (239 rows) 269</p> <p><b>Lesson 13: Grouping and Aggregates 271</b></p> <p>Aggregate Functions 272</p> <p>Using GROUP BY 273</p> <p>Grouping and Multiple Columns 275</p> <p>Adding DISTINCT 277</p> <p>Using HAVING 279</p> <p>SELECT Evaluation Order 281</p> <p>Other Examples 281</p> <p>Summary 283</p> <p>Exercises 284</p> <p>The Personal Trainer Database 284</p> <p>Exercise 13.1: Number of Clients (1 row) 286</p> <p>Exercise 13.2: Counting Client Birth Dates (1 row) 286</p> <p>Exercise 13.3: Clients by City (20 rows) 286</p> <p>Exercise 13.4: Invoice Totals (1,000 rows) 286</p> <p>Exercise 13.5: Invoices More Than $500 (234 rows) 287</p> <p>Exercise 13.6: Average Line Item Totals (3 rows) 287</p> <p>Exercise 13.7: More Than $1, 000</p> <p>Paid (146 rows) 287</p> <p>Exercise 13.8: Counts by Category (13 rows) 288</p> <p>Exercise 13.9: Exercises (64 rows) 288</p> <p>Exercise 13.10: Client Birth Dates (26 rows) 288</p> <p>Exercise 13.11: Client Goal Count (500 rows, 50 rows with no goal) 289</p> <p>Exercise 13.12: Exercise Unit Value (82 rows) 289</p> <p>Exercise 13.13: Categorized Exercise Unit Value (82 rows) 289</p> <p>Exercise 13.14: Level Ages (4 rows) 290</p> <p><b>Lesson 14: Pulling It All Together: Adding Data to the Vinyl Record Shop Database 291</b></p> <p>Organize the Tables 292</p> <p>Create a Script File 293</p> <p>Inserting Data 294</p> <p>What Is a Flat File? 294</p> <p>Sql Insert 295</p> <p>Inserting by Table Order 296</p> <p>Adding by Field Name 297</p> <p>On Your Own 298</p> <p>Update Records 299</p> <p>Import CSV Data 300</p> <p>Set Up MySQL 301</p> <p>Prepare the CSV File 303</p> <p>Import the File 308</p> <p>Command- Line Import 308</p> <p>MySQL Workbench 310</p> <p>Add Data to the Script 317</p> <p>Test the Script 319</p> <p>Wrap Up the Vinyl Music Shop Script 319</p> <p>Summary 319</p> <p><b>Lesson 15: Diving into Advanced SQL Topics 321</b></p> <p>Adding Subqueries 322</p> <p>Subqueries in the IN Operator 322</p> <p>Subqueries for Tables 323</p> <p>Subqueries for Values 325</p> <p>Working with Views 326</p> <p>Understanding Transactions 327</p> <p>Transaction Example 328</p> <p>Acid 329</p> <p>Schema Optimization 331</p> <p>Choosing Optimal Data Types 331</p> <p>Indexing 333</p> <p>B- Tree Indexes 334</p> <p>Hash Indexes 335</p> <p>Summary 336</p> <p>Exercises 337</p> <p>Exercise 15.1: Recent Tasks 337</p> <p>Exercise 15.2: Before Grumps 338</p> <p>Exercise 15.3: Project Due Dates 338</p> <p>Exercise 15.4: The Work of Ealasaid Blinco 338</p> <p>Exercise 15.5: Other Databases 339</p> <p>Appendix A: Bonus Lesson on Applying SQL with Python 341</p> <p>Appendix B: SQL Quick Reference 367</p> <p>Index 375</p>
<p><b>KIMBERLY A. WEISS</b> is Senior Manager of Curriculum Operations for Wiley Edge. She has extensive experience developing interactive instructional content for a wide variety of learners. <p><b>HAYTHEM BALTI, PhD,</b> is Associate Dean at Wiley Edge (formerly mthree), a software development and data science education platform.
<p><b>DEVELOP THE SKILLS YOU NEED FOR YOUR FIRST REAL-WORLD SQL JOB</b> <p>For over 30 years, data scientists, programmers, and other tech professionals have been using SQL databases to collect, retrieve, and modify data. Thanks to its ubiquity, interacting with SQL remains an essential part of the daily lives of data scientists, business intelligence analysis, Cloud engineers, machine learning programmers, and others. <p><i>Job Ready SQL </i>delivers the foundational skills you need to work with SQL data of any type. Using a straightforward ‘learn-by-doing’ approach, this accessible and concise handbook teaches you the basics of SQL so you can quickly and efficiently apply your knowledge in real-world scenarios and environments. Every lesson includes clear explanations of key concepts and hands-on exercises that mirror SQL tasks you might encounter in the field. <p>You’ll discover the basics of SQL database creation and management, develop an understanding of the fundamental concepts underlying data engineering and data science, become familiar with more advanced concepts, like Data Definition Language (DDL) commands and Data Manipulation Language (DML) commands, and more. <p>Along with useful reference information on querying SQL-based databases, <i>Job Ready SQL </i>provides easy-to-follow information about: <ul><b><li>Exploring relational databases and SQL</li> <li>Installing a MySQL server</li> <li>Manipulating SQL data</li> <li>Joining SQL databases</li> <li>Interacting with SQL via Python, Java, and other languages</li> <li>Common and useful SQL terms</li> <li>Building and normalizing a sample SQL database</li></b></ul> <p>The companion website at <b>www.wiley.com/go/jobreadygo</b> provides supplemental files to be used by the reader in several lessons found in the book.

Diese Produkte könnten Sie auch interessieren:

Domain Architectures
Domain Architectures
von: Daniel J. Duffy
PDF ebook
31,99 €