Skip to content
Advertisement

Name and birthdate for all the students whose first name is between 6 and 9 characters long

CREATE TABLE USER (
    [UserID] 
    [FirstName] 
    [LastName] 
    [BirthDate]

Birthdate for all the students whose first name is between 3 and 5 characters long, and whose last name is longer than their first name?

Advertisement

Answer

Your syntax suggests SQL Server. In that database, you would phrase the query as:

select firstname + ' ' + lastname as fullname, birthdate
from student
where len(firstname) between 6 and 9 and len(lastname) > len(firstname)
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement