Informatics Practices
ABC Associates has over 2000 employees on its roll and deals with customer support services. Help the company to perform associated operations for calculating the salaries (stored in Sal column) of their employees and to perform relevant analysis on the fetched data from the SQL database/table.
How can we retrieve records where salary is between 1000 and 2000?
SQL Queries
1 Like
Answer
SELECT * FROM emp
WHERE Sal BETWEEN 1000 AND 2000;
OR
SELECT * FROM emp
WHERE Sal >= 1000 AND Sal <= 2000;
Answered By
1 Like
Related Questions
Assertion (A): GROUP BY clause is always preceded by ORDER BY clause in a SELECT statement.
Reasoning (R): ORDER BY clause always follows other clauses.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Assertion (A): All aggregate functions except count(*) ignore null values in their input collection.
Reasoning (R): SUM, AVG, MIN, and MAX can only be used with numeric columns.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Select all records where dept no of both emp and dept table matches.
If there are two tables emp and emp1, and both have common records, how can we fetch all the records but common records only once?