DEV Community

loading...

Day 60 Of 100DaysOfCode: Intermediate SQL

iamdurga profile image Durga Pokharel ・1 min read

Today is my 60th day of #100DaysOfcode and #python learning. Today I learned intermediate SQL( CASE statement) from Datacamp. Also had taken video lecture of Algorithmic toolbox from Coursera

SQL CASE Statement

SELECT 
    season,
    date,
    home_goal,
    away_goal
FROM matches_italy
WHERE 

    CASE WHEN hometeam_id = 9857 AND home_goal > away_goal THEN 'Bologna Win'
        WHEN awayteam_id = 9857 AND away_goal > home_goal THEN 'Bologna Win' 
        END IS NOT NULL;
Enter fullscreen mode Exit fullscreen mode

Discussion (0)

pic
Editor guide