96.1k views
4 votes
Limit the query results to records where the students date of birth is less than or equal to them.

User Grimgrom
by
6.2k points

2 Answers

5 votes

Note that in order t carry out the above task, you need to run the following SQL:
SELECT *

FROM students

WHERE DOB <= '1995-01-01';

What is the above query about?

This query will select all columns from the 'Students' table and only return records where the value in the 'Date of Birth' column is less than or equal tothe current date.

Here is a breakdown of the query:

SELECT *: This selects all columns from the 'Students' table.

FROM Students: This specifies the table that you want to query.

WHERE Date of Birth <= CURDATE(): This filters the results to only include records where the value in the 'Date of Birth' column is less than or equal to the current date.

The CURDATE() function returns the current date.



Full Question:

Limit the query results to records where the student's date of birth DOB is less than or equal to January 1, 1995. Run the query to view the results.

User YellowBlue
by
5.6k points
4 votes

Answer:

Follows are the solution to this question:

Explanation:

The following are the steps to solve the query:

  • In this question first, we know about the date of birth. so, we assume that the date of birth "DOB" value is "1-Jan-1998".
  • To check the date of the birth value we must go to the DOB field and set criteria in the row value.
  • To set the criteria, we first changed the date of birth fields by applying the condition that is "DOB <=DOB".
  • The above condition changes the design of the Ribbon Tab, and when we click on the run button it shows the value of the results on the ribbon group.
User Liel
by
5.9k points