Posts

Showing posts from January, 2024

sql real interview question and answer

 SQL Interview questions and answers what is the difference between delete and truncate? we can rollback delete statement but can't rollback truncate. delete does not reset identity of table , truncate reset identity value delete lock row for deletion and truncate lock entire table. delete is data manipulation , truncate is data definition language we can use where with delete but can't use with truncate

first vs firstordefault in linq

 What is the difference between first and firstOrDefault in Linq? First() method return first element from list and if element is empty it's throw exception. firstOrDefault () will handle exception if list contain no element.