DEV Community

Cover image for MySQL Labs: Querying Country GNP, Manipulating Personnel Database Dates & Functions
Labby for LabEx

Posted on

MySQL Labs: Querying Country GNP, Manipulating Personnel Database Dates & Functions

Ready to unlock the power of data? The 'MySQL' path on LabEx offers a comprehensive, hands-on journey into the world's most popular open-source relational database. Forget passive learning; our interactive SQL playground lets you get your hands dirty from day one. This path is meticulously designed for beginners, guiding you through SQL fundamentals, database design, and administration with practical, non-video courses. Let's explore some of the key labs that will transform you from a database novice to a confident MySQL user.

Country GNP and Population Query

Country GNP and Population Query

Difficulty: Beginner | Time: 5 minutes

In this challenge, we will work with the country table and implement a single row subquery operation. The task is to query the GNP and population of countries that have a higher GNP than France. The resulting table should contain the country name, GNP and population.

Practice on LabEx → | Tutorial →

Manipulating Dates in Personnel Database

Manipulating Dates in Personnel Database

Difficulty: Beginner | Time: 5 minutes

In this challenge, we will work with MySQL's common conversion functions to retrieve information from the emp table in the personnel database. We will implement functions like DATE_FORMAT and STR_TO_DATE() to manipulate and format dates in a desired output format. Our objective is to display the initial entry date and the corrected date for all employees in the department while adhering to specific formatting and ordering guidelines.

Practice on LabEx → | Tutorial →

Accessing MySQL Database and Querying GNP

Accessing MySQL Database and Querying GNP

Difficulty: Beginner | Time: 5 minutes

In this challenge we will query the Gross National Product (GNP) of all countries using the corresponding data table in the world database. The process involves importing the world database, scripting a query to obtain the GNP values, and demonstrating the result along with the Name and GNP attributes.

Practice on LabEx → | Tutorial →

MySQL Basic Functions Challenge

MySQL Basic Functions Challenge

Difficulty: Beginner | Time: 5 minutes

In this task, we'll utilize MySQL's built-in functions such as DATEDIFF, REVERSE, and ROUND to retrieve data from the emp table within the personnel database. The objective is to compute and present the per-day earnings and names of all employees, as well as the total number of days they have worked through January 1, 2022. This script file should be saved as BasicFunctions.sql in the /home/labex/project directory.

Practice on LabEx → | Tutorial →

Comprehensive SQL Query Challenge

Comprehensive SQL Query Challenge

Difficulty: Beginner | Time: 5 minutes

In this challenge, we will use the emp table in the personnel database to write SQL queries and extract targeted data. Our tasks will include querying job information, retrieving name and doubling salary, and displaying employee number, name, and department number with customized attribute names. We must save the queries in a script file named answer.sql in the /home/labex/project directory.

Practice on LabEx → | Tutorial →

These hands-on labs are just the beginning. Each challenge builds foundational skills, preparing you for more complex database tasks. Dive in, experiment, and watch your MySQL proficiency grow. The best way to learn is by doing, and these labs provide the perfect environment to master real-world database operations.

Top comments (0)