0% found this document useful (0 votes)
297 views3 pages

Difference Between

The document compares key differences between parameters and arguments, global and local variables, SQL commands like DELETE and DROP, Python file reading methods like read(), readline(), and readlines(), writing methods like write() and writeline(), object serialization methods like pickle.dump() and pickle.load(), database concepts like pickling and unpickling, types of joins like equi-join and natural join, and SQL functions like count() and count(*). It provides definitions and examples to illustrate the differences between these common programming and database concepts.

Uploaded by

harshitajain3102
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
297 views3 pages

Difference Between

The document compares key differences between parameters and arguments, global and local variables, SQL commands like DELETE and DROP, Python file reading methods like read(), readline(), and readlines(), writing methods like write() and writeline(), object serialization methods like pickle.dump() and pickle.load(), database concepts like pickling and unpickling, types of joins like equi-join and natural join, and SQL functions like count() and count(*). It provides definitions and examples to illustrate the differences between these common programming and database concepts.

Uploaded by

harshitajain3102
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

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.

Global Variable Local Variable


A variable that is declared in top-level statements is called a A name declared in a specific function body is called a local
global variable. To access the value of a global variable user variable
need to write a global keyword in front of the variable in a
function.

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;

READ() READLINE() READLINES()


<filehandle>.read([n]) <filehandle>.readline([n]) <filehandle>.readlines()
Reads at most n bytes Reads a line of input, Reads all lines and returns them in a list
If no n specified reads the entire file Reads at most n bytes
Returns read bytes in form of a string Returns read bytes in form of a string The returned data is of list type
ending with line.

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

PRIMARY KEY UNIQUE KEY


The PRIMARY KEY uniquely identifies each record in a table. It Uniquely determines a row which isn’t primary key. It can
Primary keys contain UNIQUE values, and cannot contain accept NULL values. More than one Unique keys can be
NULL values. A table can have only ONE primary key; and in defined in one table.
the table, this primary key can consist of single or multiple
columns (fields).

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy