Posts

Showing posts from December, 2018

Tricky SQL Interview Questions

SQL Interview Questions How to insert 10 default records in SQL Table. For example suppose we have Student Table with columns Name, Address and other. Write a query to insert default value in one go. INSERT INTO mytable DEFAULT VALUES GO 10 What is GO keyword in SQL? GO keyword is not associated with SQL but it is property of SQL Server Management Studio. GO can be understand simply for following example. Student with Mark on their T-Shirt 1,2,3,4,5,6,7,8,9,10 and 11,12….20 are ready to run in an event but when it is said student from 1 to 10 Go then they start running but students from 11 to 20 wait until they are not said. So it is batch separator in SQL. What is Temp table and Temp variable in SQL and why they are used? 1.       Temp Table store location is Tempdb while Temp variable storage location if not specified is current database. 2.       Table variables can only be accessed within the batch and scope in which they are declared. Temp Tables a