Javatpoint Logo
Javatpoint Logo

DB2 RazorSQL QueryBuilder

Open RazorSQL and then connect to the database.

Now right click on the selected table. You will see query builder.

DB2 querybuilder

QueryBuilder can be used to SELECT, SEARCH, INSERT, UPDATE and DELETE purpose. You can use it for the above all operation to build query and execute it.

SELECT Query

The SELECT option facilitates you to use all SELECT queries.

For example: You can use SELECT * for retrieving all records from the table as well as SELECT individual columns for retrieving individual records.

Example:

Retrieve All Records

Click on the SELECT * option to retrieve all records from the table. Now click on the generate SQL, you will see the generated query.

Click on the Execute SQL button.

DB2 querybuilder2

See the result on RazorSQL main page.

DB2 querybuilder3

You can use WHERE and GROUP BY clauses with SELECT Query. Conditions like <, >, <=, >=, =, <>, LIKE, NOT LIKE can also be used.

For example:

Let's select address from the table "Freshers" Where address is LIKE "Allahabad".

DB2 querybuilder5 DB2 querybuilder6

In the same way you can retrieve individual records.


SEARCH Query

The next option of the Query Builder is search query. You can retrieve records from the table "Fresher" by using this query method.

Let's retrieve records from the table "Freshers" Where address != Allahabad and ID is greater than 1.

DB2 querybuilder7

INSERT Query

You can insert a single record as well as a complete row in the table by using INSERT block.

For example:

Let's insert the following record as a new row.

DB2 querybuilder8 DB2 querybuilder10

UPDATE Query

Update block is used to update the already inserted records in the table. Let's update the table where name is "Babita" and "Age" is 25 to name "Kiran" and age 45.

DB2 querybuilder11

12


DELETE Query

DELETE block is used to delete a specified record.

Let's delete the records from the table "Freshers" where id >= 4 AND age <= 30.

DB2 querybuilder13 DB2 querybuilder14

You can see that only id < 4 is remained in the table now.


Next TopicCompare Tool





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA