Technical Interview Questions and Answers :: SQL
21 / 108
No Discussion on this question yet!
22 / 108
No Discussion on this question yet!
23 / 108
View created with base table, force view created without base table..
24 / 108
No Discussion on this question yet!
25 / 108
No Discussion on this question yet!
26 / 108
SELECT max(salary) AS salary2 FROM orders WHERE salary < (SELECT max(salary) AS salary1 FROM orders)
27 / 108
SELECT min(salary) AS high5 FROM employee WHERE salary IN(SELECT DISTINCT TOP 5 salary FROM orders ORDER BY salary DESC)
28 / 108
SELECT Id, count (*) as number_records from table group by id having count (*) > 1.
29 / 108
a. select count (coumnName(s)) from tableName.
b. select count_big(coumnName(s)) from tableName
c. select columnName from tableName
select @@ROWCOUNT as rowCount
30 / 108
Delete command and truncate command both will delete the data, however the truncate command can not be rolled back as delete can be. The delete command can be used for selected records using the where clause but with the truncate command we have to loose data. DELETE statement is a logged operation and hence takes more time then truncate.