Skip to content
CampusEduX

Select one student occurrence by identity

Easysql
Learn the Concept: Entity

Return studentid and studentname for student_id 17. Do not match by name or screen position.

MySQL dialect.

sql
CREATE TABLE students (student_id INT PRIMARY KEY, student_name VARCHAR(80) NOT NULL); INSERT INTO students VALUES (2,'Asha'),(17,'Asha');

Required ordering: At most one row.

Edge cases:

  • The desired identity can be absent.
  • Another student can have the same name.

Related Problems

  • Preserve student occurrences with zero participation
    Medium · sql
    Solve Problem
  • Create a disposable database with explicit text defaults
    Easy · sql
    Solve Problem
  • List immediate lab children
    Easy · sql
    Solve Problem

Input (stdin)

Output

Run your code to see output here...