Introduction
In this project, you will learn how to query and sort the official languages spoken in different countries using SQL. You will access the MySQL database, import the necessary data, and write a SQL script to retrieve and order the official languages.
๐ Preview
MariaDB [world]> SOURCE /home/labex/project/getOfficialLanguageOrder.sql;
+-------------+------------+
| CountryCode | Language |
+-------------+------------+
| ABW | Dutch |
| AFG | Dari |
| AFG | Pashto |
| AIA | English |
| ALB | Albaniana |
| AND | Catalan |
| ANT | Dutch |
| ANT | Papiamento |
| ARE | Arabic |
| ARG | Spanish |
+-------------+------------+
10 rows in set (0.000 sec)
๐ฏ Tasks
In this project, you will learn:
- How to access the MySQL database using the
sudo
command without a password
- How to import data from a SQL script into the MySQL database
- How to write a SQL query to retrieve the official languages spoken in each country, sorted by their country codes
- How to run a SQL script in the MySQL database
๐ Achievements
After completing this project, you will be able to:
- Understand how to work with the MySQL database using the command line
- Write SQL queries to extract and sort data from a database
- Apply your SQL knowledge to solve real-world data manipulation problems
Skills Graph
%%%%{init: {'theme':'neutral'}}%%%%
flowchart RL
mysql(("`MySQL`")) -.-> mysql/BasicKeywordsandStatementsGroup(["`Basic Keywords and Statements`"])
mysql(("`MySQL`")) -.-> mysql/DatabaseFunctionsandDataTypesGroup(["`Database Functions and Data Types`"])
sql(("`SQL`")) -.-> sql/BasicSQLCommandsGroup(["`Basic SQL Commands`"])
sql(("`SQL`")) -.-> sql/DataManipulationandQueryingGroup(["`Data Manipulation and Querying`"])
mysql/BasicKeywordsandStatementsGroup -.-> mysql/source("`External Code Execution`")
mysql/DatabaseFunctionsandDataTypesGroup -.-> mysql/database("`DB Function - Info Retrieval`")
sql/BasicSQLCommandsGroup -.-> sql/select("`SELECT statements`")
sql/DataManipulationandQueryingGroup -.-> sql/where("`WHERE clause`")
sql/DataManipulationandQueryingGroup -.-> sql/order_by("`ORDER BY clause`")
mysql/BasicKeywordsandStatementsGroup -.-> mysql/select("`Data Retrieval`")
mysql/BasicKeywordsandStatementsGroup -.-> mysql/use_database("`Database Selection`")
sql/BasicSQLCommandsGroup -.-> sql/insert("`INSERT INTO statements`")
sql/BasicSQLCommandsGroup -.-> sql/create_table("`CREATE TABLE statements`")
subgraph Lab Skills
mysql/source -.-> lab-301398{{"`Querying Official Languages and Sorting`"}}
mysql/database -.-> lab-301398{{"`Querying Official Languages and Sorting`"}}
sql/select -.-> lab-301398{{"`Querying Official Languages and Sorting`"}}
sql/where -.-> lab-301398{{"`Querying Official Languages and Sorting`"}}
sql/order_by -.-> lab-301398{{"`Querying Official Languages and Sorting`"}}
mysql/select -.-> lab-301398{{"`Querying Official Languages and Sorting`"}}
mysql/use_database -.-> lab-301398{{"`Querying Official Languages and Sorting`"}}
sql/insert -.-> lab-301398{{"`Querying Official Languages and Sorting`"}}
sql/create_table -.-> lab-301398{{"`Querying Official Languages and Sorting`"}}
end