SQL Interview Questions and Answers

SQL Interview Questions and Answers

SQL Interview Questions and Answers

SQL Interview Questions and Answers for beginners and experts. List of frequently asked SQL Interview Questions with answers by Besant Technologies.
We hope these SQL interview questions and answers are useful and will help you to get the best job in the networking industry. This SQL interview questions and answers are prepared by SQL Professionals based on MNC Companies expectation. Stay tuned we will update New SQL Interview questions with Answers Frequently. If you want to learn Practical SQL Training then please go through this SQL Training in Chennai

Besant Technologies supports the students by providing SQL interview questions and answers for the job placements and job purposes. SQL is the leading important course in the present situation because more job openings and the high salary pay for this SQL and more related jobs. We provide the SQL online training also for all students around the world through the GangBoard medium. These are top SQL interview questions and answers, prepared by our institute experienced trainers.

Best SQL Interview Questions and Answers

Here is the list of most frequently asked SQL Interview Questions and Answers in technical interviews. These SQL questions and answers are suitable for both freshers and experienced professionals at any level. The SQL questions are for intermediate to somewhat advanced SQL professionals, but even if you are just a beginner or fresher you should be able to understand the SQL answers and explanations here we give.

In this post, you will get the most important and top SQL Interview Questions and Answers, which will be very helpful and useful to those who are preparing for jobs.

SQL is a domain language used for managing and maintaining data which are done in a database system. Besant Technologies provides the best SQL training in Chennai. Our trainers are having more experience in working as a developer, designers, and debuggers in top companies. They have received many excellence awards in work and also for teaching and training. They have prepared this SQL interview questions and answers by doing complete analyze and research and also by integrating with other company SQL interview questions and answers.

Here is the best and top SQL interview questions and answers.

Q1. How to delete duplicate records?

Q2. What is Materialized View in database?

Q3. Difference between View vs Materialized View in database

Q4. What are oracle defined or pre-defined Exceptions

Q5. Display the 10th record of the emp table? ( without using row id)

Q6. Delete the 10th record of EMP table?

Q7. What are Schema Objects?

Q8. What is Data?

Q9. What is a Table?

Q10. What is a View?

Q11. What is an Index?

Q12. What is the difference between UNIQUE or PRIMARY KEY Constraint?

Q13. What is difference between TRUNCATE and DELETE?

Q14.What is a join? Explain the different types of joins?

Q15. What is a Subquery?

Q16. What are Difference between SUBSTR and INSTR?


Q18. What is ROWID?



Q21. What will be returned from NVL2 (-22,0)?

Q22. Which one is single row subquery operator except one

Q23, An operator is used to get and display the common records

Q24. What is database?

Q25. How to check the leap year

Q26. Differences between DATE and TIMESTAMP in Oracle

Q27. How many columns can a table have?

Q28. When to create indexes?

Q29. What is the difference between foreign key and reference key ?

Q30.How to Get the database file names from Oracle:

Q31. What is SQL*Loader?

Q32. What are the original Export and Import Utilities?

Q34). What do you mean by Correlated subquery?

Q35) Display the depart numbers with more than three employees in each dept.

Q36) Display the various jobs along with a total number of employees in each job?

Q37) Display the names of clerks who earn a salary more than the lowest

salary of any salesman.

Q38) Display the names of employees from department number 10 with a salary greater than that of any employee working in other departments?

Q39) Can one rename a column in a table? No, this is listed as Enhancement Request 163519.Workarounds:

Q40.To find The Max Salary without MAX Function.



Q43. What is ER Diagram?

Q44. Describe Referential Integrity?

Q45.What are the Referential actions supported by FOREIGN KEY integrity constraint?

Q46.What is self-referential integrity constraint?

Q47.What are the limitations of a CHECK constraint?

Q48. Which script displays ’01-JAN-02′ when the ENROLL_DATE value is ’01-JUL-01′?

Q49.Which statement is true?

Q50. What is the difference between a view and a synonym?

Q51. Display the names of employees who earn a salary more than that of Jones or that of salary greater than that of scott.?

Q52. EXECUTE insert_location (19, .San Francisco .) What is the result in this EXECUTE command?

Q53.What is meant by Auto Close ? Related to database properties.

Q54.What is Auto Update stats and Auto create stats? How its going to affect the database performance?

Q55.What is SQLOS?

Q56.What do you mean by SQL server memory Capping?

Q57.What is max memory and minimum memory in SQL server?

Q58.What are the reasons of SQL server installation failure?

Q59.Where to check for SQL server installation failure reason?

Q60.What is ACID property in SQL server?

Q61.Explain ACID properties in database.

Q62.What do you mean by Transaction in SQL server?

Q63.What do you mean by concurrency in SQL server?

Q64.What are different types of concurrency in SQL server?

Q65.What are different level of transaction Isolation level? Explain them.

Q66.Can we restore the database to point of time in simple recovery mode?

Q67.What is .tuf file and .wrk file in log shipping?

Q68.Can we configure Log shipping for multiple secondary? If yes how?

Q69.What is meant by RPO and RTO?

Q70.What is your Backup strategy for Production servers?

Q71.What is fill factor? How its affect the database performance?

Q72. Can we configure mirroring from lower to higher version? Is this recommended?

Q73.What is Lock escalation?

Q74.What is wait_types? How we can get the information about wait_type?

Q75.What is the difference between PAGEIOLATCH and PAGELATCH?

Q76.List out some of the requirements to setup a SQL Server failover cluster.

Q77.Can we read the mirror database? How?

Q78.Can we migrate a 500GB database without having downtime? How?

Q79.Can we add a new data file on primary in log shipping? How its going to affect the log shipping setup?

Q80.Can we create a blank database of size 2MB on SQL 2016?

Q81.Explain what stored procedure sp_replcounters is used for?

Q82.Can you tell me some of the common replication DMV's and their use?

Q83.How to troubleshoot if SQL server service is not coming online on cluster network?

Q84.Does AlwaysON supports on Bulk and simple recovery mode?

Q85.Can we take the T-Log backup of a newly created database?

Q86.Is it possible to create additional indexes on read-only secondary replicas to improve query performance in AlwaysON?

Q87.Is it possible to create additional statistics on read-only secondaries to improve query performance in AlwaysON?

Q88.What is read intent option in AlwaysON?

Q89.Does AlwaysOn Availability Groups repair the data page corruption as Database Mirroring? Explain

Q90.Whatís the difference between AGs in SQL 2012 and SQL 2014?

Q91.What is maxdop? What is the recommended setting?

Q92.What is the significant of log_reuse_wait_desc column in sys.databases?

Q93.Can checkpoint be used for crash recovery, if a checkpoint starts but doesnít finish before a crash occurs?

Q94.Can SQL Server guarantee that thereís always one complete checkpoint in the active portion of the log, in case a crash occurs?

Q95.Does ghost records occur in heaps? Explain

Q96.If a table is truncated during a transaction, does the integrity of the tableís pages protected in case the transaction rolls back? Explain.

Q97.A databaseís log grew so large that I had to delete it, but on restarting SQL Server the database was in RECOVERY_PENDING mode and inaccessible! Whatís gone wrong? Explain

Q98.After checking DBCC LOGINFO found that log had 2000 VLFs. Is it something to worry about? Explain.

Q99.If all operations are logged, what happens during non-logged operations? Like Truncate.

Q100.I take regular log backups, but the log has still grown to a massive size and DBCC SHRINKFILE is having no effect at all Why? And what can I do about it?

Q101.How many data files preferred for TempDB for better performance?

Q102.How checkpoint affect TempDB?

Q103.Buffer pool contains so many of dirty pages related to TempDB? Why ?

Q104.What all Transaction Log is available in Full backup? What is its significance?

Q105.What is the cause, log_reuse_wait_desc is showing Replication and still the Replication has not been configured on database?

Q106. How to write sql query to get the data from table but column should contain the unique values?

Q107. How View works ?

Q108. What is indexing and why to use?

Q109. How to fetch data from employee details who are from Bangalore city?

Q110. What is the command to get back the privileges provided by the GRANT command?

Q111. How to create a table by copying only the structure of another table?

Q112. How to drop a column from a table?

Q113. What is the use recursive stored procedure?

Q114. How to use Alias ?

Q115. Difference between TRUNCATE and DROP statements?

Q116. How to create database in mysql?

Q117. How to drop database in mysql?

Q118. How to create a replica of existing table?

Q119. Write a SQL statement to display all the record from employee table which has salary above 50000

Q120. What is Union and how to write sql?

Q121. What is Union All and how to apply on tables ?

Q122. What is like and how to use it?

Q123. What does MIN(),MAX() functions do?

Q124. What is BETWEEN and how it works ?

Q125. How UPDATE statement works internally and how to use ?

Q126. What is join and what are the types of joins is there ?

Q127. How Left Join works?

Q128. How to get the total number of records present in a table?

Q129. How to search a substring of name?

Q130. How to take table records with some limit in Mysql?

Q131. What is distinct keyword and how it works?

Q132. What is Where clause?

Q133. What is AND operator in SQL?

Q135. What is NOT operator in SQL?

Q136. What is OR operator?

Q137. What is Order by Statement in SQL?

Q138. How Insert into Statement works ?

Q139. How to update multiple column in same table using update?

Q140. How DELETE works in SQL?

Q141. What is the use of right Join?

Q142. What is the use of TOP keyword ?

Q143. How do get the lowest and highest data from a table?

Q144. What is the commonly used aggregate function in SQL?

Q145. What is the use of IN operator in SQL?

Q146. What is the mean by SQL Join?

Q147. What is the use of INNER join in SQL?

Q148. What is the use of FULL OUTER join in SQL?

Q149. What is the use of SELF join in SQL?

Q150. How to write to display a string like 'Life is all about the next step'?

Q151. How to write sql query to get 3 numbers in 3 columns.

Q152. How to write query to get the sum of 100 and 55

Q153. How change database from one to another?

Q154. Which are the conditional clauses in SQL?

Q155. What is the difference between Where and Having?

Q156. Difference between Group and Order by?

Q157. What is the use of stored procedure?

PL-SQL Interview Questions and Answers

Q1. What is PL/SQL?

Q2. What is the basic structure of PL/SQL?

Q3. What is cursor ? Why cursor is required?

Q4. Explain the two types of cursors?

Q5. What is the cursor attributes used in PL/SQL?

Q6. What is Exception in Oracle?

Q7. When is the CURSOR_ALRADY_OPEN exception raised?

Q8. Is there a limit on the size of a PL/SQL block?

Q9. What are the advantages of Stored Procedures?

Q10. Can standalone programs be overloaded?

Besant Technologies – Chennai & Bangalore Branch Locations

Besant Technologies - Velachery Branch
Plot No. 119, No.8, 11th Main road, Vijaya nagar,
Velachery, Chennai - 600 042
Tamil Nadu, India
Landmark - Reliance Digital Opposite Street
+91-996 252 8294 / 996 252 8293

Besant Technologies - Tambaram Branch
No.2A, 1st Floor, Duraisami Reddy Street,
West Tambaram, Chennai - 600 045
Tamil Nadu, India
Landmark - Near By Passport Seva
+91-970 725 0260

Besant Technologies - OMR Branch
No. 5/318, 2nd Floor, Sri Sowdeswari Nagar,
OMR, Okkiyam Thoraipakkam, Chennai - 600 097
Tamil Nadu, India
Landmark - Behind Okkiyampet Bus Stop,
+91-887 038 4333

Besant Technologies - Porur Branch
No. 180/84, 1st Floor, Karnataka Bank Building
Trunk Road, Porur,
Chennai - 600 116
Tamilnadu, India
Land Mark: Opposite to Gopalakrishna Theatre
+91-755 022 6990

Besant Technologies - Anna Nagar Branch
Plot No:1371, 28th street kambar colony,
I Block, Anna Nagar ,
Chennai - 600 040
Tamil Nadu, India
Landmark - Behind Reliance Fresh
+91-938 404 0493

Besant Technologies - T.Nagar Branch
Old No:146/2- New No: 48,
Habibullah Road,T.Nagar,
Chennai - 600 017
Tamil Nadu, India
Landmark - Opposite to SGS Sabha
+91-984 025 8377

Besant Technologies - Thiruvanmiyur Branch
22/67, 1st Floor,
North mada street, Kamaraj Nagar
Thiruvanmiyur, Chennai 600041
Tamil Nadu, India
Landmark - Above Thiruvanmiyur ICICI Bank
+91-938 404 0493

Besant Technologies - Siruseri Branch
No. 4/76, Ambedkar Street,
OMR Road, Egatoor, Navallur,
Siruseri, Chennai 600130
Tamil Nadu, India
Landmark - Near Navallur Toll Gate, Next to Yamaha Showroom
+91-7338 810 550

Besant Technologies - Maraimalai Nagar Branch
No.37, Ground Floor,
Thiruvalluvar Salai,
Maraimalai Nagar,Chennai 603209
Tamil Nadu, India
Landmark - Near to Maraimalai Nagar Arch
+91-979 123 7373

Besant Technologies - BTM Layout Branch
No 2, Ground floor,
29th Main Road, Kuvempu Nagar,BTM Layout 2nd Coming from Silkboard, take left at AXA company signal,
Stage, Bangalore - 560 076
Karnataka, India
Landmark - Next to OI Play School
+91-762 494 1772 / 74

Besant Technologies - Marathahalli Branch
No. 43/2, 2nd Floor, VMR Arcade,
Varthur Main Road, Silver Springs Layout,
Munnekollal, Marathahalli, Bengaluru - 560037
Karnataka, India
Landmark - Near Kundalahalli Gate Signal
+91-910 812 6341

Besant Technologies - Rajaji Nagar Branch
No. 309/43, JRS Ecstasy, First Floor,
59th Cross, 3rd Block, Bashyam Circle,
Rajaji Nagar, Bangalore - 560 010
Karnataka, India
Landmark - Near Bashyam Circle
+91- 734 916 0004

Besant Technologies - Jaya Nagar Branch
No. 2nd Floor,1575,11th Main Road,
4th T-Block, Pattabhirama Nagar, Jaya Nagar,
karnataka, India
Land Mark: Opposite to Shanthi Nursing Home
+91-733 783 7626

Besant Technologies - Kalyan Nagar Branch
No.513, 4th Cross Rd
2nd Block, HRBR Layout, Kalyan Nagar,
karnataka, India
Land Mark: Opposite to kalayan nagar Axis Bank
+91-938 404 0495

Besant Technologies - Electronic City Branch
No. 7, 3rd Floor, Ganga Enclave,
Neeladri Road, Karuna Nagar, Doddathoguru Village,
Electronics City Phase 1, Electronic City,
Bangalore - 560100, karnataka, India
Land Mark: Adjacent to HDFC Bank and State Bank Of India
+91-782 392 2180

Besant Technologies - Indira Nagar Branch
No.54, 1st Floor,
5th Main kodihalli,
Bengaluru, Karnataka 560008, India
Landmark: Behind Leela Palace Hotel,
+91-910 812 6339

Besant Technologies - HSR Layout Branch
Plot No. 2799 & 2800, 27th Main,
1st Sector, HSR Layout,
Bengaluru, Karnataka 560102, India
+91-733 783 7626

Besant Technologies - Hebbal Branch
No.29, 2nd Floor, SN Complex,
14th Main Road, E-Block Extention, Sahakara Nagar,
Bengaluru, Karnataka -560092, India
+91-938 404 0496