How to retrieve Duplicate Rows only in a Table?
Suppose if a Table Name is "Education". It consists of
multiple columns. Then if we insert rows into this table
with duplicate records then how can we retrieve only
duplicate records from that table?
I want to display the employees who have joined in last two
months. (It should be executed randomly means If I execute
the query in March it should display Jan and Feb joined
employees. Same query if i execute in Feb, 2007 it should
display dec, 2006 and jan 2007 joined employees.
With the help of table1 and table2 write a query to simulate
the fallowing results.
1.Write query for single row to multiple row using sql
2. Write query for multiple row to single row using sql
1.Write a query to select all the rows from a table1,if
the value of A is null then corresponding B’s value
should be printed in A’s value.if the value of A is null in
that table then corresponding B’s value should be printed
2. write a query to find the sum of A and B .display the
max among both.
3.write a query to find total number of rows from table 1.
Note: if any column value is null in a row then that row
should be considered as 2 rows.
4.write a query to display all the records of table1 except
A containg 2 as well B containg 5.
5.rewrite the fallowing without using join and group by.
Select b.title,max(bc.returneddate –bc.checkoutdate)”
From bookshelf_checkout bc,
Book shelf B
Group by b.title.
6.rewrite fallowing query
Select id_category from category_master X where exists
(select 1 from sub_category Y where
Name phone1 phone2 phone3 bitwise
A 23456 67890 12345 ---
B 67459 89760 37689 ---
1.q) update the customer table of bitwise with 1 or 0.
Exists in don’t_call table menas show -1
Other wise -0.
If i can use sys.check_constraints to display my constraints
from my database using sql server 2005, how can i display
then if i am using sql server 2000????
C. Normalize the following data up to the 3rd Normal
form. Create the tables and insert the data given.
Emp_ID Name Dept_Name Salary
100 Adam Marketing 48,000 SPSS 6/19/2008
140 Bob Accounting 52,000 Tax Acc 12/8/2008
110 Cathy IT SQL Server 1/12/2008
190 Dan Finance
150 Emily Marketing 55,000 SPSS 6/16/2008
42,000 Analysis 8/12/2008
1. Find all Names who have completed the SPSS Course.
2. Find employee with max salary.
3. Find employee with 2nd max salary.
4. Find all employees in Dept “Marketing”.
5. Find all the employees who have taken more than 2
6. Find all the employees who have completed the courses
before month of September.