Need SQL Statement

Need SQL Statement

QUESTION IS CAPITALIZED AT THE BOTTOM...

There is a table Employee, with three columns: Name (varchar), Department (varchar) and Salary (int):

Name Department Salary

John Manufacturing 30000

James Manufacturing 30000

Michael Manufacturing 30000

Andrea Manufacturing 30000

David Manufacturing 40000

Dennis Manufacturing 50000

Doug Manufacturing 50000

Ellen Accounting 50000

Eric Accounting 50000

Glen Accounting 50000

Gabriel Accounting 50000

Henry Shipping 60000

Harry Shipping 60000

Kyle Shipping 60000

Kurt Shipping 60000

Ken Shipping 60000

Larry Manufacturing 70000

Lenny Manufacturing 80000

Lisa Accounting 80000

Liz Accounting 80000

Manny Accounting 80000

Margaret Accounting 80000

Matthew Shipping 80000

Norbert Shipping 90000

Norman Shipping 90000

List all the employees, and also list the other employees that have the same salary. For example, if John Smith has a salary of $50,000, then under John Smith, show everyone else who also has a salary of $50,000. Order this by the employee with the lowest salary.

Results:

John 30000

James

Michael

Andrea

James 30000

John

Michael

Andrea

Michael 30000

John

James

Andrea

Andrea 30000

John

James

Michael

David 40000

Dennis 50000

Doug

Ellen

Eric

Glen

Gabriel

Doug 50000

Dennis

Ellen

Eric

Glen

Gabriel

Ellen 50000

Dennis

Doug

Eric

Glen

Gabriel

�..

WHAT IS THE SQL STATEMENT NEEDED TO ACHIEVE THESE RESULTS?

View Answers









Related Tutorials/Questions & Answers:
Need SQL Statement
Need SQL Statement  QUESTION IS CAPITALIZED AT THE BOTTOM... There is a table Employee, with three columns: Name (varchar), Department (varchar... IS THE SQL STATEMENT NEEDED TO ACHIEVE THESE RESULTS
SQL And Statement
SQL AND Statement       The SQL AND operator is used to show you the filter records... with ExampleADS_TO_REPLACE_1 The Tutorial illustrates an example from SQL
Advertisements
SQL statement - SQL
SQL statement  Hi, i have an sql statement that needs to add the price, vat and shipping cost. It works fine but one problem is that the shipping... be charged 10. otherwise nothing. Heres the code: $orderAmount = 0; $sql
The Update Statement in SQL.
The Update Statement in SQL.  The Update Statement in SQL.   Hi, here is the answer,ADS_TO_REPLACE_1 The update statement in the sql is written as follows- UPDATE table_name SET column_name = new_value WHERE column
error : not an sql expression statement
error : not an sql expression statement  hii I am gettin followin error in connecting to database SQLserver 2005 in Jdeveloper,i m usin struts... { Connection conn = DatabaseManager.getConnection(); Statement stmt
mysql select statement - SQL
statement code. Implement the following code. import java.sql.*; public class...); Statement st = con.createStatement(); ResultSet rs
Select Statement in SQL, SQL Tutorial
The SELECT statement for SQL       SELECT key word is used to select data from a table. ADS_TO_REPLACE_1 Syntax:    ADS_TO_REPLACE_2      ADS
SQL SELECT DISTINCT Statement
SQL SELECT DISTINCT Statement     ... with the select statement. The SQL Distinct clause is used with the Select statement... 'Stu_Table'. SQL statement to create table:  ADS_TO_REPLACE_2  
SQL STATEMENT in JDBC in NETBEANS IDE
SQL STATEMENT in JDBC in NETBEANS IDE  Iam using NETBEANS IDE. Iam developing a bank application. Using JDBC in SERVLETS For the withdraw function, "bal" and "ano" are user inputs when i wrote like, st.executeQuery("UPDATE
SQL select statement doesn't return any rows,
SQL select statement doesn't return any rows,  When an SQL select statement doesn't return any rows, is an SQLException thrown
UNICODE or SQL statement issue - JDBC
UNICODE or SQL statement issue  Hi again............ I have got something new that........... i was using MS Access as the database with my... nothing ...... I had also change my backhand to SQL SERVER but retrieves same
The UPDATE Statement, SQL Tutorial
should use the following SQL statement : ADS_TO_REPLACE_3 Syntax... The UPDATE Statement       The UPDATE statement is used to modify the data in the database table through
SQL Backup query with where statement
SQL Backup query with where statement       SQL Backup query with where statement ..._TO_REPLACE_1 The Tutorial show you a example from 'SQL Backup query with where
Need help on mySQL 5 - SQL
Need help on mySQL 5  Dear Sir, I'm a beginner of mySQL 5 . I need... by using Aggregate function(MAX). May i know that what command i need.... Regards, Christopher de Souza   dear user you have to use a nested sql
The DELETE Statement, SQL Tutorial
The DELETE Statement       The DELETE statement is used to delete rows from a table. database will update that is why deletion and insertion of data will be done.  Syntax  ADS
PHP SQL Insert Statement
PHP SQL Insert Statement       PHP SQL Insert Statement show you the message when the records..._TO_REPLACE_1 The Tutorial illustrate an example from 'PHP SQL Insert Statement
syntax error in SQL Insert Statement - Java Beginners
syntax error in SQL Insert Statement  Dear Sir ,I have write following code to save data into access databse, but code gives following error code... Access Driver] Syntax error in INSERT INTO statement. plz Help Me  Hi
to write an SQL query using insert statement
to write an SQL query using insert statement  I need to write an sql query for the below using InSERT command.pls help. Insert 5-star ratings by James Cameron for all movies in the database. Leave the review date as NULL
i need to replace this if statement code with switch case code
i need to replace this if statement code with switch case code   i need to replace this code with switch case for(int i=0;i<100;i++){ if((i%3)==0) system.out.println("java"); if((i%5)==0) system.out.println("technology
syntax error in SQL Insert Statement - Java Beginners
syntax error in SQL Insert Statement   private class ButtonListener implements ActionListener{ public void actionPerformed(ActionEvent ae...","",""); Statement stmt=con1.createStatement(); int i
SQL AND Statement
SQL AND Statement       The SQL AND operator is used to show you the filter records... with ExampleADS_TO_REPLACE_1 The Tutorial illustrates an example from SQL
SQL Backup query with where statement
SQL Backup query with where statement       SQL Backup query with where statement ..._TO_REPLACE_1 The Tutorial show you a example from 'SQL Backup query with where
The INSERT INTO Statement, SQL Tutorial
the following SQL statement: INSERT INTO employee (emp_name...The INSERT INTO Statement       The INSERT INTO statement is used to insert or add a record
JDBC Batch Example With SQL Insert Statement
JDBC Batch Example With SQL Insert Statement: In this tutorial, we are discuss about insert SQL statement with the jdbc batch. First of all, we... SQL insert statement for save data in the datasource and add
JDBC Batch Example With SQL Update Statement
JDBC Batch Example With SQL Update Statement: In this tutorial, we are discuss about update SQL statement with the jdbc batch. Now we will create a java...;); Now we will create Statement object by using createStatement() method
JDBC Batch Example With SQL Select Statement
JDBC Batch Example With SQL Select Statement: In this example, we are discuss about SQL select statement with JDBC batch process. We will create SQL select  statement and execute it in a result set and after that fetch
Use HANDLER Statement in Cursors
set. The repeat statement in SQL include a set of statements... Use HANDLER Statement in Cursors       Use HANDLER Statement in Cursor is used to define
SQL SELECT DISTINCT Statement
SQL SELECT DISTINCT Statement   ... clause with the select statement. The SQL Distinct clause is used with the Select... from SQL Select Distinct Statement. The create table statement help you
Need Solution to get vaues from sql database in java
Need Solution to get vaues from sql database in java  hi I have written a code in java to get these xml tags < company comp:loc=" "/> now i need to get values from sql database for values in the blank field(" "). how do i
The SELECT statement for SQL
The SELECT statement for SQL       SELECT key word is used to select data from a table. ADS_TO_REPLACE_1 Syntax:    ADS_TO_REPLACE_2      ADS
for statement
for statement  for(int i=0;i<5;i++); { system.out.println("The value of i is :"+i); } if i end for statement what will be the output   got the answer.. it displays only the last iteration that is "The value of i
PHP SQL IF Statement
PHP SQL IF Statement       This example illustrates how to use the 'if' statement in php when... the if statement, so only one data will display here as shown in the output.ADS
PHP SQL IF Statement
PHP SQL IF Statement  This example illustrates how to use the 'if' statement when accessing the data from mysql database table in php. .... Here we are using the if statement, so only one data will display here as shown
need
need  i need a jsp coding based project plz help me
JDBC Prepared Statement Example
it is created ,it is represented as SQL statement. The advantage of this statement  is SQL statement sent to the DBMS,in which it is compiled... JDBC Prepared Statement Example     
Need solution to get values for XML namespace tags from SQL database in Java
Need solution to get values for XML namespace tags from SQL database in Java  hi I have written a code in java to get these xml tags < company comp:loc=" "/> now i need to get values from sql database for values
need help....how to connect and disconnect multiple databases(databases created in mysql) using java and my sql
on deadlock in distributed transactions , and in that i am using my sql in java i need...need help....how to connect and disconnect multiple databases(databases created... that i can retrieve data from all tables. i need the implementation of any
SQL GROUP BY Example
SQL GROUP BY Example In this section we will discuss about the group by statement in SQL. In this tutorial we will use MySQL for using the SQL statements... : SQL GROUP BY clause with SELECT...FROM and WHERE statement SELECT col1, col2
how to close the connection object,statement object,resultssetobject when using the microsoft access a database - SQL
how to close the connection object,statement object,resultssetobject when using the microsoft access a database   Hi Friend, I am developing the webapplication using the jsp(business logice-jsp).backend is microsoft access
JDBC Batch Example With SQL Delete Statement
JDBC Batch Example With SQL Delete Statement: Learn How to use delete MySql statement with JDBC Batch processing. First of all, we will create a java class...() as: connection.setAutoCommit(false); 3. Create SQL delete statement for save data
Prepared Statement Example
is used to make the SQL statement execution efficient. In Java, when we use... in implementation. Statement is used to execute the static SQL statement whereas, PreparedStatement corresponds a precompiled SQL statement. When we use
SQL Create View
is defined  as a virtual table outcome as a result of an SQL statement. A view...; Once your table Stu_Table is created, The insert into statement of SQL is used... SQL Create View      
Need Suggistion
Need Suggistion  how to call a callable statement in our jSp page using Struts environment
PHP MySQLI Prep Statement
PHP-MySQLI:Prepared-Statement mysqli::prepare - Prepares a SQL query and returns a statement handle to be used for further operations on the statement. The query should consist of a single sql query. There are two styles are available
sql
difference between sql and oracle  what is the difference between sql and oracle
sql
sql  how to get first row in sql with using where condition in sql? how to get last row in sql with using where condition in sql
Statement block
Statement block  What is the purpose of a statement block
JDBC Batch SQL Update Statement Example With Return Number of Effected Rows
JDBC Batch SQL Update Statement Example With Return Number of Effected Rows: In this example, we are discuss about update statement with return number... SQL statements and execute on the created statement object and store return
SQL PHP
SQL PHP       SQL PHP is used to execute the statement using the mysql_query ( ) function... with ExampleADS_TO_REPLACE_1 The Tutorial illustrate an example from 'SQL PHP
sql - SQL
is executed one statement at a time. PL/SQL is executed as a block of code... embed PL/SQL within a SQL statement. Thanks... want query? 4.what is the diffrence between sql and plsql?  Hi Friend

Ads