Home Answers Viewqa SQL Need SQL Statement

 
 


Z H
Need SQL Statement
0 Answer(s)      a year and 5 months ago
Posted in : SQL

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 Pages:
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 Example The Tutorial illustrates an example from SQL AND Statement
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
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
sql - SQL
sql functions with examples  I need sql functions with examples...("SQL statement is not executed!"); } } catch (Exception e...{ Statement st = con.createStatement(); String query = "SELECT * FROM
The Update Statement in SQL.
The Update Statement in SQL.  The Update Statement in SQL.   Hi, here is the answer, The update statement in the sql is written as follows- UPDATE table_name SET column_name = new_value WHERE column_name = some_value
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.  Syntax:           SELECT column_name(s
SQL SELECT DISTINCT Statement
SQL SELECT DISTINCT Statement     ... with the select statement. The SQL Distinct clause is used with the Select statement...'. SQL statement to create table:     create table Stu
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
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
The UPDATE Statement       The UPDATE statement is used to modify the data in the database table through a specified criteria. In the given syntax of update statement the keyword SET
SQL Backup query with where statement
SQL Backup query with where statement       SQL Backup query with where statement ... The Tutorial show you a example from 'SQL Backup query with where
The INSERT INTO Statement, SQL Tutorial
values then we should use the following SQL statement...The INSERT INTO Statement       The INSERT INTO statement is used to insert or add a record
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    
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
need search query - WebSevices
need search query  I have a field in database as DOB. But I want.... /* For Working code use these sql queries create database komal; use komal... = DriverManager.getConnection(url + db, user, pass); String sql = "select * from stu where
Use HANDLER Statement in Cursors
open the cur1 which built a result set. The repeat statement in SQL include... Use HANDLER Statement in Cursors       Use HANDLER Statement in Cursor is used to define
sql
sql  i need a query for selecting values from a table till a certain date...my database has date in the format '01-JAN-01 12.00.00.000000000 AM
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
Need for hibernate - Hibernate
Need for hibernate  Can anyone say why should we go for hibernate... oriented concept like java. It has better compatibility with java than sql. In Jdbc we have to mannualy handle exception We need to open/cose the connection
sql
;first you need to create a sequence which generate employee-id and then fire
Creating JDBC Statement object
object you first need to create Connection object because statement object...; } Creating JDBC Statement Object JDBC Statement is an interface of java.sql.*; package. It is used for execution of SQL statements. It returns a ResultSet
PHP SQL Insert Statement
PHP SQL Insert Statement       PHP SQL Insert Statement show you the message when the records... The Tutorial illustrate an example from 'PHP SQL Insert Statement'. To understand
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
PDO Prepared Statement
for us to use a Prepared Statement for sending SQL statements to the database. It is beneficial when we need to execute an SQL statement more than one time... of prepared statement need not to be quoted because the driver of SQL automatically
Use if statement with LOOP statement
Use if statement with LOOP statement       Conditional if statements  in SQL are used... with Example The Tutorial illustrate a example from if statement with LOOP
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
SQL AND Statement
SQL AND Statement       The SQL AND operator is used to show you the filter records... with Example The Tutorial illustrates an example from SQL AND Statement
SQL SELECT DISTINCT Statement
SQL SELECT DISTINCT Statement     ... with the select statement. The SQL Distinct clause is used with the Select statement...'. SQL statement to create table: create table Stu_Table(Stu_Id
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
The SELECT statement for SQL
The SELECT statement for SQL       SELECT key word is used to select data from a table.  Syntax:           SELECT column_name(s
'if' Statement - Braces
statement, you do not need to use braces (also called "curly brackets"). Form The if statement doesn't need braces if there is only one... Java Notes'if' Statement - Braces Braces { } not required for one
Need source code - Swing AWT
Need source code  Hai friends, How can I, view all... =DriverManager.getConnection("jdbc:odbc:access"); String sql = "Select * from data"; Statement stmt = connect.createStatement
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
SQL Backup query with where statement
SQL Backup query with where statement       SQL Backup query with where statement ... The Tutorial show you a example from 'SQL Backup query with where
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
difference between statement and a prepared statement - JDBC
A Statement will always proceed through the four steps above for each SQL query...difference between statement and a prepared statement  What is the difference between statement and a prepared statement?  A Statement
Need Suggistion
Need Suggistion  how to call a callable statement in our jSp page using Struts environment
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
JDBC Prepared Statement Example
, When 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   
if Statement - Overview
The if statement doesn't need braces if there is only one statement in a part...Java Notesif Statement - Overview Purpose The purpose of the if statement... with if. [The other 1% of the decisions use the switch/case statement
What is the difference between a break statement and a continue statement?
statement and exit from the loop and loop is terminated. Sometimes we do not need...What is the difference between a break statement and a continue statement?   Hi, What is the difference between a break statement and a continue
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.  
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 project
need project  hi im new on this site so dnt knw actual procedure . but i need a project on banking system in java with sql database. which should... is good plz add it i need project till Saturday i.e 10th march 2012 plzzzz
My sql - JDBC
,emp_vertical,emp_supervisor. i need a JDBC program with driver mangager... out. i need insert and update queries.  Hi friend, For JDBC using prepared statement examples and tutorials visit to : http
Insert data in mysql database through jsp using prepared statement
statement object that is used for sending sql statements... Insert data in mysql database through jsp using prepared statement...; This is detailed jsp code that how to insert data into database by using prepared statement

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.