SQL
SQL Interview Questions for Analyst
What is the most important ingredient in a good Analyst?
The ability to crunch numbers and by far SQL has been the most important weapon of any Analytics Professional. it’s easy to use and understand. But, you can easily be surprised with the difficulty level and variety of questions asked in SQL interviews. I highly recommend you to go through the Daily Quiz Questions as well
SQL Interview Questions for Analyst
ANSWERED
- Write an SQL query to render a column.Why do we use OFFSET command?
- What is the order of execution of SQL commands?
- Write a SQL query to get second highest query using sub query.
- Write a SQL query to find all the student names Nitin in a table
- Write a query to get all the student with name length 10, starting with K and ending with z
- Get the second highest query using ranking.
- Can you use HAVING without any aggregate function?
- Select the winner using SQL queries.
- What would be the result of row number, rank, and dense rank ?
- Find all the students who either are male or live in Mumbai.
- Extract all the distinct email id domain from all the employee
- Can you join two table without any common column?
- Find the output.
- Select case when null=null then ‘Amit’ else ‘Rahul’ end from dual
- Differentiate between COUNT(*) and COUNT(ColName)
- How do we create a table with all the employee Names and Manager Names?
- Write a query for collecting the names of children who pursuing their graduation in their residential city.
- What is indexing in SQL?
- Show how to write a query to show details of an HR whose name starts with M.
- Guess the question.
- What is the use of FETCH command?
- Give the number of duplicate names and their frequency.
- Get alternate record from table.
- How would you partition data for optimum performance?
- Over-weigh
- tArrange the employees with respect to their Joining date, most experienced employee coming on the top followed by others.
- Find employees that satisfy the condition.
- Find employees satisfying the given condition & create a new table.
- Write an SQL Query find number of employees whose DOB is between 01/07/1965 to 31/12/1975.
- How can you create an empty table from an existing table? Write the steps and explain the working.
- What is the use of IFNULL and ISNULL in SQL?
- Write a SQL query to create a Table 3 that contains the following columns- Id, First_Name, Last_Name, Salary
- .Creating subqueries.
- Remove duplicate entries from the table.
- How can you eliminate duplicate rows from a query result?
- Which join is used to join a table with itself?
- Guess the question.Using wildcards in MySQL.
- Perform the SQL instructions as specified.
- List the products from each brand.
- Write query for the problem statement.
- How the triggers will execute if two or more triggers?
- What are the primitive operations common to all database management systems?
- Provide detailed queries to retrieve the answers to the following questions.
- Pivot a table in SQL using the pivot function.
- What is the function of OFFSET command?
- Use regular expression to render records as specified.
- Important conditions for joining two tables on a key? Question
- Which join takes more processing time?
- Differentiate between NVL and NVL2 functions.
- What is NTILE with syntax?
- How to get the cumulative sum in a table?
- Find the Nth largest salary from employee table.
- Write valid query.
- Write a SQL query to find the common records between two tables.
- Write a query to get all the employee detail from EmployeeDetail table.
- How to calculate the output of the functions?
- How to do database integrity?
- Use regular expression to find the number of people who are from Delhi and have arrived in Patna in the last 7 days, as specified.
- Create a ranking row without using Rank function in SQL.
- Does the data stored in the stored procedure increase access time or execution time? Explain.
- What is the function of COALESCE()?
- Write a valid query for the given problem.
- What is a RANK() function?
- How to fetch only even rows from a table?
- What do you understand by Fuzzy merging?
- Which language will you use to handle it?
- Get the Emp_id for employees whose Dept_id is either invalid or not present in the database.
- If we drop a table, does it also drop related objects like constraints, indexes, columns,
- Define DDL, DML and DCL.
- What is the use of NVL function in Oracle?
- How to generate row number in a table without using ROWNUM() ?
- How would you select the top 100 customers with the highest spend over a year-long period?
- What are the differences among ROWNUM, RANK and DENSE_RANK?
- All you have to do is to go through the code and comment the question for which the following is an answer of the given.
- What are the steps you will take to improve the performance of a poor performing query?
- What is parser?
- How many rows will be populated ?
- How would you group the users together in meaningful segments?
- Get all employee detail from EmployeeDetail table whose “FirstName” not start with any single character between ‘a-p’
- Write a SQL query to find the date along with the IDs whose temperature is lower from the next day.
- How can you create an empty table from an existing table?
- What is the difference between DELETE and TRUNCATE commands?
- Given two tables, one of customers and another of car accidents, write a SQL query to get the top car accidents by day.
- Write a query to find employees who have completed more than 2 years in the company.
- Find the hours for which the product ‘A’ was out of stock, assuming this is all the data for one day only
- Give some problems or scenarios where map-reduce concept works well and where it doesn’t work.
- Guess the question.
- What is the correct order of writing SQL query from given tags?
- Print the message ‘NUMBER’ if valid, ‘NOT NUM’ if not.
- Query the list of CITY names from STATION that does not start with vowels and do not end with vowels.
- calculate the count distinct ids which are there present for last 7 days with respect to given date.
- Arrange the Emp_name in alphabetical order in the new table that only has the salary and Emp_name column in it.
- State some biases that you are likely to encounter when cleaning a database.
- Write a query to replace “not provided” where there is null in the below table and then show the department manager column.
- What will be the output of Following SQL Query.
- To create a sql script so that it keeps information of all the user’s badge swipe in the last 30 days only and truncates the rest of the dataList the total number of products of each brand.
- List the total numbers of products of each brand.Get the appropriate result.
- Write a query using above tables to display the Emp_no, name and Experience ( in year and month)from joining date to current date. Question
- Refer to the following table and answer the questions related to it.
- For what purpose we are using view?
- Guess the question.
- How can you create an empty table from an existing table?
- UNANSWERED
- Can we have another column in a table other than a primary key column which will act as a primary key?
- You are provided with a poor performing query, suggest some methods to improve it and satisfy the required conditions.
- Suggest some ways to handle Duplicate Records.
- After entering the data from the front-end application interface, how do you test whether a database is updated or not?
- Find the 4th highest employee salary from the table
- What are different types of UDF in SQL?
What changes can you recommend to reduce the use of triggers?
If a table contains duplicate rows, does a query result display the duplicate values by default? - How can you use a CTE to return the fifth highest salary from a table?
- What is Hash Join?
List the id , marks of all students whose marks don’t fall under any grade. - How will you update a table without using Update statement?
- Can you modify the rows in a table based on values from another table? Explain.
- Find no. of subscribers each month or MoM.
- What do you understand by Fuzzy merging?
- What is the purpose of the group functions in SQL?
- Write a SQL query to find total number of employees who are inside the office at 4PM . Consider all possible cases .
- What is the role of “Database Testing” in SQL?
- What’s the actual practical use of OFFSET? SQL
- Find the output.
- The wildcard in a WHERE clause is useful when?
- How do you go about investigating the slowness and helping them to improve queries?
- Which expressions or functions allow you to implement conditional processing in a SQL statement?
- Explain the difference between “long” and “wide” format data.
- Explain PARTITION key.
- How can you use a CTE to return the fifth highest (or Nth highest) salary from a table?
- What is the difference between Case and Searched Case statements in SQL? How do data management procedures like missing data handling make selection bias worse?
We are pleased to inform that we have launched our Live Training session for anyone who wish to learn about Analytics domain. It was invite based for the last 3 batches. Now we are open to all.
Check all the details here – The Data Monk Super 10 and Super 20 Live Classes
There are some good interview questions on Guru.com
For any help, issues, resume overview, buying books, reviewing courses, etc. You can email us at [email protected] or [email protected]
Leave a reply