What is the usage of SQL functions?

Functions are the measured values and cannot create permanent environment changes to SQL server. SQL functions are used for the following purpose: To perform calculations on data To modify individual data items To manipulate the output To format dates and numbers To convert data types The usage of SQL functions in a database is to … Read more

What is the difference between NULL value, zero and blank space?

A NULL value is not the same as zero or a blank space. A NULL value is a value which is ‘unavailable, unassigned, unknown or not applicable.’ On the other hand, zero is a number, and a blank space is treated as a character. The NULL value can be treated as unknown and missing value … Read more

What is ACID property in a database?

ACID property is used to ensure that the data transactions are processed reliably in a database system. A single logical operation of a data is called transaction. ACID is an acronym for Atomicity, Consistency, Isolation, Durability. Atomicity: it requires that each transaction is all or nothing. It means if one part of the transaction fails, … Read more

Write an SQL query to get the third maximum salary of an employee from a table named employee_table.

SELECT TOP 1 salary FROM ( SELECT TOP 3 salary FROM employee_table ORDER BY salary DESC ) AS emp ORDER BY salary ASC; Certainly! To retrieve the third maximum salary from the employee_table, you can use the following SQL query: SELECT DISTINCT salary FROM employee_table ORDER BY salary DESC LIMIT 2, 1; Explanation: ORDER BY … Read more

Write an SQL query to find names of employee start with ‘A’?

SELECT * FROM Employees WHERE EmpName like ‘A%’ Certainly! To find the names of employees whose names start with ‘A’ in an SQL database, you can use the SELECT statement with the LIKE clause. Here’s an example query: SELECT employee_name FROM employees WHERE employee_name LIKE ‘A%’; In this query: SELECT employee_name specifies the column you … Read more