SQL Interview Questions asked in Top Tech Companies
Last Updated :
16 Jun, 2024
1.What do you understand by Adaptive query processing launched in SQL Server?
Answer: SQL Server and Azure SQL Database introduce a new generation of query processing improvements that will adapt optimization strategies to your application workload’s runtime conditions.
2.Name all three Adaptive query processing features?
Answer. In SQL Server and Azure SQL Database there are Three adaptive query processing features by which you can improve your query performance:
- Batch mode memory grant feedback.
- Batch mode adaptive join.
- Interleaved execution.
3.Write a T-SQL statement to enable adaptive query processing?
Answer: You can make workloads automatically adaptive query processing by enabling compatibility level 140 for the database. You can set this using Transact-SQL. For example:
ALTER DATABASE [WideWorldImportersDW] SET COMPATIBILITY_LEVEL = 140;
4.Name the new string function which is very useful to generate a CSV file from a table?
Answer: CONCAT_WS is a new function launched in SQL Server its takes a variable number of arguments and concatenates them into a single string using the first argument as the separator. It requires a separator and a minimum of two arguments. It is very helpful in generating comma or pipe separated CSV file content.
5. How you will find the LEN in a case?
Answer: We can use following tick Select LEN(‘A value ‘ + ‘x’) – 1
6.What is the use of the new TRIM function?
Answer: It Removes the space character char(32) or other specified characters from the start or end of a string.
7.Is SQL Server 2021 support Python?
Answer: Yes
8. What is log shipping?
Answer: Log shipping is the process of automating the backup of database and transaction log files on a production SQL server, and then restoring them onto a standby server. Enterprise Editions only supports log shipping. In log shipping, the transactional log file from one server is automatically updated into the backup database on the other server.
9.What is NOT NULL Constraint?
Answer: A NOT NULL constraint enforces that the column will not accept null values. The not null constraints are used to enforce domain integrity, as the check constraints.
10.What are the types of database recovery models?
Answer: There are 3 types of database recovery models available
11. Define Synonym?
Answer: Synonym is an alternative method to creating a view that includes the entire table or view from another user to create a synonym. A synonym is a name assigned to a table or view that may thereafter be used to refer to it.
12.What is an active database?
Answer: Active database is a database that includes active rules, mostly in the form of ECA rules(Event Condition rules). Active database systems enhance traditional database functionality with powerful rule processing capabilities, providing a uniform and efficient mechanism for database system applications
13.What is a linked server?
Answer: A linked server enables you to work with other SQL Servers as well as databases other than SQL Server databases, right from within Management Studio.
14. What is the difference between a DDL trigger and a DML trigger?
Answer: A DDL trigger executes in response to a change to the structure of a database (for example, CREATE, ALTER, DROP). A DML trigger executes in response to a change in data (INSERT, UPDATE, DELETE).
15. What database does SQL Server use for temporary tables?
Answer: TempDB
16.What are the types of transaction levels in SQL SERVER?
Answer: There are four transaction levels in SQL SERVER.
- Read committed
- Read uncommitted
- Repeatable read
- Serializable
17.What is SQL Profiler?
Answer: SQL Profiler is a graphical tool that allows system administrators to monitor events in an instance of Microsoft SQL Server. You can capture and save data about each event to a file or SQL Server table to analyze later.
18.What are Data files?
Answer: This is the physical storage for all of the data on disk. Pages are read into the buffer cache when users request data for viewing or modification. After data has been modified in memory (the buffer cache), it is written back to the data file during the checkpoint process.
19.What are the different locks in SQL Server?
Answer: There are six types of locks
- Intent (I)
- Shared (S)
- Update (U)
- Exclusive (X)
- Schema (Sch)
- Bulk Update (BU)
20.Difference between Len() and DataLength()?
Answer: DATALENGTH()- returns the length of the string in bytes, including trailing spaces. LEN()- returns the length in characters, excluding trailing spaces.
For example:
SELECT LEN(‘string’), LEN(‘string ‘), DATALENGTH(‘string’), DATALENGTH(‘string ‘), LEN(N’string’), LEN(String ‘), DATALENGTH(N’string’), DATALENGTH(N’string ‘) Will return 6, 6, 6, 9, 6, 6, 12, 18
Similar Reads
Recently Asked Interview Questions in Product Based Companies
Cracking interviews at top product-based companies can be challenging, especially with their main focus on problem-solving skills. This article compiles a comprehensive list of interview questions recently asked at leading firms such as Amazon, Microsoft, and Google. Covering a wide range of topics
8 min read
Top 25 Frequently Asked Interview Questions in Technical Rounds
Here is the collection of the TOP 25 frequently asked questions based on the experience of interviews in multiple companies. 1Lowest common Ancestor2An unsorted array of integers is given; you must find the max product formed by multiplying three numbers. (You cannot sort the array, watch out when t
1 min read
Advanced SQL Interview Questions
Mastering advanced SQL is always important if you are preparing for data-centric job roles. SQL (Structured Query Language) is the backbone of database management, and employers look for candidates who can show they understand advanced SQL concepts. This interview preparation guide covers frequently
4 min read
PL/SQL Interview Questions and Answers
PL/SQL (Procedural Language for SQL) is one of the most widely used database programming languages in the world, known for its robust performance, flexibility, and tight integration with Oracle databases. It is a preferred choice for many top companies such as Oracle, IBM, Accenture, Infosys, TCS, C
15 min read
Amazon SQL Interview Questions
In an Amazon SQL interview, candidates can expect a range of questions that test their SQL knowledge and problem-solving skills. These questions often involve topics such as data manipulation, query optimization, and database design. To succeed, candidates should be well-versed in SQL fundamentals a
12 min read
HCL SDE Sheet: Interview Questions and Answers
HCL Technologies Ltd is one of the leading global IT services companies that helps global enterprises re-imagine and transform their businesses through Digital technology transformation. The company is primarily engaged in providing a range of software services business process outsourcing and infra
6 min read
Top 50 SQL Questions For Data Analyst Interview
SQL interview questions for data analysts often cover a range of topics, from basic querying techniques to advanced data manipulation and performance optimization. These questions are designed to assess a candidate's understanding of SQL concepts, their ability to write and optimize queries, and the
10 min read
Top 15 Uber SQL Interview Questions with Answers and Explanations
Preparing for a SQL interview at Uber involves not only understanding SQL concepts but also being able to work with practical examples. Here, we'll provide 15 unique SQL questions you might encounter during an interview at Uber, along with detailed database setups and explanations. Each question wil
12 min read
Most Commonly Asked System Design Interview Problems/Questions
This System Design Interview Guide will provide the most commonly asked system design interview questions and equip you with the knowledge and techniques needed to design, build, and scale your robust applications, for professionals and newbies Below are a list of most commonly asked interview probl
2 min read
Top 60+ Data Engineer Interview Questions and Answers
Data engineering is a rapidly growing field that plays a crucial role in managing and processing large volumes of data for organizations. As companies increasingly rely on data-driven decision-making, the demand for skilled data engineers continues to rise. If you're preparing for a data engineer in
15+ min read
Infosys's most asked interview questions
1) Tell me about yourself. 2) About projects, role in project. 3) Why do you want to join Infosys? 4) Strategy to handle major project 5) What is your career objective? 6) Are you fine with working in night shifts? 7) Why should we hire you? 8) They may ask about your family background also. This is
1 min read
Top 80+ Data Analyst Interview Questions and Answers
Data is information, often in the form of numbers, text, or multimedia, that is collected and stored for analysis. It can come from various sources, such as business transactions, social media, or scientific experiments. In the context of a data analyst, their role involves extracting meaningful ins
15+ min read
Top 50 Data Engineering Interview Questions and Answers
Data engineering is a critical field in today's data-driven world, focusing on designing, building, and maintaining the infrastructure and systems for collecting, storing, and processing data. To succeed in this role, professionals must be proficient in various technical and conceptual areas. This l
12 min read
Google SQL Interview Questions
Google is known for its challenging technical interviews and SQL is a key component of these interviews, especially for roles related to data analysis, database engineering, and backend development. Google SQL interview questions typically focus on candidates' proficiency in writing complex SQL quer
11 min read
50+ Common Interview Questions and Answers
Common Interview Questions: Preparing for a job interview can be daunting, but being well-prepared can significantly boost your confidence and chances of success. To help you ace your next interview, here is a list of the Top 50 common interview questions for freshers/college students or experienced
15+ min read
SQL Interview Questions
SQL is a standard database language used for accessing and manipulating data in databases. It stands for Structured Query Language and was developed by IBM Computer Scientists in the 1970s. By executing queries, SQL can create, update, delete, and retrieve data in databases like MySQL, Oracle, Postg
15+ min read
Top 50 PostgreSQL Interview Questions and Answers
Are you preparing for a PostgreSQL interview? PostgreSQL is a powerful open-source relational database management system (RDBMS) that is well-known for its reliability, scalability, and rich set of features. It’s a favorite among developers and businesses alike, making it essential to master if we w
15+ min read
Amdocs Interview Questions
Amdocs is a global leader in software and services for communications, media, and financial services providers that stands at the forefront of technological transformation. Their solutions empower businesses to navigate the rapidly evolving digital landscape, optimize operations, and deliver seamles
5 min read
Amazon Interview Questions and Answers
Landing a Software Development Engineer (SDE) position at Amazon is a dream for many aspiring software engineers. Known for its interview process, Amazon evaluates candidates on a variety of technical and behavioral competencies. Preparing effectively for this process is crucial, and understanding t
3 min read