SQL Notes for Professionals book

    Amazing collection of free programming books

    Collecting
    Free
    Amazing collection of free programming books

    The Notes for Professionals book is compiled from Stack Overflow Documentation, the content is written by the beautiful people at Stack Overflow. Text content is released under Creative Commons BY-SA. See credits at the end of this book whom contributed to the various chapters. Images may be copyright of their respective owners unless otherwise specified

    Book created for educational purposes and is not affiliated with group(s), company(s) nor Stack Overflow. All trademarks belong to their respective company owners

    https://goalkicker.com/

    Content

    • 1-1
      Content list
    • 1-2
      About
    • 1-3
      Chapter 1: Getting started with SQL
    • 1-4
      Section 1.1: Overview
    • 1-5
      Chapter 2: Identifier
    • 1-6
      Section 2.1: Unquoted identifiers
    • 1-7
      Chapter 3: Data Types
    • 1-8
      Section 3.1: DECIMAL and NUMERIC
    • 1-9
      Section 3.2: FLOAT and REAL
    • 1-10
      Section 3.3: Integers
    • 1-11
      Section 3.4: MONEY and SMALLMONEY
    • 1-12
      Section 3.5: BINARY and VARBINARY
    • 1-13
      Section 3.6: CHAR and VARCHAR
    • 1-14
      Section 3.7: NCHAR and NVARCHAR
    • 1-15
      Section 3.8: UNIQUEIDENTIFIER
    • 1-16
      Chapter 4: NULL
    • 1-17
      Section 4.1: Filtering for NULL in queries
    • 1-18
      Section 4.2: Nullable columns in tables
    • 1-19
      Section 4.3: Updating fields to NULL
    • 1-20
      Section 4.4: Inserting rows with NULL fields
    • 1-21
      Chapter 5: Example Databases and Tables
    • 1-22
      Section 5.1: Auto Shop Database
    • 1-23
      Section 5.2: Library Database
    • 1-24
      Section 5.3: Countries Table
    • 1-25
      Chapter 6: SELECT
    • 1-26
      Section 6.1: Using the wildcard character to select all columns in a query
    • 1-27
      Section 6.2: SELECT Using Column Aliases
    • 1-28
      Section 6.3: Select Individual Columns
    • 1-29
      Section 6.4: Selecting specified number of records
    • 1-30
      Section 6.5: Selecting with Condition
    • 1-31
      Section 6.6: Selecting with CASE
    • 1-32
      Section 6.7: Select columns which are named after reserved keywords
    • 1-33
      Section 6.8: Selecting with table alias
    • 1-34
      Section 6.9: Selecting with more than 1 condition
    • 1-35
      Section 6.10: Selecting without Locking the table
    • 1-36
      Section 6.11: Selecting with Aggregate functions
    • 1-37
      Section 6.12: Select with condition of multiple values from column
    • 1-38
      Section 6.13: Get aggregated result for row groups
    • 1-39
      Section 6.14: Selection with sorted Results
    • 1-40
      Section 6.15: Selecting with null
    • 1-41
      Section 6.16: Select distinct (unique values only)
    • 1-42
      Section 6.17: Select rows from multiple tables
    • 1-43
      Chapter 7: GROUP BY
    • 1-44
      Section 7.1: Basic GROUP BY example
    • 1-45
      Section 7.2: Filter GROUP BY results using a HAVING clause
    • 1-46
      Section 7.3: USE GROUP BY to COUNT the number of rows for each unique entry in a given column
    • 1-47
      Section 7.4: ROLAP aggregation (Data Mining)
    • 1-48
      Chapter 8: ORDER BY
    • 1-49
      Section 8.1: Sorting by column number (instead of name)
    • 1-50
      Section 8.2: Use ORDER BY with TOP to return the top x rows based on a column's value
    • 1-51
      Section 8.3: Customizeed sorting order
    • 1-52
      Section 8.4: Order by Alias
    • 1-53
      Section 8.5: Sorting by multiple columns
    • 1-54
      Chapter 9: AND & OR Operators
    • 1-55
      Section 9.1: AND OR Example
    • 1-56
      Chapter 10: CASE
    • 1-57
      Section 10.1: Use CASE to COUNT the number of rows in a column match a condition
    • 1-58
      Section 10.2: Searched CASE in SELECT (Matches a boolean expression)
    • 1-59
      Section 10.3: CASE in a clause ORDER BY
    • 1-60
      Section 10.4: Shorthand CASE in SELECT
    • 1-61
      Section 10.5: Using CASE in UPDATE
    • 1-62
      Section 10.6: CASE use for NULL values ordered last
    • 1-63
      Section 10.7: CASE in ORDER BY clause to sort records by lowest value of 2 columns
    • 1-64
      Chapter 11: LIKE operator
    • 1-65
      Section 11.1: Match open-ended pattern
    • 1-66
      Section 11.2: Single character match
    • 1-67
      Section 11.3: ESCAPE statement in the LIKE-query
    • 1-68
      Section 11.4: Search for a range of characters
    • 1-69
      Section 11.5: Match by range or set
    • 1-70
      Section 11.6: Wildcard characters
    • 1-71
      Chapter 12: IN clause
    • 1-72
      Section 12.1: Simple IN clause
    • 1-73
      Section 12.2: Using IN clause with a subquery
    • 1-74
      Chapter 13: Filter results using WHERE and HAVING
    • 1-75
      Section 13.1: Use BETWEEN to Filter Results
    • 1-76
      Section 13.2: Use HAVING with Aggregate Functions
    • 1-77
      Section 13.3: WHERE clause with NULL/NOT NULL values
    • 1-78
      Section 13.4: Equality
    • 1-79
      Section 13.5: The WHERE clause only returns rows that match its criteria
    • 1-80
      Section 13.6: AND and OR
    • 1-81
      Section 13.7: Use IN to return rows with a value contained in a list
    • 1-82
      Section 13.8: Use LIKE to find matching strings and substrings
    • 1-83
      Section 13.9: Where EXISTS
    • 1-84
      Section 13.10: Use HAVING to check for multiple conditions in a group
    • 1-85
      Chapter 14: SKIP TAKE (Pagination)
    • 1-86
      Section 14.1: Limiting amount of results
    • 1-87
      Section 14.2: Skipping then taking some results (Pagination)
    • 1-88
      Section 14.3: Skipping some rows from result
    • 1-89
      Chapter 15: EXCEPT
    • 1-90
      Section 15.1: Select dataset except where values are in this other dataset
    • 1-91
      Chapter 16: EXPLAIN and DESCRIBE
    • 1-92
      Section 16.1: EXPLAIN Select query
    • 1-93
      Section 16.2: DESCRIBE tablename;
    • 1-94
      Chapter 17: EXISTS CLAUSE
    • 1-95
      Section 17.1: EXISTS CLAUSE
    • 1-96
      Chapter 18: JOIN
    • 1-97
      Section 18.1: Self Join
    • 1-98
      Section 18.2: Dierences between inner/outer joins
    • 1-99
      Section 18.3: JOIN Terminology: Inner, Outer, Semi, Anti..
    • 1-100
      Section 18.4: Left Outer Join
    • 1-101
      Section 18.5: Implicit Join
    • 1-102
      Section 18.6: CROSS JOIN
    • 1-103
      Section 18.7: CROSS APPLY & LATERAL JOIN
    • 1-104
      Section 18.8: FULL JOIN
    • 1-105
      Section 18.9: Recursive JOINs
    • 1-106
      Section 18.10: Basic explicit inner join
    • 1-107
      Section 18.11: Joining on a Subquery
    • 1-108
      Chapter 19: UPDATE
    • 1-109
      Section 19.1: UPDATE with data from another table
    • 1-110
      Section 19.2: Modifying existing values
    • 1-111
      Section 19.3: Updating Specified Rows
    • 1-112
      Section 19.4: Updating All Rows
    • 1-113
      Section 19.5: Capturing Updated records
    • 1-114
      Chapter 20: CREATE Database
    • 1-115
      Section 20.1: CREATE Database
    • 1-116
      Chapter 21: CREATE TABLE
    • 1-117
      Section 21.1: Create Table From Select
    • 1-118
      Section 21.2: Create a New Table
    • 1-119
      Section 21.3: CREATE TABLE With FOREIGN KEY
    • 1-120
      Section 21.4: Duplicate a table
    • 1-121
      Section 21.5: Create a Temporary or In-Memory Table
    • 1-122
      Chapter 22: CREATE FUNCTION
    • 1-123
      Section 22.1: Create a new Function
    • 1-124
      Chapter 23: TRY/CATCH
    • 1-125
      Section 23.1: Transaction In a TRY/CATCH
    • 1-126
      Chapter 24: UNION / UNION ALL
    • 1-127
      Section 24.1: Basic UNION ALL query
    • 1-128
      Section 24.2: Simple explanation and Example
    • 1-129
      Chapter 25: ALTER TABLE
    • 1-130
      Section 25.1: Add Column(s)
    • 1-131
      Section 25.2: Drop Column
    • 1-132
      Section 25.3: Add Primary Key
    • 1-133
      Section 25.4: Alter Column
    • 1-134
      Section 25.5: Drop Constraint
    • 1-135
      Chapter 26: INSERT
    • 1-136
      Section 26.1: INSERT data from another table using SELECT
    • 1-137
      Section 26.2: Insert New Row
    • 1-138
      Section 26.3: Insert Only Specified Columns
    • 1-139
      Section 26.4: Insert multiple rows at once
    • 1-140
      Chapter 27: MERGE
    • 1-141
      Section 27.1: MERGE to make Target match Source
    • 1-142
      Section 27.2: MySQL: counting users by name
    • 1-143
      Section 27.3: PostgreSQL: counting users by name
    • 1-144
      Chapter 28: cross apply, outer apply
    • 1-145
      Section 28.1: CROSS APPLY and OUTER APPLY basics
    • 1-146
      Chapter 29: DELETE
    • 1-147
      Section 29.1: DELETE all rows
    • 1-148
      Section 29.2: DELETE certain rows with WHERE
    • 1-149
      Section 29.3: TRUNCATE clause
    • 1-150
      Section 29.4: DELETE certain rows based upon comparisons with other tables
    • 1-151
      Chapter 30: TRUNCATE
    • 1-152
      Section 30.1: Removing all rows from the Employee table
    • 1-153
      Chapter 31: DROP Table
    • 1-154
      Section 31.1: Check for existence before dropping
    • 1-155
      Section 31.2: Simple drop
    • 1-156
      Chapter 32: DROP or DELETE Database
    • 1-157
      Section 32.1: DROP Database
    • 1-158
      Chapter 33: Cascading Delete
    • 1-159
      Section 33.1: ON DELETE CASCADE
    • 1-160
      Chapter 34: GRANT and REVOKE
    • 1-161
      Section 34.1: Grant/revoke privileges
    • 1-162
      Chapter 35: XML
    • 1-163
      Section 35.1: Query from XML Data Type
    • 1-164
      Chapter 36: Primary Keys
    • 1-165
      Section 36.1: Creating a Primary Key
    • 1-166
      Section 36.2: Using Auto Increment
    • 1-167
      Chapter 37: Indexes
    • 1-168
      Section 37.1: Sorted Index
    • 1-169
      Section 37.2: Partial or Filtered Index
    • 1-170
      Section 37.3: Creating an Index
    • 1-171
      Section 37.4: Dropping an Index, or Disabling and Rebuilding it
    • 1-172
      Section 37.5: Clustered, Unique, and Sorted Indexes
    • 1-173
      Section 37.6: Rebuild index
    • 1-174
      Section 37.7: Inserting with a Unique Index
    • 1-175
      Chapter 38: Row number
    • 1-176
      Section 38.1: Delete All But Last Record (1 to Many Table)
    • 1-177
      Section 38.2: Row numbers without partitions
    • 1-178
      Section 38.3: Row numbers with partitions
    • 1-179
      Chapter 39: SQL Group By vs Distinct
    • 1-180
      Section 39.1: Dierence between GROUP BY and DISTINCT
    • 1-181
      Chapter 40: Finding Duplicates on a Column Subset with Detail
    • 1-182
      Section 40.1: Students with same name and date of birth
    • 1-183
      Chapter 41: String Functions
    • 1-184
      Section 41.1: Concatenate
    • 1-185
      Section 41.2: Length
    • 1-186
      Section 41.3: Trim empty spaces
    • 1-187
      Section 41.4: Upper & lower case
    • 1-188
      Section 41.5: Split
    • 1-189
      Section 41.6: Replace
    • 1-190
      Section 41.7: REGEXP
    • 1-191
      Section 41.8: Substring
    • 1-192
      Section 41.9: Stu
    • 1-193
      Section 41.10: LEFT - RIGHT
    • 1-194
      Section 41.11: REVERSE
    • 1-195
      Section 41.12: REPLICATE
    • 1-196
      Section 41.13: Replace function in sql Select and Update query
    • 1-197
      Section 41.14: INSTR
    • 1-198
      Section 41.15: PARSENAME
    • 1-199
      Chapter 42: Functions (Aggregate)
    • 1-200
      Section 42.1: Conditional aggregation
    • 1-201
      Section 42.2: List Concatenation
    • 1-202
      Section 42.3: SUM
    • 1-203
      Section 42.4: AVG()
    • 1-204
      Section 42.5: Count
    • 1-205
      Section 42.6: Min
    • 1-206
      Section 42.7: Max
    • 1-207
      Chapter 43: Functions (Scalar/Single Row)
    • 1-208
      Section 43.1: Date And Time
    • 1-209
      Section 43.2: Character modifications
    • 1-210
      Section 43.3: Configuration and Conversion Function
    • 1-211
      Section 43.4: Logical and Mathmetical Function
    • 1-212
      Chapter 44: Functions (Analytic)
    • 1-213
      Section 44.1: LAG and LEAD
    • 1-214
      Section 44.2: PERCENTILE_DISC and PERCENTILE_CONT
    • 1-215
      Section 44.3: FIRST_VALUE
    • 1-216
      Section 44.4: LAST_VALUE
    • 1-217
      Section 44.5: PERCENT_RANK and CUME_DIST
    • 1-218
      Chapter 45: Window Functions
    • 1-219
      Section 45.1: Setting up a flag if other rows have a common property
    • 1-220
      Section 45.2: Finding "out-of-sequence" records using the LAG() function
    • 1-221
      Section 45.3: Getting a running total
    • 1-222
      Section 45.4: Adding the total rows selected to every row
    • 1-223
      Section 45.5: Getting the N most recent rows over multiple grouping
    • 1-224
      Chapter 46: Common Table Expressions
    • 1-225
      Section 46.1: generating values
    • 1-226
      Section 46.2: recursively enumerating a subtree
    • 1-227
      Section 46.3: Temporary query
    • 1-228
      Section 46.4: recursively going up in a tree
    • 1-229
      Section 46.5: Recursively generate dates, extended to include team rostering as example
    • 1-230
      Section 46.6: Oracle CONNECT BY functionality with recursive CTEs
    • 1-231
      Chapter 47: Views
    • 1-232
      Section 47.1: Simple views
    • 1-233
      Section 47.2: Complex views
    • 1-234
      Chapter 48: Materialized Views
    • 1-235
      Section 48.1: PostgreSQL example
    • 1-236
      Chapter 49: Comments
    • 1-237
      Section 49.1: Single-line comments
    • 1-238
      Section 49.2: Multi-line comments
    • 1-239
      Chapter 50: Foreign Keys
    • 1-240
      Section 50.1: Foreign Keys explained
    • 1-241
      Section 50.2: Creating a table with a foreign key
    • 1-242
      Chapter 51: Sequence
    • 1-243
      Section 51.1: Create Sequence
    • 1-244
      Section 51.2: Using Sequences
    • 1-245
      Chapter 52: Subqueries
    • 1-246
      Section 52.1: Subquery in FROM clause
    • 1-247
      Section 52.2: Subquery in SELECT clause
    • 1-248
      Section 52.3: Subquery in WHERE clause
    • 1-249
      Section 52.4: Correlated Subqueries
    • 1-250
      Section 52.5: Filter query results using query on dierent table
    • 1-251
      Section 52.6: Subqueries in FROM clause
    • 1-252
      Section 52.7: Subqueries in WHERE clause
    • 1-253
      Chapter 53: Execution blocks
    • 1-254
      Section 53.1: Using BEGIN ... END
    • 1-255
      Chapter 54: Stored Procedures
    • 1-256
      Section 54.1: Create and call a stored procedure
    • 1-257
      Chapter 55: Triggers
    • 1-258
      Section 55.1: CREATE TRIGGER
    • 1-259
      Section 55.2: Use Trigger to manage a "Recycle Bin" for deleted items
    • 1-260
      Chapter 56: Transactions
    • 1-261
      Section 56.1: Simple Transaction
    • 1-262
      Section 56.2: Rollback Transaction
    • 1-263
      Chapter 57: Table Design
    • 1-264
      Section 57.1: Properties of a well designed table
    • 1-265
      Chapter 58: Synonyms
    • 1-266
      Section 58.1: Create Synonym
    • 1-267
      Chapter 59: Information Schema
    • 1-268
      Section 59.1: Basic Information Schema Search
    • 1-269
      Chapter 60: Order of Execution
    • 1-270
      Section 60.1: Logical Order of Query Processing in SQL
    • 1-271
      Chapter 61: Clean Code in SQL
    • 1-272
      Section 61.1: Formatting and Spelling of Keywords and Names
    • 1-273
      Section 61.2: Indenting
    • 1-274
      Section 61.3: SELECT *
    • 1-275
      Section 61.4: Joins
    • 1-276
      Chapter 62: SQL Injection
    • 1-277
      Section 62.1: SQL injection sample
    • 1-278
      Section 62.2: simple injection sample
    • 1-279
      Credits
    • 1-280
      You may also like

    FAQ

    您可以透過手機、平板或是電腦登入 HiSKIO 平台,在【我的學習】>【我的書籍】頁面,選擇想看的電子書。

    Recommendations

    Reviews

    | Collecting

    Sales Plans