Retrieve Every Student Record
Updated
Problem statement
For this exercise, assume a table students with columns student_id and student_name. The ID is unique; a name may be NULL.
Write a query that returns every row with exactly these two columns in this order: student_id, student_name. Do not filter rows, combine records, or remove students who share the same name. Preserve NULL values. Any row order is accepted.
Table schema
MySQLPostgreSQLPandas
Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.
students
An authored practice roster for a basic retrieval query.
| Column | Type | Nullable | Description |
|---|---|---|---|
| student_idPK | Integer | No | — |
| student_name | Text | Yes | — |
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| student_id | Integer | No | — |
| student_name | Text | Yes | — |
Row order: any order is accepted. Numeric tolerance: 0.
Constraints
- The students table contains between 0 and 10000 rows.
- student_id is a unique non-null integer.
- student_name is text and may be NULL.
More LSEG interview questions
- Recover the Initial Mango PileONSITE INTERVIEW · Seen Jul 2025
- Implement Stack Push and Pop OperationsONSITE INTERVIEW · Seen Feb 2025
- Count Times Using at Most Two DigitsOA · Seen Jul 2025
- Maximum Sum of Exactly Three Non-Adjacent ElementsOA · Seen Jul 2025
- Maximum Word Count in a SentenceOA · Seen Jul 2025
- Minimum Digit Swaps for the Smallest DifferenceOA · Seen Jul 2025
- Smallest String After at Most One DeletionOA · Seen Jul 2025
- Delete One Digit 5 to Maximize the NumberOA · Seen Feb 2025
- Three-Part Partition with Minimum Largest RangeOA · Seen Feb 2025
- Transform a String with at Most One OperationOA · Seen Feb 2025
Similar questions at other companies
- Delete Duplicate Employee RecordsInfosys · ONSITE INTERVIEWInfosys interview questions
- Records Created or Updated in a Time WindowPelatro · ONSITE INTERVIEW
- Top Ten Employee SalariesSolytics Partners · ONSITE INTERVIEW
- Latest New JobSphere · ONSITE INTERVIEW
- Employees Whose Manager Left the CompanyZS · ONSITE INTERVIEWZS interview questions
- Employees Above Average SalaryJP Morgan Chase · ONSITE INTERVIEWJP Morgan Chase interview questions
- Combine Winner and Loser NamesAmazon · ONSITE INTERVIEW
- Conditionally Insert or Update RecordsKlaviyo · ONSITE INTERVIEWKlaviyo interview questions
- Employees with Matching DepartmentsAMD · ONSITE INTERVIEWAMD interview questions
- New-User Devices That Opened an AppMicrosoft · ONSITE INTERVIEWMicrosoft interview questions