0 votes
in Ruby by
If a database table of users contains the following rows, and id is the primary key, which statement would return only an object whose last_name is "Cordero"?

-------------------------------

| id | first_name | last_name |

|----|------------|-----------|

| 1  | Alice      | Anderson  |

| 2  | Bob        | Buckner   |

| 3  | Carrie     | Cordero   |

| 4  | Devon      | Dupre     |

| 5  | Carrie     | Eastman   |

-------------------------------

 a. User.where(first_name: "Carrie")

 b. User.not.where(id: [1, 2, 4, 5])

 c. User.find_by(first_name: "Cordero")

 d. User.find(3)

1 Answer

0 votes
by
Correct answer is :-  User.find(3)

Related questions

0 votes
asked Aug 26, 2022 in Ruby by Robin
0 votes
asked Jun 4, 2020 in Data Handling by SakshiSharma
...