What are sub-queries? Give example? In which case
sub-queries are not feasible?
Answer Posted / amit kumar
A subquery is simply a SELECT query within a SELECT query.
example:-
SELECT City, Salary, (SELECT AVG(Salary) FROM Employee)
AS AvgSalary FROM Employee;
Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
What is difference statement and preparedstatement?
How many clustered indexes can be created on a table? I create a separate index on each column of a table. what are the advantages and disadvantages of this approach?
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 default port for SQL Server over a firewall?
How to create database with physical files specified in ms sql server?
What are the properties of primary key?
explain the storage models of olap? : Sql server database administration
What is factless fact table? : sql server analysis services, ssas
What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?
What is pessimistic concurrency?
What is dirty page?
How to get a list of columns in a view using the "sp_columns" stored procedure?
How to deploy the Report?
What are pessimistic lock and optimistic lock?
What are the types of subscriptions in SQL Server replication?