

- 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 does the slash mean in a MySQL query?
The slash means division ( /) in MySQL query. This can be used to divide two numbers. Here, we will see an example to divide numbers from two columns and display result in a new column.
Let us first create a table −
mysql> create table DemoTable719 ( FirstNumber int, SecondNumber int ); Query OK, 0 rows affected (0.57 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable719 values(20,10); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable719 values(500,50); Query OK, 1 row affected (0.22 sec) mysql> insert into DemoTable719 values(400,20); Query OK, 1 row affected (0.11 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable719;
This will produce the following output -
+-------------+--------------+ | FirstNumber | SecondNumber | +-------------+--------------+ | 20 | 10 | | 500 | 50 | | 400 | 20 | +-------------+--------------+ 3 rows in set (0.00 sec)
Following is the query to perform division with slash in MySQL −
mysql> select *,FirstNumber/SecondNumber AS Result from DemoTable719;
This will produce the following output -
+-------------+--------------+---------+ | FirstNumber | SecondNumber | Result | +-------------+--------------+---------+ | 20 | 10 | 2.0000 | | 500 | 50 | 10.0000 | | 400 | 20 | 20.0000 | +-------------+--------------+---------+ 3 rows in set (0.00 sec)
- Related Questions & Answers
- What does the KEY keyword mean in MySQL?
- What does INT(7) in MySQL mean?
- What does parenthesis mean in MySQL SELECT (COLNAME)?
- What does these operators mean (** , ^ , %, //) ?
- What does the restrict keyword mean in C++?
- What does the volatile keyword mean in C++?
- What does the Star operator mean in Python?
- What does the explicit keyword mean in C++?
- What does Kicking the Tires mean in Investment?
- What does axes in the pandas series mean?
- What does createdCollectionAutomatically mean in MongoDB?
- What does # mean in Lua programming?
- What does operator ~= mean in Lua?
- What does series mean in pandas?
- What does it mean by select 1 from MySQL table?
Advertisements