Difference Between
Difference Between
Parameters Arguments
These are specified during the function definition Values passed during the function call.
They are also known as formal parameters. They are also known as actual parameters.
The values passed as parameters are local variables and Every argument is assigned to a parameter when the function is
are assigned values of the arguments during the function defined.
call.
These variables help in the complete execution of the These variables are passed to the function for execution.
function.
The values contained by these parameters can only be The arguments are accessible throughout the program
accessed from function return statements or if the scope depending upon the scope of the variable assigned.
of these parameters is made global.
DELETE DROP
Data Manipulation Language (DML) command and used Data Definition Language (DDL) command whichremoves
when you want to remove some or all the tuples from a the table from database
relation
DELETE FROM relation_name WHERE condition; Drop table tablename;
Write() WriteLine()
Write()method displays the output but do not provide a new WriteLine() method displays the output and also provides a
line character. new line character it the end of the string, This would set a
new line for the next output.
DUMP() LOAD()
dump() function is used to store the object data to the file. load() function is used to retrieve pickled data.
mylist = pickle.dump( object, filehandle ) mylist = pickle.load(filehandle)
It takes 3 arguments. The primary argument is the filehandle that you get by
First argument is the object that we want to store. opening the file in read-binary (rb) mode.
The second argument is the file object we get by opening
the desired file in write-binary (wb) mode.
the third defines the protocol.
PICKLING UNPICKLING
Pickling is the process of transforming data or an object in Unpickling is the inverse of pickling process where a byte
memory (RAM) to a stream of bytes called byte streams. stream is converted back to Python object
These byte streams in a binary file can then be stored in a
disk or in a database or sent through a network.
Equi-Join Natural Join
A join which is obtained by putting a condition of equality on The join in which only one of the identical columns exists
cross join is called an 'equi join'. is called natural join.
We can extract meaningful information from the Cartesian It is similar to equi-join except that duplicate columns are
product by placing some conditions in the statement. eliminated in natural join that would otherwise appear in
equi-join.
The join in which columns are compared for equality is called
equi-join
In this type of join we put * in the select list therefore the
common column will appear twice in the output.
fetchall(): fetchone():
It will retrieve all data from a database table in It will retrieve one record from the resultset as a tuple or a list. It
form of record or tuple or a row. returns the records in a specific order like first record, the next time
next record and so on. If records are not available then it will return
None
fetches all the remaining rows of a query result, fetches the next row as a sequence; returns None when no more data
current pointer position forwards
COUNT () COUNT(*)
COUNT () is used with Column_Name passed as argument COUNT(*) returns the count of all rows in the tablE
and counts the number of non-NULL values in a column that
is given as argument.