SQL Exercises: Show all the details of the winners with the first name Louis
SQL Basic Select Statement: Exercise-18 with Solution.
From the following table, write a SQL query to retrieve the details of the winners whose first names match with the string ‘Louis’. Return year, subject, winner, country, and category.
Sample table: nobel_win
Sample Solution:
SELECT *
FROM nobel_win
WHERE winner LIKE 'Louis %';
Output of the Query:
year subject winner country category 1970 Physics Louis Neel France Scientist
Code Explanation:
The said SQL query retrieves all columns from the 'nobel_win' table where the winner's name starts with "Louis" followed by any characters. The query will return all rows that match this criteria, resulting in a list of all Nobel Prizes awarded to winners whose name starts with "Louis". The LIKE operator is used to match a specific pattern, in this case it will match any name that starts with Louis followed by any characters. The '%' sign is a wildcard character that matches any sequence of characters.
Relational Algebra Expression:
Relational Algebra Tree:
Practice Online
Query Visualization:
Duration:

Rows:

Cost:

Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous Python Exercise: Details of the Prime Ministerial winners after 1972.
Next Python Exercise: All winners in Physics for 1970 and Economics for 1971.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
SQL: Tips of the Day
What is the best way to paginate results in SQL Server?
SELECT * FROM ( SELECT ROW_NUMBER() OVER ( ORDER BY OrderDate ) AS RowNum, * FROM Orders WHERE OrderDate >= '1980-01-01' ) AS RowConstrainedResult WHERE RowNum >= 1 AND RowNum < 20 ORDER BY RowNum
Database: SQL Server
Ref: https://bit.ly/3MGrNlk
- Weekly Trends
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
- JavaScript functions Exercises
- Python Tutorial
- Python Array Exercises
- SQL Cross Join
- C# Sharp Array Exercises
We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook