Over View of SQL

SQL (Structured Query Language) is a special-purpose programming language designed for storing, manipulating and retrieving data stored in a Relational Database Management System (RDBMS).SQL consists of a data definition language and a data manipulation language. SQL became a standard of the American National Standards Institute (ANSI) in 1986 and of the International Organization for Standardization (ISO) in 1987. Since then, the standard has been enhanced several times with added features. Most Relational Database Management Systems like MS SQL Server, Microsoft Access, Oracle, MySQL, DB2, Sybase, PostgreSQL and Informix use SQL as a database querying language.
Different Products of RDMS are:

Oracle
Oracle Corporation
SQL Server 2000
Microsoft Corporation
DB2 UDB
IBM
My SQL
My SQL
Sybase
Sybase

                               In SQL we have standard commands to interact with Relational Database. Those commands are Create, Alter, Truncate, and Drop. These Commands can be classified into groups based on their nature.

1)     DDL - Data Definition Language
2)     DML- Data Manipulation Language
3)     DQL- Data Query Language
4)     DCL- Data Control Language
5)     TCL- Transaction Control Language

1)DDL - Data Definition Language: These Statements (Commands) are used to Create, Insert, Modify and Drop Database Objects.
Some Examples:
a)      Create: Create Statement is used to make a new database, table, index, or stored procedures.
By using Create Statement we are creating a table in Database. Tables are organized into rows and columns.
Syntax for Create Statement:
Create Table  tablename (Column Name1 data type(size), Column Name1 data type(size), Column Name2 data type(size), Column Name3 data type(size), ………);
Here:
§  The column name represents specify the names of the columns of the table.
§  The data type parameter represents which type of data the column can hold (e.g. varchar integer, date etc.).
§  The size parameter represents the maximum length of the column of the table.

Example for Create Statement:
 Create Table Employee (empid  int (20), First Name Varchar(50), Last Name Varchar(50), Deportment varchar(50), Address Varchar(50),City Varchar (50));

Table name is Employee
In this table empid column is represents int data type and it will hold an integer Value. Last Name, First Name, Deportment, Address and City columns are of type varchar and will hold characters, and the maximum length for these fields is 50 characters. 

The empty "Employee" table will now look like this:





empid
First Name
Last Name
Deportment
Address
City





























2)    DML- Data Manipulation Language: These Statements (Commands) are used to Insert, Update and Delete Database Objects. 
      3)  DQL- Data Query Language: These Statements (Commands) are used  Select Commands 
     4)  DCL- Data Control Language: These Statements (Commands) are used to create roles, permissions, and referential integrity as well it is used to control access to database by securing it.
Examples: GRANT, REVOKE statements
5)   TCL- Transaction Control Language: These Statements (Commands) are used to manage different transactions occurring within a database.
Examples: COMMIT, ROLLBACK statements


SQL

Write a Script to add matrx in VB Script

In general matrix addition is defined for two matrices of the same dimensions. The sum of two m × n (pronounced "m by n") matrices A and B, denoted by A + B, is again an m × n matrix computed by adding corresponding elements: 

 


For Example:
 

I need to add the pairs of entries, and then simplify for the final answer:




The answer is:



Working with Actions in QTP


Actions:
I) Actions are very similar to functions. Except few differences rest of all are same.
II) Action is a set of logical related statements.
III) Actions help to divide a lengthy script into smaller script.
IV) Based on the order in test flow execution of Actions happens sequentially.
v) For every Action or sub action one Object Repository will create.

How to insert an Action
ActionàCall to new Action
If two actions are called from test then those actions are set to be independent actions.
If two actions are called within the Action, then those two Actions set to be nested Actions.
Action is a collection of VB statements in QTP. It does not return any values.
We can’t call actions within the functions.
Generally Actions will save with “.mts “
By default QTP records all steps into an Action.
Actions can contain Object Repository, Data Table, and Active Screen etc.

Actions are two types
1)Reusable Actions
2)Non Reusable Action
1) Reusable Actions: We can Reusable Action Script in other test. They can be used in the same test script multiple times.
How to create Reusable Actions
By default all Actions are Reusable Actions Only.
ActionàCall to new Action

2) Non Reusable Actions: Non Reusable Actions cannot be used in other script. They can be called the same script only once.

How to create Non Reusable Actions:
ActionàCall to new Actionà check Non Reusable Action

In Actions there are two methods to import Scripts in to a code. Call to
1) Call to Copy Action
2)Call to Existing Action

1) Call to Copy Action: When we make a copy of an Action the Action is copied in its entirety, including checkpoints, Parameterization and datatable into calling test. When we insert a copy of an Existing Action we can able to make changes to the copied Action. And our changes will not affected by the original script and any other test. We can insert both Reusable Actions and Non Reusable Actions.

     How to create Call to Copy Action
Click on Edità Call to Copy
2) Call to Existing Action: Call to Actions is read only in the calling test. They can only be modified in the test in which they were created.  In Call to Existing Action we can insert only Reusable Actions.

How to create Call to Existing Action
Click on Edità Call to Existing