

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is to be used to store floats in MySQL?
To store floats in MySQL, you can use the concept of DECIMAL(). Let us first create a table −
mysql> create table DemoTable ( Price DECIMAL(10,2) ); Query OK, 0 rows affected (1.59 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values(874674.50); Query OK, 1 row affected (0.39 sec) mysql> insert into DemoTable values(9948984.20); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values(12345678.99); Query OK, 1 row affected (0.18 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable;
Output
+-------------+ | Price | +-------------+ | 874674.50 | | 9948984.20 | | 12345678.99 | +-------------+ 3 rows in set (0.00 sec)
- Related Questions & Answers
- Which MySQL Data Type can be used to store Negative Number?
- Which MySQL datatype to used to store an IP address?
- What should be used to implement MySQL LIKE statement in MongoDB?
- What is the easiest way to store date in MySQL database?
- What is the MySQL datatype to store DATALINK object in JDBC
- What is the best data type to store money values in MySQL?
- MySQL concat() to create column names to be used in a query?
- In MySQL, what is Bit-field notation and how it can be used to write bit-field value?
- How to store decimal in MySQL?
- What is MySQL TRUNCATE command used for?
- What is MySQL DROP command used for?
- What is MySQL DELETE command used for?
- What names can be used in plt.cm.get_cmap?
- What kind of compound units can be used in MySQL EXTRACT() function?
- How MySQL LEFT JOIN can be used to simulate the MySQL MINUS query?
Advertisements