IBM Data Engineer SQL Interview Question (Hacker Rank Online Test)

Поділитися
Вставка
  • Опубліковано 17 січ 2025

КОМЕНТАРІ • 60

  • @ankitbansal6
    @ankitbansal6  8 місяців тому +14

    **correction** : For the first solution it will be

  • @dfkgjdflkg
    @dfkgjdflkg 8 місяців тому +3

    you never cease to impress me. Thanks for your work!

  • @jawakar8266
    @jawakar8266 7 місяців тому +8

    I never knew we can join based on a range condition, thank you for teachings!

  • @prakritigupta3477
    @prakritigupta3477 8 місяців тому +3

    I also managed to solve the question:
    with cte as (select e.name as family_person, e.family_size,w.name as country_name, w.min_size,w.max_size
    from families as e, countries as w
    where e.family_size>=w.min_size and e.family_size

  • @meropahad7537
    @meropahad7537 8 місяців тому +2

    Thanks Ankit😊. Can you please make a video with example to show difference between schema and database. These two are quite confusing and most of the time I see people using them interchangeably.

  • @atharvaathalye
    @atharvaathalye 4 місяці тому +1

    When does ibm get back after the interview??

  • @nithyabandla9289
    @nithyabandla9289 4 місяці тому +3

    Actually i have completed the coding assessment with all test cases passed for data engineer role on 2nd August but still i don't get any update
    Can u tell me sir when will i get the update

    • @aneesahmed4564
      @aneesahmed4564 4 місяці тому

      Congratulations on completing the assessment, I hope you’ll get the offer letter soon. By the way can you tell me what are the topics given in assessment? If possible questions 😅. Also you applied as fresher / experienced professional?

    • @itzkarthik8431
      @itzkarthik8431 2 місяці тому

      Did u got any update?

  • @sravankumar1767
    @sravankumar1767 8 місяців тому +1

    Superb explanation Ankit 👌 👏 👍

  • @saramostafaa01
    @saramostafaa01 Місяць тому

    Thank you

  • @Tollybuff
    @Tollybuff 8 місяців тому +1

    What is selection process

  • @vinothkumars7421
    @vinothkumars7421 5 місяців тому

    very intersting one

  • @Aashritha-x2t
    @Aashritha-x2t 14 днів тому

    When will be results announced

  • @kumarvummadi3772
    @kumarvummadi3772 8 місяців тому

    Please do a video on except operator in SQL

  • @kohinoorsuthar5808
    @kohinoorsuthar5808 5 місяців тому

    Are the questions same for every test?

  • @shiva_exploring_world
    @shiva_exploring_world 8 місяців тому

    Thank alot for this 😊

  • @o-gr8ty
    @o-gr8ty 4 місяці тому

    Was this IBM Data Engineer role for Google Cloud Platform tools?

  • @parmoddhiman678
    @parmoddhiman678 5 місяців тому +1

    with cte as (SELECT f.NAME,count(1)
    FROM families f
    join countries c
    on FAMILY_SIZE between MIN_SIZE and MAX_SIZE
    group by 1
    order by 2 desc
    limit 1)
    select name from cte

  • @deaspirant
    @deaspirant 8 місяців тому

    Hi Ankit, i purchased your sql and python course can you provide resources to learn pyspark

  • @sankarsarms
    @sankarsarms 8 місяців тому +1

    what is the equivalent function for julianday in sql server and Ms sql

  • @akashgoel601
    @akashgoel601 4 місяці тому

    thanks, my sol. on similar line of code:
    with cte as (
    select f.family_size,count(c.min_size) as cnt
    from families f join countries c on c.min_size=f.family_size
    group by family_size
    )
    select family_size
    from cte
    where cnt in (select max(cnt) from cte)
    order by 1 desc

  • @rajbalachauhan7848
    @rajbalachauhan7848 5 місяців тому +1

    Did anyone appear for hackerearth test for Data Engineer position in IBM ? what kind of questions they're looking for other than SQL?

    • @shreeya7988
      @shreeya7988 4 місяці тому

      Hey do you come to the conclusion? What type of questions are there DSA or SQL or both?

  • @Mathematica1729
    @Mathematica1729 8 місяців тому

    Good and easy question.

  • @akashjha7277
    @akashjha7277 8 місяців тому

    Great ❤

  • @Viralvlogvideos
    @Viralvlogvideos 8 місяців тому

    I know very basic sql I want to learn joins and other import concepts with handson how to ?

    • @ankitbansal6
      @ankitbansal6  8 місяців тому

      www.namastesql.com/course-detail/think-sql-go-from-zero-to-hero-english

  • @harishmahale7180
    @harishmahale7180 8 місяців тому

    select max(cnt) from
    (SELECT name,COUNT(TOUR) as cnt from
    (select F.name,F.FAMILY_SIZE, C.MIN_SIZE,C.MAX_SIZE,
    CASE WHEN F.FAMILY_SIZE BETWEEN C.MIN_SIZE AND C.MAX_SIZE THEN F.NAME END AS TOUR
    from FAMILIES F,COUNTRIES_1 C )
    GROUP BY name)

  • @shanthiadhuri
    @shanthiadhuri 5 місяців тому

    Is there is only SQL coding For Data engineer role .
    Please respond .

    • @sayaninandi2190
      @sayaninandi2190 4 місяці тому

      No, also coding question is there.

    • @shreeya7988
      @shreeya7988 4 місяці тому

      Hey! May I know what kind of questions are there.. like any coding questions from language or DSA or SQL..

  • @Apna_tahlka_123
    @Apna_tahlka_123 8 місяців тому

    One question is plj tell me if I learn only SQL can I got job or not

  • @GowthamR-ro2pt
    @GowthamR-ro2pt 8 місяців тому

    Hi Ankit 😊, I have an approach for the original question (Hacker Rank):
    with cte as (select F.NAME Family,C.NAME Country,F.FAMILY_SIZE,C.MIN_SIZE from FAMILIES F
    INNER JOIN COUNTRIES C
    ON F.FAMILY_SIZE >= C.MIN_SIZE)
    select Family,count(*) Eligible
    from cte
    group by Family
    order by Eligible desc
    Correct me if I am wrong.....

  • @AmanRaj-p8w
    @AmanRaj-p8w 8 місяців тому

    Mysql solution with country name: with cte as (
    select f.id as fam_id, f.name as fam_name , family_size, c.id as country_id, c.name as c_name, c.min_size, max_size from families as f
    cross join countries as c
    where min_size

  • @MuskanGoyal-db7cs
    @MuskanGoyal-db7cs Місяць тому

    with cte as(
    select f.id, f.name as fname ,c.name as cname, c.min_size, c.max_size, f.family_size
    from countries c join families f
    where f.family_size>=c.min_size and f.family_size

  • @kedarwalavalkar6861
    @kedarwalavalkar6861 8 місяців тому

    my solution:

    with families_qualified_for_discount as (
    select f.name as person_name, c.name as country_name
    from families f
    join countries c
    on f.family_size BETWEEN c.MIN_SIZE and c.MAX_SIZE
    )
    select count(country_name) as total_countries_where_qualified_for_discount
    from families_qualified_for_discount
    group by person_name
    order by count(country_name) desc
    limit 1;

  • @Tollybuff
    @Tollybuff 8 місяців тому

    Anybody written exam

  • @prakritigupta3477
    @prakritigupta3477 8 місяців тому

    Please verify my solutions as well: "with cte as (select e1.name as family_person, e1.family_size, e2.name as country_name,e2.max_size,e2.min_size
    from families as e1, countries as e2 where e1.family_size>=e2.min_size or e1.family_size

  • @YatriSpecial
    @YatriSpecial 8 місяців тому

    Range join

  • @rahulmehla2014
    @rahulmehla2014 8 місяців тому

    my approach :
    with cte as(
    select f.name,
    f.family_size,c.min_size,
    case when f.family_size >= c.min_size and f.family_Size

  • @sandeepanand3834
    @sandeepanand3834 5 місяців тому

    To show country name also we can use below:
    select f.NAME as custo_name, count(*) as cnt,
    group_concat(c.NAME order by c.NAME) country_customer_can_go
    from COUNTRIES c join FAMILIES f
    on f.FAMILY_SIZE between c.MIN_SIZE and c.MAX_SIZE
    group by f.NAME
    order by count(*) desc limit 1;

  • @vikas261196
    @vikas261196 8 місяців тому

    I'm using this approach. please correct me if I'm wrong. I didn't look at the solution as I was trying to solve it by myself
    WITH CTE AS (
    SELECT family.id, family.name AS family_name, family_size, countries.country, countries.min_size
    FROM family
    JOIN countries ON family_size >= min_size
    )
    SELECT family_name, COUNT(family_name) AS total_discounted_trip
    FROM CTE
    GROUP BY family_name;

  • @MrGaurav331
    @MrGaurav331 7 місяців тому

    with cte as (
    SELECT
    FAMILIES.name as name,
    family_size,
    COUNTRIES.NAME as country_name
    from FAMILIES left join COUNTRIES
    where
    FAMILIES.FAMILY_SIZE BETWEEN COUNTRIES.MIN_SIZE and COUNTRIES.MAX_SIZE
    )
    SELECT
    name,
    count(country_name) as country_count
    from cte
    group by 1

  • @HARSHRAJ-wz2rp
    @HARSHRAJ-wz2rp 4 місяці тому

    IBM DATE ENGINNER SQL SOLUTION:-
    with cte as(
    select FAMILY_SIZE FROM Families
    ),
    cte1 as(
    select MIN_SIZE FROM COUNTRIES
    ),cte2 as(
    select * FROM cte CROSS JOIN cte1
    ),cte3 as(
    select FAMILY_SIZE,COUNT(*) as count1 FROM cte2 where FAMILY_SIZE>=MIN_SIZE GROUP BY FAMILY_SIZE
    ORDER BY COUNT(*) DESC LIMIT 1
    )
    select count1 FROM cte3;
    2nd queston solution:-
    with cte as(
    select FAMILIES.FAMILY_SIZE,MIN_SIZE,MAX_SIZE FROM FAMILIES JOIN COUNTRIES ON FAMILIES.FAMILY_SIZE
    BETWEEN COUNTRIES.MIN_SIZE AND COUNTRIES.MAX_SIZE
    ),CTE1 AS(
    select FAMILY_SIZE,COUNT(*) as x1 FROM cte where FAMILY_SIZE BETWEEN MIN_SIZE AND MAX_SIZE GROUP by
    FAMILY_SIZE ORDER BY x1 DESC LIMIT 1
    )
    select x1 FROM CTE1;

    • @rupalakshmiprasanna2418
      @rupalakshmiprasanna2418 4 місяці тому

      Hii...Have you completed ur coding round recently?
      If yes, How many questions are there?

  • @DataAnalyst251
    @DataAnalyst251 8 місяців тому

    output with family name too:
    with cte1 as (select FAMILIES.NAME, COUNT(*) pt from FAMILIES join COUNTRIES
    on FAMILIES.FAMILY_SIZE between COUNTRIES.MIN_SIZE and COUNTRIES.MAX_SIZE
    group by FAMILIES.NAME)
    select name,pt from cte1 where pt = (select max(pt) from cte1);