Book description
Learn everything you need to know to build efficient SQL queries using this easy-to-follow beginner's guide
Key Features
- Explore all SQL statements in depth using a variety of examples
- Get to grips with database querying, data aggregate, manipulation, and much more
- Understand how to explore and process data of varying complexity to tell a story
Book Description
SQL is a powerful querying language that's used to store, manipulate, and retrieve data, and it is one of the most popular languages used by developers to query and analyze data efficiently.
If you're looking for a comprehensive introduction to SQL, Learn SQL Database Programming will help you to get up to speed with using SQL to streamline your work in no time. Starting with an overview of relational database management systems, this book will show you how to set up and use MySQL Workbench and design a database using practical examples. You'll also discover how to query and manipulate data with SQL programming using MySQL Workbench. As you advance, you'll create a database, query single and multiple tables, and modify data using SQL querying. This SQL book covers advanced SQL techniques, including aggregate functions, flow control statements, error handling, and subqueries, and helps you process your data to present your findings. Finally, you'll implement best practices for writing SQL and designing indexes and tables.
By the end of this SQL programming book, you'll have gained the confidence to use SQL queries to retrieve and manipulate data.
What you will learn
- Install, configure, and use MySQL Workbench to restore a database
- Explore different data types such as string, numeric, and date and time
- Query a single table using the basic SQL SELECT statement and the FROM, WHERE, and ORDER BY clauses
- Query multiple tables by understanding various types of table relationships
- Modify data in tables using the INSERT, UPDATE, and DELETE statements
- Use aggregate functions to group and summarize data
- Detect bad data, duplicates, and irrelevant values while processing data
Who this book is for
This book is for business analysts, SQL developers, database administrators, and students learning SQL. If you want to learn how to query and manipulate SQL data for database administration tasks or simply extract and organize relevant data for analysis, you'll find this book useful. No prior SQL experience is required.
Table of contents
- Title Page
- Copyright and Credits
- About Packt
- Contributors
- Preface
- Section 1: Database Fundamentals
- Introduction to Relational Database Management Systems
- Installing and Using MySQL Workbench
- Understanding Data Types
-
Designing and Creating a Database
- Technical requirements
- Creating a database
- Understanding table relationships
- Creating a table in the database
- Understanding indexes
- Summary
- Further reading
- Questions
- Importing and Exporting Data
- Section 2: Basic SQL Querying
-
Querying a Single Table
- Technical requirements
-
Using the SELECT statement and FROM clause
- Understanding the SELECT statement and the FROM clause
- Learning the correct order of other clauses you can use with SELECT
- Understanding the different ways to query with a SELECT statement
- Learning how to use column aliases
- Using the USE statement
- Learning how to use the DISTINCT clause
- Learning how to use the LIMIT clause
- Learning how to save a SQL query to a file
- Learning how to open a SQL file
- Learning how to add comments to your SQL code
- Using the WHERE clause
- Using the ORDER BY clause
- Using indexes with your queries
- Summary
- Questions
- Further reading
-
Querying Multiple Tables
- Technical requirements
- Understanding joins
- Using INNER JOIN
- Using OUTER JOIN
- Using advanced joins
- Understanding set theory
- Using indexes with your queries
- Summary
- Questions
- Further reading
- Modifying Data and Table Structures
- Section 3: Advanced SQL Querying
-
Working with Expressions
- Technical requirements
- Using expressions
- Using statistical functions
- Using generated columns
- Summary
- Questions
- Further reading
- Grouping and Summarizing Data
-
Advanced Querying Techniques
- Technical requirements
-
Using subqueries
-
Understanding the different types of subqueries and their usage
-
Using non-correlated subqueries
- Using a non-correlated subquery in the WHERE clause
- Using a non-correlated subquery in the SELECT clause
- Using a non-correlated subquery in the FROM clause
- Using INSERT, UPDATE, and DELETE with non-correlated subqueries
- Differences between non-correlated subqueries in other relational database management systems (RDMSes)
- Using correlated subqueries
-
Using non-correlated subqueries
-
Understanding the different types of subqueries and their usage
- Using common table expressions
- Using query hints and transaction isolation levels
- Summary
- Questions
- Further reading
-
Programmable Objects
- Technical requirements
- Creating and using views
- Creating and using variables
- Creating and using stored procedures
- Creating and using functions
- Creating and using triggers
- Creating and using temporary tables
- Summary
- Questions
- Further reading
- Section 4: Presenting Your Findings
- Exploring and Processing Your Data
- Telling a Story with Your Data
- Section 5: SQL Best Practices
- Best Practices for Designing and Querying
- SQL Appendix
- Assessments
- Other Books You May Enjoy
Product information
- Title: Learn SQL Database Programming
- Author(s):
- Release date: May 2020
- Publisher(s): Packt Publishing
- ISBN: 9781838984762
You might also like
book
Getting Started with SQL
Businesses are gathering data today at exponential rates and yet few people know how to access …
book
Effective SQL: 61 Specific Ways to Write Better SQL, First Edition
“Given the authors’ reputations, I expected to be impressed. I was blown away! . . . …
book
SQL Primer: An Accelerated Introduction to SQL Basics
Build a core level of competency in SQL so you can recognize the parts of queries …
book
SQL in 24 Hours, Sams Teach Yourself, 7th Edition
In just 24 lessons of one hour or less, Sams Teach Yourself SQL in 24 Hours …