Informatics Practices
In SQL, which function is used to extract a date from a date expression?
- Now()
- Curdate()
- Date()
- Day()
SQL Queries
2 Likes
Answer
Date()
Reason — In SQL, the DATE() function is used to extract the date part of a date or date-time expression.
Answered By
1 Like
Related Questions
Consider a table named Employees with columns — EName, Age, Salary and Designation. Which SQL statement do we use to find out the total salary given to employees?
- Select SUM(Salary) From Employees;
- Select COUNT (*) From Employees;
- Select FIND (*) From Employees;
- Select SUM () From Employees;
Which clause in SQL is used to apply a condition on a group?
- Where
- Having
- As
- On
Assertion (A): COUNT() function ignores distinct values.
Reasoning (R): Distinct clause ignores duplicate values.
- 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): The HAVING clause is used with GROUP BY clause and aggregate functions.
Reasoning (R): WHERE clause specifies the condition on individual rows or records.
- 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.