Complex SQL Interview Question | Coding Challenges | SQL Analytical Functions

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ก.ย. 2024
  • In this video we will solve a complex sql interview question.
    Question:
    Julia asked her students to create some coding challenges. Write a query to print the hacker_id, name, and the total number of challenges created by each student. Sort your results by the total number of challenges in descending order. If more than one student created the same number of challenges, then sort the result by hacker_id. If more than one student created the same number of challenges and the count is less than the maximum number of challenges created, then exclude those students from the result.
    Table Script:
    create table hackers(
    hacker_id int,
    name varchar(20)
    )
    create table challenges(
    challenge_id int,
    hacker_id int
    )
    insert into hackers(hacker_id, name)
    values(12299,'rose'),(34856,'angela'),(79345,'frank'),
    (80491,'patrick'),(81041,'lisa'),(70978,'john')
    insert into challenges(challenge_id, hacker_id)
    values(63963,81041),(63117,79345),(28225,34856),
    (21989,12299),(4653,12299),(70070,79345),
    (36905,34856),(61136,80491),(17234,12299),
    (80308,79345),(40510,34856),(79820,80491),
    (22720,12299),(21394,12299),(36261,34856),
    (15334,12299),(71435,79345),(23157,34856),
    (54102,34856),(69065,80491),(63953,70978),
    (63127,70978),(28105,70978),(11129,70978)
    🔍 Looking for something specific? Check out my curated playlists.
    ✅Complex SQL Interview Questions
    • Complex SQL Interview ...
    ✅SQL Interview Questions
    • SQL Interview Bootcamp...
    ✅SQL Mastery Interview Prep
    • SQL Concepts: Detailed...
    ✅Learn SQL Concepts
    • SQL Fundamentals: Key ...
    ✅SQL Functions
    • SQL Functions Explaine...
    Don't forget to hit the subscribe button and ring the notification bell to never miss an update! Become a valued member of our passionate community and be part of the journey with me!
    Thanks for watching, and see you in the next video!" 🚀
    #sqlinterview #sqlinterviewquestionsandanswers #sql #sqlforbeginners #sqlserver

ความคิดเห็น • 1