PROCEDURE TO RUN SQL QUERIES

February 17, 2008 avadhut

 PROCEDURE TO RUN SQL QUERIES:

As given in part A, I have created Zoho account. And copied database of company ANGSTROM PVT. LTD. From excel sheet to zoho page via IMPORT OPTION. Then on main page two files of EMPLOYEE and DEPARTMENT appeared. After that, in NEW button, I clicked on NEW QUERY to run new Query and then wrote a code as per the SQL language requirement and then got the result of Query as I wanted to be. This procedure is followed for all queries. And the detailed description of each query is as follows:

1.      JOIN QUERY:

In this i wrote code as follows:

SELECT “EMP”,”LAST ANME”, “FIRST NAME”,”LOCATION” FROM

“EMPLOYEE”,”DEPARTMENT” WHERE “EMPLOYEE”.”DEPT”=”DEPARTMRNT”.”DEPT”

 In above query the result was based on joining of the two separate tables of EMPLOYEE and DEPARTMENT. Where output is having joining of two tables by cancelling common part of department id.

2.      STANDARD DEVIATION QUERY:

Code is as follows:

SELECT stddev (“SALARY”) from “EMPLOYEE”

In this query , there is function of INSERT having option of SQL FUNCTIONS, where i selected stddev option which gave output table having the standard deviation of salaries form EMPLOYEE table.

3.      BRACKET PLUS “AND” and “OR” :

Code is as follows:

SELECT “LAST NAME”,”FIRST NAME”,”JOB DESCRIPTION”,”SALARY” FROM “EMPLOYEE” WHERE ( “JOB DESCRIPTION”=’CUSTOMER REPRESENTIVE’OR “JOB DESCRIPTION”=’CLERK’) AND “SALARY” >= 5000

Where output table is having job description of “customer representative” plus “clerk” whose salaries are more than equal to 5000.

4.      QUERY CONTAINING SAME DEPARTMENT BUT HAVING DIFFERENT SALARIES:

SELECT  ”LAST NAME”, ” FIRST NAME “, JOB DESCRIPTION “, “SALARY”, “DEPARTMENT” FROM “EMPLOYEE” WHERE “DEPARTMENT”= ‘10′ AND SALARY > 5000.

In this output, the department which is having id ‘10′ got selected and out of which those who are having salaries more than 5000 got selected.

To view the tables go to the following link:

http://db.zoho.com/ZDBDataSheetView.cc?DBID=16631000000002037

Entry Filed under: Uncategorized

1 Comment Add your own

  • 1. prithwis  |  February 24, 2008 at 3:13 am

    very good


Leave a Comment

Required

Required, hidden



Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to comments via RSS Feed

Pages

Categories

Calendar

February 2008
M T W T F S S
    Mar »
 123
45678910
11121314151617
18192021222324
2526272829  

Most Recent Posts