Tech Qu: Some SQL Server Questions
The Idiot ones I have gathered a few from some interview sites, and the ones below are so trivial that it’s shocking that they were asked! WriteTSSL to find all the duplicate email address in a table which contains only one column "email" Code Snippet select [email] from [sometable] where [email] is not null OR len ( [email] )= 0 group by [email] having count ( [email] ) > 1 Many answers failed to exclude no email (could be recorded as null or an empty string), or return the count with it (which was not asked for). Given a table: CustomerOrders: (Customer ID | Order ID | Order Date) 1. Write a SQL to find all customers who has placed an order today. 2. Write a SQL to find all customers who has placed an order today AND yesterday. Again, a trivial one Code Snippet Select CustomerId from CustomerOrders Where OrderDate >= Cast ( GetDate as Date ) Select CustomerId from CustomerOrders Where Ord