Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Jamie Chan, LCF Publishing

Rating No ratings yet

Learn SQL (using MySQL) Fast and Learn It Well. Master SQL Programming with a unique Hands-On ProjectThe information era is upon us and the ability to organize and make sense of data has become an invaluable skill.Have you been hearing about data, databases and SQL and wondering what it's all about? Or perhaps you have just gotten a new job and need to learn SQL fast. This book is for you. You no longer have to feel lost and overwhelmed by all the fragmented tutorials online, nor do you have to waste your time and money learning SQL from lengthy books and expensive online courses.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A fast, hands-on introduction to SQL using MySQL, built around one continuous practice database and a final project. Best for beginners, career-switchers, or anyone who needs working SQL skills quickly rather than a reference tome. 【Book Arc】 - **Opening (~0%–11%)**: Sets up MySQL Workbench, explains how to use the book (bold code = type it yourself), and introduces the `companyHR` practice database with its `employees` and `mentorships` tables. - **Early (~11%–33%)**: Covers the core CRUD and querying toolkit — creating tables with data types and constraints (primary, foreign, unique, named), inserting/updating/deleting rows, then `SELECT` with filtering, aliases, `WHERE`, `ORDER BY`, `LIMIT`, `DISTINCT`, and subqueries. - **Early–Middle (~33%–41%)**: Moves into functions and aggregation — string, date/time (`NOW()`, `CURDATE()`), and numeric functions, plus aggregate functions (`AVG`, `MAX`, `MIN`, `SUM`) with `GROUP BY` and `ROUND`. - **Middle (~41%–52%)**: Introduces multi-table work through joins (inner, left, right), then views for simplifying queries and restricting column access. - **Late (~52%–end)**: Advances to triggers (including the `DELIMITER` trick), variables, stored procedures with IN/OUT/INOUT parameters, and stored functions that must `RETURN` a value. - **Ending**: Consolidates everything in a hands-on project, with a suggested solution in the appendix. 【Key Takeaways】 - **One database, learned by doing** (Opening): The entire book builds a single `companyHR` database, so every concept connects to a running example rather than isolated snippets. - **Constraints are the backbone of table design** (Early): Primary keys, foreign keys, unique constraints, and named constraints are taught alongside `CREATE TABLE`, showing how data integrity is enforced at the schema level. - **`SELECT` is layered, not monolithic** (Early): Filtering columns, aliases, `WHERE` operators, `AND`/`OR` with parentheses, sorting, and `LIMIT` are introduced progressively so query logic compounds naturally. - **Aggregation turns rows into insight** (Early–Middle): `GROUP BY` combined with `AVG`, `MAX`, `MIN`, `SUM`, and `ROUND` is where SQL starts answering analytical questions, not just retrieving records. - **Joins are the bridge between tables** (Middle): Inner, left, and right joins are explained with Venn diagrams and the ambiguity problem of shared column names, making multi-table queries approachable. - **Views simplify and secure access** (Middle): A view is a stored query acting as a virtual table; it can also hide sensitive columns like passwords from other users. - **Triggers and stored routines unlock automation** (Late): `DELIMITER` handling, `BEFORE`/`AFTER` triggers, variables, and stored procedures/functions show how to embed logic inside the database itself. - **The project is the real test** (Ending): A single hands-on project with a suggested solution forces you to combine schema design, querying, and routines into one working system. 【Reading Tips】 - **Type every bold example**: The book explicitly marks code you should run; skipping this defeats the "learn it well" promise. Set up `practice.sql` early and keep it open. - **Deep-read the constraints and joins chapters**: These are the conceptual hinges — constraints for correct schema design, joins for anything beyond single-table queries. Skim the function reference sections and return as needed. - **Don't fear the `DELIMITER` section**: It looks intimidating but exists only because triggers and procedures contain internal semicolons. Read it once carefully, then treat it as boilerplate. - **Do the final project before checking Appendix C**: Struggle through it first; the suggested solution is far more instructive after you've made your own mistakes. - **Treat this as a launchpad, not a reference**: It covers MySQL fundamentals efficiently but is not exhaustive — plan to follow with deeper material on indexing, performance, and administration. 【Coverage Limits】 The excerpts cover the book's structure and core teaching sequence but do not include the full text of later chapters, the complete project specification, or Appendix C's solution. Specific page-level detail on the final project's requirements is therefore not summarized here.
Excerpt 1
in blue and 'Hello World' and 'MySQL is fun!' are in green. This is the software’s way of making our code easier to read. Different words serve different pur...
View in text
Excerpt 2
ithout naming them. If we want, we can name our constraints. To do that, we add the following Let’s change the name of our co_employees table to employees no...
View in text
Excerpt 3
result of the AVG() function to 2 decimal places, we write SELECT ROUND(AVG(salary), 2) FROM employees; We’ll get 6487.78. MAX() The MAX() function returns t...
View in text
Excerpt 4
he statements below: SET @result = SQRT(9); SELECT @result; You’ll get 3 as the result. Alternatively, we can combine the two statements into a single statem...
View in text
Excerpt 5
F statement. The syntax for the IF statement is as follows: IF condition 1 is met THEN do task A; ELSEIF condition 2 is met THEN do task B; ELSEIF condition...
View in text
Excerpt 6
so that we have some variety in our data to play with later. In addition, note that we enclosed the member_since value in quotation marks. In general, we nee...
View in text
Excerpt 7
ches that of the payment_due column in the members table. Next, we need to select the payment_due column from the members table for the member that we are tr...
View in text
Excerpt 8
LARE v_payment_due VARCHAR(255); SET v_cancellation = 0; SELECT member_id, booked_date, price, payment_status INTO v_member_id, v_booked_date, v_price, v_pay...
View in text
Tags
AI categories
DatabaseSQLProgramming Language
ISBN: 1731039662
Publisher: CreateSpace
Publish Year: 2018
Language: English
Pages: 175
File Format: PDF
File Size: 2.2 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…