├── Chapter01 ├── B19406_Chapter01.txt └── Chapter 1 dataset.xlsx ├── Chapter02 ├── B19406_Chapter02 .txt └── Chapter 2 _Dataset.xlsx ├── Chapter03 ├── B19406_Chapter03.docx └── Chapter 3 _Dataset.xlsx ├── Chapter04 ├── B19406_Chapter04.txt └── Chapter 4 dataset.xlsx ├── Chapter05 ├── B19406_Chapter05.txt └── Chapter 5 dataset.xlsx ├── Chapter06 ├── B19406_Chapter06.txt └── Chapter 6 Dataset.xlsx ├── Chapter07 ├── B19406_Chapter07.docx └── Chapter 7 Dataset.xlsx ├── Chapter08 ├── B19406_Chapter08.txt └── Chapter 8 dataset.xlsx ├── Chapter09 ├── B19406_Chapter09.docx └── Chapter 9 _Dataset.xlsx ├── Chapter10 └── Chapter 10 dataset.xlsx ├── Chapter11 ├── B19406_Chapter11.txt └── Chapter 11 dataset.xlsx ├── Chapter12 ├── B19406_Chapter12.txt └── Chapter 12 dataset.xlsx ├── Chapter13 ├── B19406_Chapter13.txt └── Chapter 13 dataset.xlsx ├── LICENSE └── README.md /Chapter01/B19406_Chapter01.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter01/B19406_Chapter01.txt -------------------------------------------------------------------------------- /Chapter01/Chapter 1 dataset.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter01/Chapter 1 dataset.xlsx -------------------------------------------------------------------------------- /Chapter02/B19406_Chapter02 .txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter02/B19406_Chapter02 .txt -------------------------------------------------------------------------------- /Chapter02/Chapter 2 _Dataset.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter02/Chapter 2 _Dataset.xlsx -------------------------------------------------------------------------------- /Chapter03/B19406_Chapter03.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter03/B19406_Chapter03.docx -------------------------------------------------------------------------------- /Chapter03/Chapter 3 _Dataset.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter03/Chapter 3 _Dataset.xlsx -------------------------------------------------------------------------------- /Chapter04/B19406_Chapter04.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter04/B19406_Chapter04.txt -------------------------------------------------------------------------------- /Chapter04/Chapter 4 dataset.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter04/Chapter 4 dataset.xlsx -------------------------------------------------------------------------------- /Chapter05/B19406_Chapter05.txt: -------------------------------------------------------------------------------- 1 | Identifying Null/Missing Values 2 | SELECT COUNT(*) AS null_count FROM customers WHERE email IS NULL; 3 | NULL Values vs 0 4 | SELECT * FROM customers WHERE phone IS NULL; 5 | 6 | SELECT name, COALESCE(phone, 'N/A') AS phone FROM customers; 7 | IS NULL() and IS NOT NULL() - Case Scenario 8 | SELECT 9 | make, 10 | model, 11 | last_service, 12 | next_service 13 | FROM vehicles 14 | WHERE next_service IS NULL; 15 | 16 | SELECT 17 | make, 18 | model, 19 | last_service, 20 | next_service 21 | FROM vehicles 22 | WHERE next_service IS NOT NULL; 23 | IFNULL() 24 | SELECT IFNULL(name, 'N/A') FROM table_name; 25 | OR 26 | SELECT IFNULL(name, 0) FROM table_name; 27 | Case Scenario 28 | 29 | SELECT 30 | IFNULL(customer_id, 'anonymous') as customer, 31 | SUM(total) as total_sales 32 | FROM orders 33 | GROUP BY customer; 34 | 35 | SELECT 36 | IFNULL(age, 'unknown') as age, 37 | SUM(spending) as total_spending 38 | FROM customer 39 | GROUP BY age; 40 | COALESCE() 41 | COALESCE(expression1, expression2, ... expression_n); 42 | 43 | SELECT name, COALESCE(price, 0) AS price FROM orders; 44 | Result: 45 | This will result in 0 for missing values as we are using 0 where the price is null. 46 | Case Scenario 47 | SELECT name, COALESCE(email, phone) AS contact_method FROM customers; 48 | 49 | SELECT 50 | post, 51 | COALESCE(likes, 0) AS likes, 52 | COALESCE(shares, 0) AS shares 53 | FROM posts; 54 | IS NULL VS = NULL 55 | * Using "IS NULL" 56 | SELECT * FROM employees WHERE salary IS NULL; 57 | * Using "= NULL" 58 | SELECT * FROM employees WHERE salary = NULL; 59 | 60 | * Using "IS NULL" 61 | 62 | SELECT * FROM employees WHERE salary IS NULL; 63 | * Using "= NULL" 64 | SELECT * FROM employees WHERE salary = NULL; 65 | -------------------------------------------------------------------------------- /Chapter05/Chapter 5 dataset.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter05/Chapter 5 dataset.xlsx -------------------------------------------------------------------------------- /Chapter06/B19406_Chapter06.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter06/B19406_Chapter06.txt -------------------------------------------------------------------------------- /Chapter06/Chapter 6 Dataset.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter06/Chapter 6 Dataset.xlsx -------------------------------------------------------------------------------- /Chapter07/B19406_Chapter07.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter07/B19406_Chapter07.docx -------------------------------------------------------------------------------- /Chapter07/Chapter 7 Dataset.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter07/Chapter 7 Dataset.xlsx -------------------------------------------------------------------------------- /Chapter08/B19406_Chapter08.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter08/B19406_Chapter08.txt -------------------------------------------------------------------------------- /Chapter08/Chapter 8 dataset.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter08/Chapter 8 dataset.xlsx -------------------------------------------------------------------------------- /Chapter09/B19406_Chapter09.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter09/B19406_Chapter09.docx -------------------------------------------------------------------------------- /Chapter09/Chapter 9 _Dataset.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter09/Chapter 9 _Dataset.xlsx -------------------------------------------------------------------------------- /Chapter10/Chapter 10 dataset.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter10/Chapter 10 dataset.xlsx -------------------------------------------------------------------------------- /Chapter11/B19406_Chapter11.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter11/B19406_Chapter11.txt -------------------------------------------------------------------------------- /Chapter11/Chapter 11 dataset.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter11/Chapter 11 dataset.xlsx -------------------------------------------------------------------------------- /Chapter12/B19406_Chapter12.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter12/B19406_Chapter12.txt -------------------------------------------------------------------------------- /Chapter12/Chapter 12 dataset.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter12/Chapter 12 dataset.xlsx -------------------------------------------------------------------------------- /Chapter13/B19406_Chapter13.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter13/B19406_Chapter13.txt -------------------------------------------------------------------------------- /Chapter13/Chapter 13 dataset.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Data-Wrangling-with-SQL/fb369910267b88edb25826cdf3a4c699d1454468/Chapter13/Chapter 13 dataset.xlsx -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Packt 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 |
[](https://packt.link/algotradingpython)
3 | 4 | 5 | 6 | ## Machine Learning Summit 2025 7 | **Bridging Theory and Practice: ML Solutions for Today’s Challenges** 8 | 9 | 3 days, 20+ experts, and 25+ tech sessions and talks covering critical aspects of: 10 | - **Agentic and Generative AI** 11 | - **Applied Machine Learning in the Real World** 12 | - **ML Engineering and Optimization** 13 | 14 | 👉 [Book your ticket now >>](https://packt.link/mlsumgh) 15 | 16 | --- 17 | 18 | ## Join Our Newsletters 📬 19 | 20 | ### DataPro 21 | *The future of AI is unfolding. Don’t fall behind.* 22 | 23 | 24 | 25 | Stay ahead with [**DataPro**](https://landing.packtpub.com/subscribe-datapronewsletter/?link_from_packtlink=yes), the free weekly newsletter for data scientists, AI/ML researchers, and data engineers. 26 | From trending tools like **PyTorch**, **scikit-learn**, **XGBoost**, and **BentoML** to hands-on insights on **database optimization** and real-world **ML workflows**, you’ll get what matters, fast. 27 | 28 | > Stay sharp with [DataPro](https://landing.packtpub.com/subscribe-datapronewsletter/?link_from_packtlink=yes). Join **115K+ data professionals** who never miss a beat. 29 | 30 | --- 31 | 32 | ### BIPro 33 | *Business runs on data. Make sure yours tells the right story.* 34 | 35 | 36 | 37 | [**BIPro**](https://landing.packtpub.com/subscribe-bipro-newsletter/?link_from_packtlink=yes) is your free weekly newsletter for BI professionals, analysts, and data leaders. 38 | Get practical tips on **dashboarding**, **data visualization**, and **analytics strategy** with tools like **Power BI**, **Tableau**, **Looker**, **SQL**, and **dbt**. 39 | 40 | > Get smarter with [BIPro](https://landing.packtpub.com/subscribe-bipro-newsletter/?link_from_packtlink=yes). Trusted by **35K+ BI professionals**, see what you’re missing. 41 | 42 | 43 | ### [Packt Conference : Put Generative AI to work on Oct 11-13 (Virtual)](https://packt.link/JGIEY) 44 | 45 |[](https://packt.link/JGIEY)
46 | 3 Days, 20+ AI Experts, 25+ Workshops and Power Talks 47 | 48 | Code: USD75OFF 49 | 50 | # Data Wrangling with SQL 51 | 52 |