Selenium WebDriver Java Framework Course Limited Time Offer for $20

Selenium WebDriver Java Framework Course Limited Time Offer for $20

 

Print

Insert Records in SQL Statement

In software testing, sometimes QA engineers need to populate data into database tables. Using INSERT statement, we can insert records into a database table.

 

Print

Case When in SQL Statement

When grouping data in SQL Server, we can evaluate a list of conditions and returns one of multiple possible result expressions. This evaluation can be done by using Case statement in SQL Server.

 

For example, in the product table, we can mark products as 'very cheap', 'cheap', 'moderate','expensive' and 'very expensive' depending on the ListPrice range. See the example below.

Print

Update Records in SQL Statement

In software testing,  when preparing test data, sometimes,we need to update existing records to change or replace test data.  In SQL Server, Update statement can update or replace one or more rows in a table.

 

Print

Using COALESCE To Return First Non Null Expression in SQL Server

When doing database testing, sometimes, we need to obtain non null expressions from multiple columns in a table or in few tables by using joins. 

In the following example, the temp table (#a)  holds employee salary information.

 

It includes four columns with information about the yearly salary of the employees: the hourly wage, monthly_salary, semi_monthly_salary and bi_weekly_salary. However, an employee receives only one type of pay. To determine the total amount paid to all employees, use COALESCE to receive only the nonnull value found in the hourly wage, monthly_salary, semi_monthly_salary and bi_weekly_salary.

Print

Hierarchical Lookup and Find Non Null Expressions In Sql Server

When testing database, sometimes, we need to look up information from multiple tables and find non null values. We can use join and COALESCE statement.

 

In this example below, we have a master table that holds employee_id and name, and other 3 tables that contain employee_id and salary information. We need to find total salary of each employee. Below is the Sql script for that.