Introduction
In this project, you will learn how to obtain the value of Pi rounded to two decimal places using an SQL statement in the MySQL client.
ð Preview
MariaDB [(none)]> SOURCE /home/labex/project/getPi.sql;
+------+
| Pi |
+------+
| 3.14 |
+------+
1 row in set (0.000 sec)
ðŊ Tasks
In this project, you will learn:
- How to start the MySQL server using the
sudo
command - How to create an SQL script to display the value of Pi rounded to two decimal places
- How to execute the SQL script in the MySQL client
ð Achievements
After completing this project, you will be able to:
- Understand how to use the
PI()
function in MySQL to retrieve the value of Pi - Use the
ROUND()
function to round the value of Pi to a specific number of decimal places - Create and execute SQL scripts in the MySQL client