Which is best Subquery (or) joins in sql server? explain why
Answer Posted / rajeevrohilla
In normal situation join are best since there is no
subquery for each record for the other table. but in some
situations Subquery are best. for example- when the
subquery results one or fewer (3 or 4 records) that it will
work faster since it also saves the joining time(if there
are more than 1 joining fields then joining takes lots of
time). Subquries also perform better when tables have less
amount of data.
| Is This Answer Correct ? | 17 Yes | 4 No |
Post New Answer View All Answers
Explain about temporary stored procedure?
if no size is defined while creating the database, what size will the database have? : Sql server administration
Can group by be used without aggregate functions?
Explain indexing and what are the advantages of it?
How to copy data from one table to another table?
What is database white box testing?
What is dbcc? Give few examples.
What happens if strings are casted into wrong code pages in ms sql server?
Explain throw statement in sql server 2008?
This question asked during interview, 2) At the end of each month, a new table is created for each bank that contains monthly metrics consolidated at the account level. The table naming convention is bankX_YYYYMM where X represents the numeric designation of the bank and YYYYMM indicates the 4 digit year and 2 digit month. The tables contain the following fields: name data type description account text account number registered boolean indicates whether the account is registered num_trans integer number of transactions made during the time period spend numeric(9,2) total spend during the time period a) Write a SQL query that will display the total number of transactions and total spend for "Bank1" during the 4th quarter of 2009. b) Write a SQL query that will display the total number of transactions and total spend at "Bank1" and "Bank2", broken out by registered vs. non-registered accounts, during January 2010 not sure what is correct answer and how to solve?
What is the need for indexing?
is there a column to which a default can't be bound? : Sql server database administration
What is an expensive query?
Can sql servers linked to other servers like oracle?
How to use go command in "sqlcmd"?