473,396 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Which querry will give more performance

I have the following tables,

1> employee_master(emp_id int primary key, emp_name varchar(100));
2> employee_salary_payment(salary_rid int primary key, emp_id int, sal_date date, paid_amt int);

The tables, employee_master and employee_salary_payment have one to many relation.
I need to list the salary payment done for the employee having id = 10. Here I use two different querry to work.

Querry 1:
Expand|Select|Wrap|Line Numbers
  1. Select em.emp_id, em.emp_name, esp.sal_date, esp.paid_amt
  2. from employee_master em join employee_salary_payment esp
  3. on (em.emp_id = esp.emp_id and em.emp_id = 10);
Querry 2:
Expand|Select|Wrap|Line Numbers
  1. Select em.emp_id, em.emp_name, esp.sal_date, esp.paid_amt
  2. from employee_master em join employee_salary_payment esp
  3. on em.emp_id = esp.emp_id
  4. where em.emp_id = 10;
Question:
Both the querry will give the same performance?
If no, what is the reason?
Nov 19 '07 #1
0 1247

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Eric Kincl | last post by:
Hello, I have an array of data in PHP. I would like to insert each member of the array into it's own row in SQL. The array is of variable length, so it would have to be dynamic code. How would...
0
by: Costa Lino | last post by:
Hi All, I have a DataSet with xml file and I want to make a querry like this DataView dv = new DataView(mytable); dv.RowFilter = " Impression < ( MaxImpressions) "; Impression et...
3
by: Linn K B | last post by:
I have a querry that works, but it is incredeble slow, so do anyone have any suggestions how to make this better: The table looks like this Gab(ID (key), Gid, Pid, Status, .....), mening there...
5
by: Clownfish | last post by:
OK, I'm having a brain freeze. I have a table like this: Office Name Phone ---------------------------------- SG Larry 555-1212 SG Moe 553-4444 SG Curly ...
1
by: prileep | last post by:
I have two tables Users and UserLogin. Here i will use two methods of table design. and which query will return me the result more fast. The table size will be large that it may contain records in...
1
by: nj2md | last post by:
Can some one assist with a querry. I need to know the code to querry a database to find the number of female and males that make over 50K a year and how to get capital gains and loses from the same...
2
by: dipalichavan82 | last post by:
i came across a article, where it was mentioned if we want a dynamic querry to fire then use parameterized querry e.g. string inputcity=textbox.text; SqlCommand cmd = new SqlCommand("select * from...
1
by: iprogrammer | last post by:
i m new to .net and db connectivity in .net using sql server.... i want to insert values from into a db test1 from a function register(); where i will pass values the function register will this...
2
by: getmeidea | last post by:
I have the folowing two tables. employee_master( emp_rid int primary key identity, emp_no char(20) not null, emp_name varchar(100) ); salary_payment( sp_rid int primary key,
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.