Database Developer
40+ Database Developer Interview Questions and Answers
Q1. - Waterfall model - What is cursor in SQL - Normalization and denormalization - SDLC Lifecycle - Why we need SQL - Function and procedure in SQL - What are the main blocks of T-sql or Pl-sql - Column in left ta...
read moreInterview questions for Database Developer
Waterfall model is a linear approach to software development
Cursor is a database object used to manipulate data row by row
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity, while denormalization is the process of intentionally introducing redundancy to improve performance
SDLC Lifecycle is a process followed by a development team to create a software product
SQL is used to mana...read more
Q2. 1.HOW TO DELETE DUPLICATE RECORDS FROM A TABLE?
To delete duplicate records from a table, we can use the DISTINCT keyword or GROUP BY clause in SQL.
Use the DISTINCT keyword to select unique records from the table.
Use the GROUP BY clause to group the records by a specific column and select only the distinct groups.
Use the HAVING clause to filter out groups with more than one record.
Create a temporary table with distinct records and then delete the original table and rename the temporary table.
Use the ROW_NUMBER() function t...read more
Database Developer Interview Questions and Answers for Freshers
Q3. How do you optimize your select statements in SQL?
Optimize select statements by using indexes, avoiding unnecessary joins, and limiting the number of columns selected.
Use indexes to speed up queries
Avoid unnecessary joins and subqueries
Limit the number of columns selected
Use WHERE clauses to filter results
Use GROUP BY and ORDER BY clauses wisely
Consider using stored procedures or views
Regularly analyze and optimize the database
Q4. What are indexes and how indexing is useful?
Indexes in databases are data structures that improve the speed of data retrieval operations.
Indexes are data structures that store a small portion of the table data in an optimized format for quick retrieval.
They help in speeding up data retrieval operations such as SELECT queries by reducing the number of rows that need to be scanned.
Indexes can be created on one or more columns of a table to improve the performance of queries that filter or sort by those columns.
Examples o...read more
Q5. What is indexing? Different types of indexes?
Indexing is a technique to improve database performance by reducing the time taken to retrieve data.
Indexes are created on one or more columns of a table.
Types of indexes include clustered, non-clustered, unique, and full-text indexes.
Clustered indexes determine the physical order of data in a table.
Non-clustered indexes are separate structures that contain a copy of the indexed columns and a pointer to the actual data.
Unique indexes ensure that each value in the indexed colu...read more
Q6. What are joins? what is a view?
Joins are used to combine data from two or more tables based on a related column. A view is a virtual table created from a query.
Joins are used to retrieve data from multiple tables based on a related column
There are different types of joins such as inner join, left join, right join, and full outer join
Views are virtual tables created from a query that can be used to simplify complex queries or restrict access to sensitive data
Views do not store data themselves, but rather pr...read more
Share interview questions and help millions of jobseekers 🌟
Q7. What r the advantages of using transactions
Transactions ensure data consistency and integrity in a database.
Allows multiple operations to be treated as a single unit of work
Ensures that all operations are either committed or rolled back as a whole
Prevents data inconsistencies and corruption
Provides ACID properties to the database
Example: transferring funds between bank accounts
Example: updating inventory levels after a purchase
Q8. Whar are the different forms of normalization?
Normalization is a process used to organize a database into tables and columns to reduce redundancy and improve data integrity.
First Normal Form (1NF) - Eliminates duplicate data by ensuring each column contains atomic values.
Second Normal Form (2NF) - Requires that each non-key attribute is fully functionally dependent on the primary key.
Third Normal Form (3NF) - Ensures that non-key attributes are not transitively dependent on the primary key.
Boyce-Codd Normal Form (BCNF) -...read more
Database Developer Jobs
Q9. How to run parallel queries for multiple databases ??
To run parallel queries for multiple databases, use parallel processing techniques and tools.
Use parallel processing techniques such as multi-threading or distributed computing to run queries simultaneously on multiple databases.
Consider using tools like Apache Hadoop or Apache Spark for parallel processing of queries across multiple databases.
Ensure proper resource allocation and optimization to prevent performance issues when running parallel queries on multiple databases.
Q10. What is normalisation technique used for database??
Normalization technique is used to organize data in a database to reduce redundancy and improve data integrity.
Normalization involves breaking down a table into smaller tables and defining relationships between them.
It helps in reducing data redundancy by storing data in a structured and organized manner.
Normalization ensures data integrity by minimizing data anomalies such as update, insert, and delete anomalies.
There are different normal forms such as 1NF, 2NF, 3NF, BCNF, a...read more
Q11. Index tyoes how you used in previous organization
I have used various types of indexes such as clustered, non-clustered, unique, and composite indexes in my previous organization.
Utilized clustered indexes to physically sort the data on disk based on the index key
Implemented non-clustered indexes to improve query performance by creating a separate data structure
Employed unique indexes to enforce uniqueness on one or more columns
Created composite indexes to improve query performance on multiple columns
Q12. Did you know how to work on hadoop?
Yes, I have experience working on Hadoop.
I have worked on Hadoop for data processing and analysis.
I am familiar with Hadoop's distributed file system (HDFS) and MapReduce framework.
I have used Hadoop to handle large volumes of data and perform complex computations.
I have experience with Hadoop ecosystem tools like Hive, Pig, and Spark.
I have optimized Hadoop jobs for performance and scalability.
I have worked on Hadoop clusters and managed data storage and retrieval.
I have imp...read more
Q13. 1. Difference between azure Sql vs azure sql mi 2. Azure Key vault
Azure SQL is a managed relational database service while Azure SQL MI is a fully managed, cloud-based version of SQL Server.
Azure SQL is a Platform as a Service (PaaS) offering, while Azure SQL MI is an Infrastructure as a Service (IaaS) offering.
Azure SQL is designed for small to medium-sized databases, while Azure SQL MI is designed for larger databases with more complex requirements.
Azure SQL provides automatic patching and backups, while Azure SQL MI allows more control o...read more
Q14. What are stored procedures?
Stored procedures are pre-written SQL codes that can be saved and reused in a database.
Stored procedures are used to improve database performance and security.
They can be called from within an application or directly from the database.
They can accept input parameters and return output parameters or result sets.
Examples include procedures for inserting, updating, and deleting data.
They can also be used for complex data manipulation and business logic.
Q15. What are indexes? How are they built
Indexes are data structures that improve the speed of data retrieval in databases.
Indexes are built on columns in database tables to quickly locate rows based on the indexed column values.
They are typically implemented using B-tree or hash data structures.
Examples of indexes include primary keys, unique keys, and non-unique indexes.
Creating an index involves sorting the values of the indexed column and storing pointers to the corresponding rows.
Q16. What is SQL and why we use it
SQL is a programming language used to manage and manipulate relational databases.
SQL stands for Structured Query Language
It is used to create, modify, and query databases
It is used in various industries such as finance, healthcare, and e-commerce
Examples of SQL-based databases include MySQL, Oracle, and Microsoft SQL Server
Q17. what is temporary table and what is view
Temporary table is a table that exists temporarily and is used to store data temporarily. A view is a virtual table that is based on the result-set of an SQL statement.
Temporary table is created for a specific session or task and is dropped automatically when the session is closed or the task is completed.
Temporary table can be used to store intermediate results during complex queries or to store data that needs to be manipulated before being inserted into a permanent table.
V...read more
Q18. What are DBMS? how do you manage them?
DBMS stands for Database Management System. It is a software that allows users to interact with databases.
DBMS is used to create, update, and manage databases.
It provides tools for data storage, retrieval, and manipulation.
Examples of DBMS include MySQL, Oracle Database, and Microsoft SQL Server.
Q19. Write a procedure with bulk collect
Procedure with bulk collect for array of strings
Use FORALL statement for efficient processing
Declare a collection type
Use LIMIT clause to control memory usage
Q20. Difference between drop and delete command
Drop command removes the entire table while delete command removes specific rows.
Drop command is a DDL (Data Definition Language) command while delete command is a DML (Data Manipulation Language) command.
Drop command cannot be rolled back while delete command can be rolled back using transaction.
Drop command is faster than delete command as it removes the entire table at once.
Example: DROP TABLE table_name; DELETE FROM table_name WHERE condition;
Q21. Do you know about cluster?
Yes, a cluster is a group of servers or computers that work together to provide high availability and scalability.
A cluster is used to distribute the workload and improve performance.
It provides redundancy and fault tolerance by allowing one server to take over if another fails.
Clusters can be used in various applications like database systems, web servers, and high-performance computing.
Examples of cluster technologies include Microsoft SQL Server AlwaysOn, Apache Hadoop, an...read more
Q22. What is data structure?
Data structure is a way of organizing and storing data in a computer so that it can be accessed and manipulated efficiently.
Data structure defines the relationship between data elements and the operations that can be performed on them.
It helps in optimizing the use of memory and improving the efficiency of algorithms.
Examples of data structures include arrays, linked lists, stacks, queues, trees, and graphs.
Q23. Given 10 digit number wanted 4_3_3 format
The 10 digit number should be formatted as 4_3_3.
Split the 10 digit number into 3 parts: first 4 digits, next 3 digits, and last 3 digits.
Insert an underscore (_) between the parts to get the desired format.
Example: 1234567890 should be formatted as 1234_567_890.
Q24. What are magic tables
Magic tables are temporary tables created by SQL Server during DML operations.
Magic tables are used to access the data before and after an INSERT, UPDATE, or DELETE operation.
They are created automatically by SQL Server and cannot be modified by the user.
The inserted and deleted tables are examples of magic tables.
They are useful for auditing and logging changes to a database.
Q25. What r output parameters
Output parameters are variables used to return values from a function or stored procedure.
Output parameters are declared with the OUTPUT keyword in SQL Server.
They can be used to return a single value or a table of values.
Output parameters are useful for passing data between stored procedures or functions.
They can also be used to return status codes or error messages.
Q26. what are different joins?
Different types of joins are used to combine rows from two or more tables based on a related column between them.
Inner Join: Returns rows when there is at least one match in both tables.
Left Join (or Left Outer Join): Returns all rows from the left table and the matched rows from the right table.
Right Join (or Right Outer Join): Returns all rows from the right table and the matched rows from the left table.
Full Join (or Full Outer Join): Returns rows when there is a match in ...read more
Q27. Wht is a recursive cte
A recursive CTE is a Common Table Expression that references itself.
It is used to perform recursive operations on hierarchical data.
It consists of two parts: the anchor member and the recursive member.
The anchor member is the base case and the recursive member is the recursive case.
It can be used to traverse a tree structure or to calculate running totals.
It can improve performance and simplify complex queries.
Q28. what is database architecture?
Database architecture refers to the design and structure of a database system.
Database architecture includes the organization of data, storage, retrieval, and security mechanisms.
It involves defining the relationships between data elements and how they are stored and accessed.
Examples of database architectures include hierarchical, network, relational, and object-oriented.
Database architecture also includes the choice of database management system (DBMS) and hardware infrastr...read more
Q29. Left and right join explanation
Left join includes all records from the left table and matching records from the right table. Right join includes all records from the right table and matching records from the left table.
Left join: Returns all records from the left table and the matched records from the right table.
Right join: Returns all records from the right table and the matched records from the left table.
Example: Left join - SELECT * FROM table1 LEFT JOIN table2 ON table1.id = table2.id;
Example: Right ...read more
Q30. Give me one query to solve
Query to find the total sales amount for each product category
Use GROUP BY clause to group the sales by product category
Use SUM function to calculate the total sales amount
Join the sales table with the product table to get the product category
Q31. Types and scope of temptables
Temp tables are used to store intermediate results during query processing.
Temp tables are created in tempdb database.
They can be local or global.
Local temp tables are only visible to the current session.
Global temp tables are visible to all sessions.
They can be created using SELECT INTO or CREATE TABLE statements.
They can be used to store intermediate results during complex queries.
They are automatically dropped when the session that created them ends.
They can also be explic...read more
Q32. Postgre sql advantage over oracle
PostgreSQL is open-source, highly extensible, and has strong support for advanced features.
PostgreSQL is open-source, while Oracle is a proprietary database system.
PostgreSQL has strong support for advanced features like JSON data types, full-text search, and custom extensions.
PostgreSQL is highly extensible, allowing users to create custom functions, data types, and indexing methods.
PostgreSQL has a strong community support and regular updates, making it a popular choice for...read more
Q33. what is abstract
Abstract is a concept or idea that is not concrete or tangible.
Abstract refers to something that is theoretical or conceptual rather than physical.
It is often used in programming to define classes or methods that cannot be instantiated.
Abstract art does not attempt to represent an accurate depiction of visual reality.
Q34. what is inheritance
Inheritance is a concept in object-oriented programming where a class can inherit attributes and methods from another class.
Allows for code reusability and promotes a hierarchical structure
Derived classes can access and modify the properties and behaviors of the base class
Types of inheritance include single, multiple, multilevel, and hierarchical inheritance
Q35. Joins types with problematic
Different types of joins in SQL can lead to performance issues and incorrect results if not used properly.
Inner join: Returns only the rows that have matching values in both tables.
Outer join: Returns all rows from both tables, filling in NULL values for unmatched rows.
Cross join: Returns the Cartesian product of the two tables, potentially leading to a large result set.
Self join: Joins a table to itself, useful for comparing rows within the same table.
Q36. difference between delete and truncate
Delete removes rows one by one, while truncate removes all rows at once.
Delete is a DML command, while truncate is a DDL command.
Delete can be rolled back, while truncate cannot be rolled back.
Delete fires triggers, while truncate does not fire triggers.
Delete is slower as it logs individual row deletions, while truncate is faster as it logs the deallocation of the data pages.
Example: DELETE FROM table_name WHERE condition; TRUNCATE TABLE table_name;
Q37. what is data base
A database is a structured collection of data that is organized in a way that allows for easy access, management, and retrieval.
A database stores data in tables, which consist of rows and columns.
It allows for efficient querying and manipulation of data.
Examples of databases include MySQL, Oracle, and MongoDB.
Q38. what is PM key
PM key is a primary key in a database table that uniquely identifies each record.
PM key stands for Primary Key
It is used to uniquely identify each record in a database table
It ensures data integrity and helps in efficient data retrieval
Example: In a table of employees, the PM key could be the employee ID
Q39. Difference between DDL and DML
DDL is used to create, modify or delete database objects while DML is used to manipulate data within those objects.
DDL stands for Data Definition Language
DML stands for Data Manipulation Language
DDL is used to create, modify or delete database objects like tables, indexes, etc.
DML is used to manipulate data within those objects like inserting, updating, deleting data
Examples of DDL statements are CREATE, ALTER, DROP
Examples of DML statements are INSERT, UPDATE, DELETE
Q40. Index and its difference
Index is a data structure that improves the speed of data retrieval in a database.
Indexes are used to quickly locate data without having to search every row in a database table.
They can be created on one or more columns in a table.
Types of indexes include clustered, non-clustered, unique, and composite indexes.
Examples of indexes are primary keys, foreign keys, and indexes created for frequently searched columns.
Q41. Stored procedure vs function
Stored procedures are used to perform a set of actions, while functions return a single value.
Stored procedures can perform multiple actions and can return multiple result sets.
Functions are used to return a single value based on input parameters.
Stored procedures can be called independently, while functions are typically called within SQL statements.
Stored procedures can contain DML statements, while functions cannot.
Q42. Wht are file groups
File groups are logical containers for database files that can be used to manage storage and backup operations.
File groups allow for the organization of database files into logical units.
They can be used to manage storage and backup operations.
A database can have multiple file groups, each with its own set of files.
File groups can be used to control the placement of data and indexes on different physical disks.
File groups can also be used to control the backup and restore ope...read more
Q43. constraints in sql
Constraints in SQL are rules that are enforced on data in a table to maintain data integrity.
Constraints ensure data accuracy and consistency in a database.
Common constraints include NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, and CHECK constraints.
Example: CREATE TABLE Students (ID INT PRIMARY KEY, Name VARCHAR(50) NOT NULL, Age INT CHECK (Age >= 18));
Q44. Explain use of merg
MERGE is a SQL command used to combine INSERT, UPDATE, and DELETE operations into a single statement.
MERGE is used to synchronize two tables by inserting, updating, or deleting rows based on a specified condition.
It is useful for data warehousing and ETL processes.
MERGE can improve performance by reducing the number of round trips between the client and server.
Syntax: MERGE INTO target_table USING source_table ON condition WHEN MATCHED THEN UPDATE SET column1 = value1, column...read more
Q45. write queries of Sql
Writing SQL queries to retrieve data from a database
Use SELECT statement to retrieve data from tables
Use WHERE clause to filter results based on specific conditions
Use JOIN clause to combine data from multiple tables
Interview Questions of Similar Designations
Interview experiences of popular companies
Calculate your in-hand salary
Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary
Reviews
Interviews
Salaries
Users/Month