Python Getting Started

Python Install

Many PCs and Macs will have python already installed.

To check if you have python installed on a Windows PC, search in the start bar for Python or run the following on the Command Line (cmd.exe):

C:\Users\Your Name>python --version

To check if you have python installed on a Linux or Mac, then on linux open the command line or on Mac open the Terminal and type:

python –version

If you find that you do not have Python installed on your computer, then you can download it for free from the following website: python.org


Continue reading Python Getting Started

Python Introduction

What is Python?

Python is a popular programming language. It was created by Guido van Rossum, and released in 1991.

It is used for:

  • web development (server-side),
  • software development,
  • mathematics,
  • system scripting.

What can Python do?

  • Python can be used on a server to create web applications.
  • Python can be used alongside software to create workflows.
  • Python can connect to database systems. It can also read and modify files.
  • Python can be used to handle big data and perform complex mathematics.
  • Python can be used for rapid prototyping, or for production-ready software development.

Continue reading Python Introduction

SQL USER_NAME Function

Example

Return the database user name (will return the current user since no id is specified):

SELECT USER_NAME();

Definition and Usage

The USER_NAME() function returns the database user name based on the specified id.

If no id is specified, this function will return the name of the current user.

Syntax

USER_NAME(id_number)

Continue reading SQL USER_NAME Function

SQL SESSIONPROPERTY Function

Example

Return the session settings for a specified option:

SELECT SESSIONPROPERTY('ANSI_NULLS');

Definition and Usage

The SESSIONPROPERTY() function returns the session settings for a specified option.

Syntax

SESSIONPROPERTY(option)

Continue reading SQL SESSIONPROPERTY Function

SQL NULLIF Function

Example

Compare two expressions:

SELECT NULLIF(25, 25);

Definition and Usage

The NULLIF() function returns NULL if two expressions are equal, otherwise it returns the first expression.

Syntax

NULLIF(expr1, expr2)

Continue reading SQL NULLIF Function

SQL ISNUMERIC Function

Example

Tests whether the expression is numeric:

SELECT ISNUMERIC(4567);

Definition and Usage

The ISNUMERIC() function tests whether an expression is numeric.

This function returns 1 if the expression is numeric, otherwise it returns 0.

Syntax

ISNUMERIC(expression)

Continue reading SQL ISNUMERIC Function

SQL ISNULL Function

Example

Return the specified value IF the expression is NULL, otherwise return the expression:

SELECT ISNULL(NULL, 'iampsp.com');

Definition and Usage

The ISNULL() function returns a specified value if the expression is NULL.

If the expression is NOT NULL, this function returns the expression.

Syntax

ISNULL(expression, value)

Continue reading SQL ISNULL Function

SQL IIF Function

Example

Return “YES” if the condition is TRUE, or “NO” if the condition is FALSE:

SELECT IIF(500<1000, 'YES', 'NO');

Definition and Usage

The IIF() function returns a value if a condition is TRUE, or another value if a condition is FALSE.

Syntax

IIF(condition, value_if_true, value_if_false)

Continue reading SQL IIF Function