SQL Differences
SQL Differences
COMMIT ROLLBACK
COMMIT permanently saves the
ROLLBACK undo the changes made
changes made by the current
by the current transaction.
transaction.
The transaction can not undo Transaction reaches its previous
changes after COMMIT execution. state after ROLLBACK.
CHAR VARCHAR
The CHAR is a data type with fixed The VARCHAR is a data type with
length. variable length.
The CHAR uses the entire declared
The VARCHAR does not use the
length even if fewer characters are
entire declared length.
stored in the variable.
The VARCHAR uses only the length
The CHAR loads empty spaces
loaded with characters.
DDL DML
HAVING WHERE
HAVING Clause can be used with WHERE Clause can be used without
GROUP BY Clause GROUP BY Clause
WHERE Clause can be used with
HAVING Clause can only be used
SELECT, UPDATE, DELETE
with SELECT statement.
statement.
HAVING Clause implements in WHERE Clause implements in row
column operation operations
NATURAL JOIN EQUI JOIN
It joins the tables based on the It joins the tables based on the
same column names and their data equality or matching column values
types. in the associated tables.
It can return all attributes of both
It always returns unique columns tables along with duplicate
in the result set. columns that match the join
condition.
cursor.fetchall() cursor.fetchmany(size)
Fetches all rows from the query Fetches a specified number of rows
result set at once. (size) at a time.
List of tuples (each tuple is a row). List of tuples (each tuple is a row).
Up to size rows; subsequent calls
All rows available from the query.
fetch the next set.