In this Article I am going to teach how to design queries in Design Query Editor.
It is a graphical user interface (GUI) the Design Query Editor builds the queries to run against your SQL Server database. It can be especially useful when building compound queries that involves many tables and views.
Open Design Query Editor:-
1. Go to on Query Menu and select Design Query in Editor… command.
2. After clicking on Design Query in Editor… the below screen will appear.
Make Select Query:-
1. You can select table at least one below image I am selecting a table which name is tblEmployee.
2. And then you can click on Add button to add the table for make a select query.
3. After selecting or add the table clicks on close button to close the Add Table dialog box and after that below screen will appear.
Above image I am selecting two columns of table first is vEmpName and second is vEmpContact, and you can see below your selected columns and select query and then press OK.
4. After pressing OK you can see the select query on your screen.
SELECT vEmpName, vEmpContact
Make Insert Query:
You can also design insert query through Query designer:-
1. You can do same as previous steps select the table which you want to insert the value and then you need to select the columns and then right click on the column and select the Change Type>>Insert Values.
2. After that you can insert the values in the columns.
3. After that press OK button and insert query will be appear on your screen.
INSERT INTO tblEmployee
(iEmpId, vEmpName, vEmpContact)
Now you can see your table:
select * from tblEmployee
Create an Update query through Query Designer:
Now here also you can go on Query Menu and select Design Query in Editor… command and select the table which you want to update your table.
1. For make update query you can also add a table then right click on the columns and select the change type >> update.
2. After that you can select desired column and then insert the value. Above image I am selecting firstly column name which is vEmpName second select the table then enter New Value (I am inserting the ‘Avadesh’) and after that select the column again (vEmpId) for filtering the insert value and then press OK.
3. After that you can see update query will appear on your screen.
SET vEmpName = 'Avadesh'
WHERE (iEmpId = 6)
Above image you can see your row updated.
Create a Delete query through Query Designer:
You can make delete query same as update query through Query Designer.
1. Go to on the Query Menu and select Design Query in Editor… and select the table.
2. Now right click on the column go to Change Type>>Delete.
3. Select the Column name and next select table and then enter the value in filter.
4. After that press OK.
5. Now you will see the query on your screen.