Sumita Arora Solution

What is the use of UPDATE statement in SQL? How is it different from ALTER statement?

UPDATE statement is used for modifying the existing records in a table. The UPDATE command specifies the rows to be changed using the WHERE clause and the new data using the SET keyword.Syntax:UPDATE <table name>SET <fieldname> = <value or expression>WHERE <criteria> UPDATE ALTER It modifies the existing data of a database It modifies existing structure […]

What is the use of UPDATE statement in SQL? How is it different from ALTER statement? Read More »

What do you understand by local and global scope of variables ? How can you access a global variable inside the function, if function has a variable with same name?

When a variable is accessible or valid only within a part of program, it is referred as local scope of variable. When a variable is accessible or valid inside the whole program, it is referred as global scope of variable. To access a global variable within a function we use global statement to declare it.

What do you understand by local and global scope of variables ? How can you access a global variable inside the function, if function has a variable with same name? Read More »

13. Write the term suitable for the following description

(a)A name inside the parenthesis of a function header that can receive a value.(b)An argument passed to a specific parameter using the parameter name.(c)A value passed to a function parameter(d)A value assigned to a parameter name in the function header.(e)A value assigned to a parameter name in the function call.(f)A name defined outside all function

13. Write the term suitable for the following description Read More »

When is global statement is used? Why is its use is not recommended?

Global statement can be used when we want to assign some value to global variable without creating any local variable. It is not recommended because alter the global statement function always refer to global variable and local variable can not be created and hence control over variable and their scope id lost.

When is global statement is used? Why is its use is not recommended? Read More »

What is scope? What is the scope resolving rule of Python?

Scope determines the accessibility and validity of an identifier, function or piece of code within a part or whole program.Python follow naming resolution scope also known as LEGB rule, which are as given below: • It checks within local environment • It checks within execution environment • It checks the global environment • It checks

What is scope? What is the scope resolving rule of Python? Read More »

Differentiate the different styles of functions in Python using appropriate examples.

A function can be used in various styles in python. following are the examples of various function styles- void Function (Non Fruitful Function) def power():   x=intinput((“Enter Base”))   y=intinput((“Enter Exponent”))   for i in range(y):     r=r*x   print(r) Function with Arguments (Non Fruitful Function) def power(x,y):   for i in range(y):  

Differentiate the different styles of functions in Python using appropriate examples. Read More »

error: Content is protected !!