Change Default Value for Countrylanguage Table

Beginner

In this project, you will learn how to change the default value of a field in a MySQL database table. Specifically, you will be modifying the `IsOfficial` field in the `countrylanguage` table of the `world` database.

SQLMySQL

Introduction

In this project, you will learn how to change the default value of a field in a MySQL database table. Specifically, you will be modifying the IsOfficial field in the countrylanguage table of the world database.

👀 Preview

MariaDB [world]> DESC countrylanguage;
+-------------+---------------+------+-----+---------+-------+
| Field       | Type          | Null | Key | Default | Extra |
+-------------+---------------+------+-----+---------+-------+
| CountryCode | char(3)       | NO   | PRI |         |       |
| Language    | char(30)      | NO   | PRI |         |       |
| IsOfficial  | enum('T','F') | YES  |     | T       |       |
| Percentage  | decimal(4,1)  | NO   |     | 0.0     |       |
+-------------+---------------+------+-----+---------+-------+
4 rows in set (0.001 sec)

ðŸŽŊ Tasks

In this project, you will learn:

  • How to access MySQL using the sudo command without a password
  • How to import data from a SQL file into a MySQL database
  • How to change the default value of a field in a MySQL table

🏆 Achievements

After completing this project, you will be able to:

  • Confidently navigate and manage data in a MySQL database
  • Understand how to modify table structures and default values
  • Apply your MySQL knowledge to real-world database management tasks

Teacher

labby

Labby

Labby is the LabEx teacher.