174k views
4 votes
With SQL, how do you select all the records from a table named "Persons" where the "LastName" is alphabetically between (and including) "Nguyen" and "Tran"?

Select one:
a. SELECT LastName>'Nguyen' AND LastName<'Tran' FROM Persons
b. SELECT * FROM Persons WHERE LastName>'Nguyen' AND LastName<'Tran'
c. None of the others.
d. SELECT * FROM Persons WHERE LastName BETWEEN 'Nguyen' AND 'Tran'

1 Answer

4 votes

Final answer:

To select records from the 'Persons' table where 'LastName' is between 'Nguyen' and 'Tran', use the SQL statement: SELECT * FROM Persons WHERE LastName BETWEEN 'Nguyen' AND 'Tran'.

Step-by-step explanation:

In SQL, you can select all the records from a table named "Persons" where the "LastName" is alphabetically between (and including) "Nguyen" and "Tran" by using the following query:

SELECT * FROM Persons WHERE LastName BETWEEN 'Nguyen' AND 'Tran'

This query will return all the records with last names starting from "Nguyen" and ending with "Tran" in alphabetical order.

To select all the records from a table named "Persons" where the "LastName" is alphabetically between (and including) "Nguyen" and "Tran", you would use the SQL statement:

SELECT * FROM Persons WHERE LastName BETWEEN 'Nguyen' AND 'Tran'

This SQL command will retrieve all records from the Persons table where the LastName falls within the specified range, including the boundary values 'Nguyen' and 'Tran'.

User LulzCow
by
7.8k points