Are you getting ready for your SQL developer job interview?
You've come to the correct place.
This tutorial will assist you in brushing up on your SQL skills, regaining confidence, and being job-ready!
Here is a collection of real-world interview questions from organisations such as Google, Oracle, Amazon, and Microsoft, among others. Each question is accompanied by a neatly written answer inline, saving you time during interview preparation.
Following are some practise problems to help you master the fundamentals of SQL.
1. Find the third highest salary from the Employee table.
Note: We pass two parameters to the LIMIT clause, where the first one is the offset that is after which row data needs to be fetched and the second parameter is the row count that is how many rows it has to return. Here we need 1 row from after the 2nd row, hence LIMIT 2,1.
2. Display the first and last record from the Employee table.
For first record:
For last record:
Here subqueries has been used to get the minimum and maximum value of EMPID that is the first and last records and returned to the outer query respectively.
3. Display the list of employees working in the same department.
From the two tables E and E1 distinct employees are selected and returned the ones having the same department but different empID.
4. Retrieve the last 3 records from the Employee table.
Output of inner query is hold by the cursor temp then is returned to the outer query which rearranges the 3 records in ascending order.
5. Show details of employees whose EmpLastName ends with the alphabet ‘S’ and contains 4 alphabets.
Three underscore followed by s gives the last names ending with s and having total 4 letters.
6. Fetch the duplicate rows in a table.
Here the duplicates is found by calculating the count of each empID and returning the ones present more than once.
7. Calculate even and odd records from a table.
For Even:
For Odd:
MOD function is used for getting reminder, where the first parameter is the dividend and the second is divisor.
8. Write a query to retrieve first four characters of employee name.
Substring is a function that is used to get the parts of a string where the first parameter is the column name, followed by starting and ending positions respectively.
9. Write a query to return the number of employees whose DOB is between 01/01/1990 to 01/01/2001 and are grouped according to gender.
If we pass date in DD/MM/YYYY format then we need to specify it accordingly into the query:
10. Fetch the details of employees excluding the ones who are ‘HR’ and ‘ADMIN’.
Here the NOT IN operator has been used to filter the data from Department that is not having values as HR or Admin.
11. Display the total salary of each employee after adding 10% increment in the salary.
We perform the required arithmetic operations to get the desired result in a new column as New Salary.
12. Fetch the order details of today’s date. Given is the orders table with the order_id and their corresponding dates as order_Updated_date.
Date function is used to compare the order date and today’s date.
This blog gives you a rough pathway of core questions ans topics to follow. Ofcourse, you can and should explore more on your journe. Also, if you have any particular topic that you want covered, please write to us. If you wanna connect with me, here is my linkedin profile — Sneha Biswas. If you have any questions, feel free to contact me.
If you're looking to prepare for a job in the tech industry, Data Structures and Algorithms (DSA) are essential to master. Practising problems on plat......
Each and every programmer needs a strong grasp in DSA to write efficient and optimised codes. However, DSA has a reputation of being one of the most f......
Its that time round the calendar again, but different for you all as for the first time now. You all will be facing the on campus placement season.Wit......
WHAT IS WEB3?Web3 is the catch-all term for the vision of an upgraded version of the internet aimed at giving power back to the users. It is truly the......
Operating Systems is one of the core subjects for a computer science student. As such a lot of important questions are asked on this subject in interv......
Cognizant helps organizations remain ahead of the competition by modernizing technology, reinventing processes, and redefining customer experiences. I...
Getting started with cloud computing ?The words "cloud" and "web" will be interchangeable. What kind of business operates today without the internet? ...
SOFTWARE MAINTENANCE:Software Maintenance can be defined as the process of modifying a software product after its delivery. The main purpose of softwa...
A quick summary upto what we did this far from this series:Software EngineeringSoftware engineering is a discipline of engineering concerned wit...
Capgemini is a global leader in consulting, digital transformation, technology, and engineering services. In the rapidly evolving world of cloud, digi...
Technical Round :Candidates who pass the online test will be invited to the technical interview...
About Mindtree:Mindtree Ltd, located in Bangalore, India, is a prominent Indian multinational information technology and outsourcing company. The ...
TCS NQT Interview kicks off with the aptitude test. The test follows the following pattern : TCS uses the TCS-iON software for their online aptit...
Increased competition for fewer jobs in the current economy means that just being right for the role on paper, is not enough on its own anymore. You h...
About TCS NinjaTCS administers the NQT to select candidates for a variety of positions (National Qualifier Test). Tens of thousands of people apply fo...
Introduction:Understanding time complexity of a function is imperative for every programmer to execute a program in the most efficient manner. Time co...
Software MethodologyA software methodology (which is also known as software process) is a set of related development Phases that leads to the pr...
About TCS DigitalTCS selects applicants for a variety of jobs by conducting the NQT (National Qualifier Test). About 10,000-15,000 job applicants subm...
Software Engineering is a subject that requires when you are a software developer as well as when you are in your college preparing for a semester or ...
Introduction: What is SQL?To understand SQL, we must first understand databases and database management systems (DBMS).Data is essentially a collectio...
TCS Recruitment ProcessInterview RoundsInterview round 1: TCS NQTTCS NQT (National Qualifier T...
TCS NQT Aptitude has three sections, namely the Numerical Ability, Verbal Ability, and Reasoning Abi...
About TCS NQTTCS NQTs, also known as TCS National Qualifier Tests or Tata Consultancy Services Natio...
Networking: Importance in real life!Using a computer for work, as well as for personal use, ha...
ER-DiagramWhat are ER Models ?An Entity Relationship Diagram (ERD) is a visual representation of dif...
What is actually DBMS?A Database Management System (DBMS) is system software used to manage the orga...
Nowadays students tend to go more for off campus placements rather than on campus placements.One of ...
C CHEATSHEETINTRODUCTION:C programming language was developed by Dennis Ritchie of Bell Labs in 1972...
C is a general purpose high-level language most popular amongst coders, it is the most compatible, e...
What is GenC and GenC Next?GenC stands for Generation Cognizant. It basically means the fresher hiri...
C++ programming language has templates which basically allows functions and classes to work with gen...
C++ was conceived in the late 1970s to overcome the limitations of C. It is an extension of th...
Interview Questions are a great source to test your knowledge about any specific field. But remember...
The most popular high-level, multipurpose programming language right now is Python.Python supports p...
IntroductionPython is a high-level programming language with dynamic binding and high-level inherent...
Interview Questions are a great source to test your knowledge about any specific field. But remember...
Object-Oriented Programming or better known as OOPs is one of the major pillars of Java that has lev...
Java is a high-level programming language known for its robustness, object-oriented nature, enhanced...
Placements are an important part of engineering life, and while everyone hopes to be placed in a reputable company, only a few are successful. This is primarily due to a...