Learn SQL
with
MySQL
Retrieve and Manipulate Data Using
SQL Commands with Ease
Ashwin Pajankar
FIRST EDITION 2020
Copyright BPB Publications, India
ISBN: 978-93-89898-088
All Rights Reserved. No part of this publication may be reproduced or distributed in any form or by any means or stored in a database or retrieval system, without the prior written permission of the publisher with the exception to the program listings which may be entered, stored and executed in a computer system, but they can not be reproduced by the means of publication.
LIMITS OF LIABILITY AND DISCLAIMER OF WARRANTY
The information contained in this book is true to correct and the best of authors & publishers knowledge. The author has made every effort to ensure the accuracy of these publications, but cannot be held responsible for any loss or damage arising from any information in this book.
All trademarks referred to in the book are acknowledged as properties of their respective owners.
Distributors:
BPB PUBLICATIONS
20, Ansari Road, Darya Ganj
New Delhi-110002
Ph: 23254990/23254991
MICRO MEDIA
Shop No. 5, Mahendra Chambers,
DN Rd. Next to Capital Cinema,
V.T. (C.S.T.) Station, MUMBAI-400
Ph: 22078296/22078297
DECCAN AGENCIES
4-3-329, Bank Street,
Hyderabad-500195
Ph: 24756967/24756400
BPB BOOK CENTRE
Old Lajpat Rai Market,
Delhi-110006
Ph: 23861747
Published by Manish Jain for BPB Publications, Ansari Road, Darya Ganj, New Delhi-110002 and Printed by him at Repro India Ltd, Mumbai
Dedicated to
Jayant Narlikar
Prominent Indian Astrophysicist
About the Author
Ashwin is an experienced veteran who, for the past years, has been working with STEM (Science, Technology, Engineering, and Mathematics). In his career, Ashwin has worked for more than years as an employee for various IT companies and Software Product Companies. He has written more than dozen books on Arduino, Python programming, Computer Vision, IoT, databases, and other popular topics with BPB and other international publications. He has also reviewed many other technical books. He also creates courses for BPB and other platforms and teaches to 60000 students online.
He has been working as a freelancer since 2017. He got his first taste in writing in 2015 when he wrote his first book on Raspberry Pi. In his free time, Ashwin makes videos for his Youtube channel, which has 10000 subscribers now.
Outside work, Ashwin volunteers his spare time as a STEM Ambassador, helping, coaching, and mentoring young people in taking up careers in technology.
About the Reviewer
Md Abdul currently working as Staff Engineer at VMware Software India Pvt Ltd graduated from IIIT-Hyderabad with CSE degree (Honors in Data Engineering) in 2007. Aziz is passionate about open-source projects and in his leisure time works on Linux kernel projects, open stack, and cloud computing.
Aziz delivered lectures and talk on topics of IPv6, Linux Networking stack, Cloud Technologies at prestigious institutions like NIT-Warangal, PESIT, RVCE. Aziz has a patent, Multi-node Virtual Switching System (USPTO DN/20140204805). In the past, Aziz held the position of Software Development Engineer and Lead at Cisco, Microsoft in the areas of Virtualization, Data Center Technologies, Multi-layer Switching, and Internet Technologies.
Acknowledgement
There are a few people I want to thank for the continued and ongoing support they have given me during the writing of this and other books with BPB Publications.
This book would not have happened if I had not had the support from some of the key people from BPB Publications. My gratitude goes to the team at BPB. I could have never completed this book without their support. This is my fourth book with BPB, and I plan to write more.
Finally, I would like to thank the technical reviewer for his valuable input.
Preface
I have been professionally working with various DBMS ever since I started my formal professional career in June 2007. I have extensively worked with various ORDBMS (Object Relational Database Management Systems) like Oracle, IBM DB2, Teradata, MySQL, and MariaDB. And I have been working with MySQL since 2010.
We use relational databases and ORDMBS everywhere, from enterprise applications to mobile apps. They are an integral part of programmers life and livelihood. While everyone does not spend most of his working hours directly working with databases, programmers routinely access database services for their applications. Most of the organizations employ RDBMS for the structured storage of data.
SQL (Structured Query Language) is the lingua franca of the world of RDBMS and ORDBMS. Almost all the major ORDBMS software has a flavor of SQL implemented in the Engine so that the administrators and common users can interact with the ORDMBS and the data with ease. SQL has seen action on almost all the operating systems and computing platforms, including servers, desktop computers, handheld computers, and mobile devices. There is ORDBMS software available for all the types of computing devices, and the SQL is the common ground amongst them.
With these many flavors of SQL provided by various RDBMS software, beginners and novice developers are often confused with the choice of RDBMS for learning SQL. While software vendors like Oracle have provided a free to use, but non-enterprise version of their proprietary software free to use for non-commercial purposes, MySQL and its fork MariaDB are free to use projects for even commercial purpose. We can use their full features for production level and realtime usage. It is often advised for beginners to start learning SQL with MySQL or MariaDB. We can learn the SQL with the latest ANSI syntax with the help of MySQL and MariaDB databases. These databases are available with Windows and Linux. In this book, we will learn how to install MySQL and MariaDB on the Windows Platform. We will also learn how to install MariaDB on Raspberry Pi Raspbian OS (recently rechristened as Raspberry Pi OS). We will learn various interfaces like MySQL prompt and MySQL Workbench for connecting with MySQL and MariaDB servers.
This book is extremely useful for beginners as it starts from scratch and covers the most basic part in the beginning. If you have sufficient technical background and lack detailed knowledge of SQL, then this book is the right choice to get started with SQL. This book is very useful for developers, engineers, data scientists, and entry-level DBAs.
Chapter introduces to MySQL and MariaDB projects as well as the concepts in the domain of databases.
Chapter discusses the tools to connect to MySQL and MariaDB. It also explains how to download and install sample schemas on MySQL and MariaDB servers for practice.