Select one student occurrence by identity
Easysql
Learn the Concept: EntityReturn studentid and studentname for student_id 17. Do not match by name or screen position.
MySQL dialect.
sqlCREATE 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.
Example 1
Input
INSERT INTO students VALUES (2,'Asha'),(17,'Asha');
Output
student_id student_name 17 Asha
Explanation: The lookup follows the recorded occurrence identity without assuming unique names. This is a SQL mapping demonstration, not external identity verification.
- Identifiers represent distinct recorded students; names can repeat.
Hint 1
Use the identifying predicate.
Hint 2
Select the identity alongside the description.
The lookup follows the recorded occurrence identity without assuming unique names. This is a SQL mapping demonstration, not external identity verification.
The lookup follows the recorded occurrence identity without assuming unique names. This is a SQL mapping demonstration, not external identity verification.
Submit an attempt to unlock the solution. (Sign in first.)
Related Problems
- Preserve student occurrences with zero participationMedium · sqlSolve Problem
- Create a disposable database with explicit text defaultsEasy · sqlSolve Problem
- List immediate lab childrenEasy · sqlSolve Problem