SQL Server Interview Questions and Answers For All Database Developer and Administrators,Related Posts
We provides you SQL Query Interview Questions pdf with example, SQL Interview, for fresher and experience, SQL Queries Interview Questions pdf for free download and SQL Download Sql Interview Questions PDF/ePub or read online books in Mobi eBooks. Click Download or Read Online button to get Sql Interview Questions book now. This site is like a 14/06/ · Most modern database management systems like MySQL, Microsoft SQL Server, Oracle, IBM DB2, and Amazon Redshift are based on RDBMS. You can download a PDF SQL Interview Questions and Answers PDF Download for Oracle, MySQL, AWS Redshift, Google BigQuery, Snowflake, PostgreSQL, MariaDB, IBM DB2, Sybase, SQL Server and Question # 27 What are SQL Data types? Answer: Max. columns in a table is Max. Char size is , Long is 64K & Number is 38 digits. Cannot Query on a long column. Char, ... read more
Home PHP Jobs Example C Example Java AngularJS Blog. SQL Interview Question. SQL Interview PDF SQL Interview PDF. SQL Query interview Question PDF. SQL Query PDF SQL Query interview PDF SQL interview PDF. Java two dimensional array Php variable assignment Php example. Programming tutorial. Answer: HAVING clause can be used only with SELECT statement. It is usually used in a GROUP BY clause and whenever GROUP BY is not used, HAVING behaves like a WHERE clause. Having Clause is only used with the GROUP BY function in a query whereas WHERE Clause is applied to each row before they are a part of the GROUP BY function in a query. List some case manipulation functions in SQL? Answer: There are three case manipulation functions in SQL, namely: LOWER: This function returns the string in lowercase. It takes a string as an argument and returns it by converting it into lower case.
It takes a string as an argument and returns it by converting it into uppercase. Click below to know more. What is an ALIAS command? Answer: ALIAS name can be given to any table or a column. This alias name can be referred in WHERE clause to identify a particular table or a column. For example- Select emp. empID, dept. Result from employee emp, department as dept where emp. empID In the above example, emp refers to alias name for employee table and dept refers to alias name for department table. What are the aggregate and scalar functions? Answer: Aggregate functions are used to evaluate mathematical calculation and return a single value. These calculations are done from the columns in a table. For example- max ,count are calculated with respect to numeric. Scalar functions return a single value based on the input value. For example — UCASE , NOW is calculated with respect to a string. What is a Stored Procedure? Answer: A Stored Procedure is a function which consists of many SQL statements to access the database system.
Several SQL statements are consolidated into a stored procedure and execute them whenever and wherever required which saves time and avoid writing code again and again. List some advantages and disadvantages of Stored Procedure? Answer: Advantages : A Stored Procedure can be used as modular programming which means create once, store and call for several times whenever it is required. This supports faster execution. It also reduces network traffic and provides better security to the data. Disadvantage: The only disadvantage of Stored Procedure is that it can be executed only in the database and utilizes more memory in the database server.
What do you mean by Collation? Answer: Collation is defined as a set of rules that determine how data can be sorted as well as compared. Character data is sorted using the rules that define the correct character sequence along with options for specifying case- sensitivity , character width, etc. What are the different types of Collation Sensitivity? Answer: Following are the different types of collation sensitivity:. Width Sensitivity: Single byte character and double-byte character. Accent Sensitivity. Apart from this SQL Interview Questions Blog, if you want to get trained from professionals on this technology, you can opt for structured training from SVR.
What are the different authentication modes in SQL Server? How can it be changed? Answer: Windows mode and Mixed Mode — SQL and Windows. Then select the server from the Tools menu. Select SQL Server Configuration Properties, and choose the Security page. What is a Data warehouse? Answer: Datawarehouse refers to a central repository of data where the data is assembled from multiple sources of information. Those data are consolidated, transformed and made available for the mining as well as online processing. Warehouse data also have a subset of data called Data Marts. What are Local and Global variables?
Answer: Local variables: These variables can be used or exist only inside the function. These variables are not used or referred by any other function. Global variables: These variables are the variables which can be accessed throughout the program. Global variables cannot be created whenever that function is called. How can you fetch alternate records from a table? Answer: You can fetch alternate records i. e both odd and even row numbers. When are we going to use truncate and delete? Answer: TRUNCATE is a DDL command, whereas DELETE is a DML command. TRUNCATE is quicker than DELETE, for the reason that when we use DELETE to delete the data, at that time it stores the whole statistics in the rollback gap on or after where we can get the data back after removal.
In the case of TRUNCATE, it will not store data in rollback gap and will unswervingly rub it out. TRUNCATE do not recover the deleted data. We can use any condition in WHERE clause using DELETE but it is not possible with TRUNCATE. Go through this SQL tutorial to learn more about SQL commands. What is the SQL CASE statement used for? Explain with an example? Answer: It allows you to embed an if-else like a clause in the SELECT clause. How do you maintain database integrity where deletions from one table will automatically cause deletions in another table?
Answer: You can create a trigger that will automatically delete elements in the second table when elements from the first table are removed. How to find the second highest salary of an Employee? Answer: There are many ways to find the second highest salary of Employees in SQ. You can either use SQL Join or Subquery to solve this problem. When is the Explicit Cursor Used? Answer: If the developer needs to perform the row by row operations for the result set containing more than one row, then he unambiguously declares a pointer with a name. They are managed by OPEN, FETCH and CLOSE. Explain correlated query work? First, a row is processed in the outer doubt. Then, for that exacting row, the subquery is executed — as a result for each row processed by the outer query, the subquery will also be processed.
Salary and run. Answer: This command is used, ones the processing of large data is done. What is a Subquery? Answer: A Subquery is a SQL query within another query. It is a subset of a Select statement whose return values are used in filtering the conditions of the main query. What are SQL constraints? Answer: SQL constraints are the set of rules that impose some restriction while insertion, deletion or updation of data in the databases. In SQL we have both column level as well as table level constraints which are applied at columns and tables respectively. Some of constraints in SQL are — Primary Key, Foreign Key, Unique Key, Not NULL, DEFAULT, CHECK and Index constraint. What are the different DCL commands in SQL? Answer: DCL commands are used to create roles, grant permission and control access to the database objects.
GRANT: To provide user access DENY : To deny permissions to users REVOKE: To remove user access. What is a Primary Key? Answer: A primary key is a column or a combination of columns which uniquely identifies a record in the database. A primary key can only have unique and not NULL values and there can be only one primary key in a table. How to add code to the existing article Using Improve Article? Answer : Recursive Practice Problems with Solutions Run Levels in Linux. Explain Boyce and Codd Normal Form BCNF? Answer: BCNF is the advanced or stricter version of 3NF. Explain the First Normal Form 1NF? Answer: According to First Normal Form, a column cannot have multiple values, each value in the columns must be atomic. What are scalar functions in SQL? Answer: Scalar functions are the functions that return a single value by processing a single value in SQL.
What are the properties of the transaction? Answer: Properties of the transaction are known as ACID properties, such as Atomicity: Ensures the completeness of all transactions performed. Checks whether every transaction is completed successfully if not then transaction is aborted at the failure point and the previous transaction is rolled back to its initial state as changes undone Consistency: Ensures that all changes made through successful transaction are reflected properly on database Isolation: Ensures that all transactions are performed independently and changes made by one transaction are not reflected on other Durability: Ensures that the changes made in the database with committed transactions persist as it is even after a system failure. Explain SQL Data Types? Answer: In SQL Server, each column in a database table has a name and a data type. We need to decide what type of data to store inside each and every column of a table while creating a SQL table. Explain the working of SQL Privileges?
Answer: SQL GRANT and REVOKE commands are used to implement privileges in SQL multiple user environments. The administrator of the database can grant or revoke privileges to or from users of database object like SELECT, INSERT, UPDATE, DELETE, ALL, etc. GRANT Command: This command is used to provide database access to user apart from an administrator. REVOKE command: This command is used to provide database deny or remove access to database objects. Difference between TRUNCATE, DELETE and DROP commands? Answer: DELETE removes some or all rows from a table based on the condition. It can be rolled back. TRUNCATE removes ALL rows from a table by de-allocating the memory pages. The operation cannot be rolled back DROP command removes a table from the database completely. What is Referential Integrity? Answer: Set of rules that restrict the values of one or more columns of the tables based on the values of the primary key or unique key of the referenced table.
Answer: BETWEEN operator is used to displaying rows based on a range of values in a row whereas the IN condition operator is used to check for values contained in a specific set of values. Why are SQL functions used? Answer: SQL functions are used for the following purposes: To perform some calculations on the data To modify individual data items To manipulate the output To format dates and numbers To convert the data types. What do you mean by recursive stored procedure? Answer: Recursive stored procedure refers to a stored procedure which calls by itself until it reaches some boundary condition.
This recursive function or procedure helps the programmers to use the same set of code n number of times. Answer: HAVING clause can be used only with SELECT statement. It is usually used in a GROUP BY clause and whenever GROUP BY is not used, HAVING behaves like a WHERE clause. Having Clause is only used with the GROUP BY function in a query whereas WHERE Clause is applied to each row before they are a part of the GROUP BY function in a query. List some case manipulation functions in SQL? Answer: There are three case manipulation functions in SQL, namely: LOWER: This function returns the string in lowercase.
It takes a string as an argument and returns it by converting it into lower case. It takes a string as an argument and returns it by converting it into uppercase. Click below to know more. What is an ALIAS command? Answer: ALIAS name can be given to any table or a column. This alias name can be referred in WHERE clause to identify a particular table or a column. For example- Select emp. empID, dept. Result from employee emp, department as dept where emp. empID In the above example, emp refers to alias name for employee table and dept refers to alias name for department table. What are the aggregate and scalar functions? Answer: Aggregate functions are used to evaluate mathematical calculation and return a single value. These calculations are done from the columns in a table.
For example- max ,count are calculated with respect to numeric. Scalar functions return a single value based on the input value. For example — UCASE , NOW is calculated with respect to a string. What is a Stored Procedure? Answer: A Stored Procedure is a function which consists of many SQL statements to access the database system. Several SQL statements are consolidated into a stored procedure and execute them whenever and wherever required which saves time and avoid writing code again and again. List some advantages and disadvantages of Stored Procedure?
Answer: Advantages : A Stored Procedure can be used as modular programming which means create once, store and call for several times whenever it is required. This supports faster execution. It also reduces network traffic and provides better security to the data. Disadvantage: The only disadvantage of Stored Procedure is that it can be executed only in the database and utilizes more memory in the database server. What do you mean by Collation? Answer: Collation is defined as a set of rules that determine how data can be sorted as well as compared. Character data is sorted using the rules that define the correct character sequence along with options for specifying case- sensitivity , character width, etc. What are the different types of Collation Sensitivity?
Answer: Following are the different types of collation sensitivity:. Width Sensitivity: Single byte character and double-byte character. Accent Sensitivity. Apart from this SQL Interview Questions Blog, if you want to get trained from professionals on this technology, you can opt for structured training from SVR. What are the different authentication modes in SQL Server? How can it be changed? Answer: Windows mode and Mixed Mode — SQL and Windows. Then select the server from the Tools menu. Select SQL Server Configuration Properties, and choose the Security page. What is a Data warehouse? Answer: Datawarehouse refers to a central repository of data where the data is assembled from multiple sources of information.
Those data are consolidated, transformed and made available for the mining as well as online processing. Warehouse data also have a subset of data called Data Marts. What are Local and Global variables? Answer: Local variables: These variables can be used or exist only inside the function. These variables are not used or referred by any other function. Global variables: These variables are the variables which can be accessed throughout the program. Global variables cannot be created whenever that function is called. How can you fetch alternate records from a table? Answer: You can fetch alternate records i. e both odd and even row numbers. When are we going to use truncate and delete? Answer: TRUNCATE is a DDL command, whereas DELETE is a DML command. TRUNCATE is quicker than DELETE, for the reason that when we use DELETE to delete the data, at that time it stores the whole statistics in the rollback gap on or after where we can get the data back after removal.
In the case of TRUNCATE, it will not store data in rollback gap and will unswervingly rub it out. TRUNCATE do not recover the deleted data. We can use any condition in WHERE clause using DELETE but it is not possible with TRUNCATE. Go through this SQL tutorial to learn more about SQL commands. What is the SQL CASE statement used for? Explain with an example? Answer: It allows you to embed an if-else like a clause in the SELECT clause. How do you maintain database integrity where deletions from one table will automatically cause deletions in another table? Answer: You can create a trigger that will automatically delete elements in the second table when elements from the first table are removed. How to find the second highest salary of an Employee? Answer: There are many ways to find the second highest salary of Employees in SQ. You can either use SQL Join or Subquery to solve this problem. When is the Explicit Cursor Used? Answer: If the developer needs to perform the row by row operations for the result set containing more than one row, then he unambiguously declares a pointer with a name.
They are managed by OPEN, FETCH and CLOSE. Explain correlated query work? First, a row is processed in the outer doubt. Then, for that exacting row, the subquery is executed — as a result for each row processed by the outer query, the subquery will also be processed.
Basic SQL Interview Questions And Answers Pdf,Welcome to Interviewbit, help us create the best experience for you!
A model free from all modification anomalies. Remember, these normalization guidelines are cumulative. For a database to be in 3NF, it must first fulfill all the criteria of a 2NF and 1NF 14/06/ · Most modern database management systems like MySQL, Microsoft SQL Server, Oracle, IBM DB2, and Amazon Redshift are based on RDBMS. You can download a PDF Question # 27 What are SQL Data types? Answer: Max. columns in a table is Max. Char size is , Long is 64K & Number is 38 digits. Cannot Query on a long column. Char, Download Sql Interview Questions PDF/ePub or read online books in Mobi eBooks. Click Download or Read Online button to get Sql Interview Questions book now. This site is like a We provides you SQL Query Interview Questions pdf with example, SQL Interview, for fresher and experience, SQL Queries Interview Questions pdf for free download and SQL SQL Interview Questions and Answers PDF Download for Oracle, MySQL, AWS Redshift, Google BigQuery, Snowflake, PostgreSQL, MariaDB, IBM DB2, Sybase, SQL Server and ... read more
An aggregate function performs operations on a collection of values to return a single scalar value. This holds read and write locks for all rows it operates on. The client can either be GUI Graphical User Interface or a web application. For more information, you can refer here. Results are shown in descending order. However, the table definition remains with the database for access when database is opened next time.
com 5 © Copyright Pinal Dave. Answer: A Subquery is a SQL query within another query. The primary key constraints are used to enforce entity integrity. Information Technology. Hence, SQL prepares the new table with a duplicate structure to sql interview questions pdf free download the fetched records but since no records get fetched due to the WHERE clause in action, nothing is inserted into the new table. At any given time, only one copy of the database is currently available to clients which are known as the principal database. Unlock the complete InterviewBit experience for free.
No comments:
Post a Comment