The article highlights some important SQL concepts and key terminologies that are frequently misunderstood or confusing.
10+ comparisons are made in a tabular form in the article to clarify the differences between these concepts.
The primary key uniquely identifies every record in a table and can not contain null values, while a foreign key is used to link two tables together.
Clustered Index stores data rows in the table based on key values, while non-clustered index stores a separate structure from data rows with pointers back to the data rows.
Inner join returns matching value rows in both tables, while outer join returns all records when there is a match in either left, right or both tables.
Where filters records before any groupings are made in the result set,
Having filters records after the group by clause is applied.
Union combines the result sets of two queries and removes duplicate records, whereas union all combines the result sets of two queries but doesn't remove duplicates.
Delete removes rows one at a time and logs each row deletion, while truncate removes all rows from a table without logging individual row deletions.
Drop removes a table entirely, while delete removes rows based on the condition but keeps table structure intact.
Char is a fixed-length data type that always occupies fixed storage space, while varchar is a variable-length data type that occupies space based on the actual length of the data.