DEV Community

Ramya .C
Ramya .C

Posted on

Day 14 of My Data Analytics Journey !

Today’s Learning:

  • Installed MySQL for database management.
  • Solved The Minion Game challenge on HackerRank in Python.

1️⃣ Installing MySQL

MySQL is one of the most popular relational database management systems. Today, I learned how to install it on my system to start practicing SQL queries for Data Analytics.

Steps I followed:

  1. Downloaded MySQL Community Edition from the official MySQL website.
  2. Installed MySQL Server and MySQL Workbench.
  3. Configured root username and password.
  4. Verified the installation by running:
mysql --version
Enter fullscreen mode Exit fullscreen mode
  1. Opened MySQL Workbench and successfully connected to my local server.

✅ Now I’m ready to write and execute SQL queries directly in MySQL Workbench.


2️⃣ HackerRank Challenge – The Minion Game 🐝

The Minion Game is a fun string-based game where two players, Kevin and Stuart, compete based on vowels and consonants in a given word.

Rules:

  • Kevin gets points for substrings starting with vowels.
  • Stuart gets points for substrings starting with consonants.

Python Solution:

def minion_game(string):
    vowels = 'AEIOU'
    kevin_score = 0
    stuart_score = 0
    length = len(string)

    for i in range(length):
        if string[i] in vowels:
            kevin_score += length - i
        else:
            stuart_score += length - i

    if kevin_score > stuart_score:
        print("Kevin", kevin_score)
    elif stuart_score > kevin_score:
        print("Stuart", stuart_score)
    else:
        print("Draw")

# Example
minion_game("BANANA")
Enter fullscreen mode Exit fullscreen mode

Step-by-step logic:

  1. Identify vowels – If the current letter is a vowel, Kevin gets points.
  2. Points calculation – Number of substrings starting at position i is length - i.
  3. Score comparison – After looping, compare Kevin’s and Stuart’s scores.

Output for BANANA:

Stuart 12
Enter fullscreen mode Exit fullscreen mode

💡 Today’s Takeaway:

  • Installing MySQL is the first step toward mastering databases in Data Analytics.
  • String problems like the Minion Game help improve Python logic, which is essential for data processing.

Top comments (0)