Databases| SQL| MySQL| Questions? | Software Development
 

Mysql Multiplication Columns

Mysql Multiplication Columns is used to provide the column that is the outcome product of all the records in the respective columns of a table.

Mysql Multiplication Columns

                         

Mysql Multiplication Columns is used to provide the column that is the outcome product of all the records in the respective columns of a table.

Understand with Example

The Tutorial describe you an example from 'Mysql Multiplication Columns'. To understand the example we simply create a table 'Multiplication' with required fieldname and datatype respectively.

 

 

 

 

Query for creating table name Multiplication:

mysql>  CREATE TABLE Multiplication(
    ->              a int(10),
    ->              b int(19),
    ->              c int(21)
    ->             );
Query OK, 0 rows affected (0.03 sec)

Query for Multiple insertion of data in table:

The Query for inserting a records or rows to the table 'Multiplication' is given below :

mysql> insert into Multiplication (a,b,c)values
    ->                     (12,13,15),
    ->                     (22,23,25),
    ->                     (32,33,35),
    ->                     (42,43,45),
    ->                     (52,53,55),
    ->                     (62,65,64
Query OK, 6 rows affected (0.00 sec)
Records: 6  Duplicates: 0  Warnings: 0

Query to view data inserted in table:

The Query given below is used to return the records from table 'multiplication'.

mysql> select * from multiplication;

Output:

mysql> select * from multiplication;
+------+------+------+
| a    | b    | c    |
+------+------+------+
| 12   | 13   | 15   |
| 22   | 23   | 25   |
| 32   | 33   | 35   |
| 42   | 43   | 45   |
| 52   | 53   | 55   |
| 62   | 65   | 64   |
+------+------+------+
6 rows in set (0.00 sec)

Query to view Mysql multiplication of data inserted in table:

The below Query return you the result set in column 'Multiplication' as outcome product of records in the respective columns 

mysql> select a,b,c,a*b*c as Multiplication from multiplication;

Output:-

+------+------+------+----------------+
| a    | b    | c    | Multiplication |
+------+------+------+----------------+
| 12   | 13   | 15   | 2340           |
| 22   | 23   | 25   | 12650          |
| 32   | 33   | 35   | 36960          |
| 42   | 43   | 45   | 81270          |
| 52   | 53   | 55   | 151580         |
| 62   | 65   | 64   | 257920         |
+------+------+------+----------------+
6 rows in set (0.00 sec)

                         

» View all related tutorials
Related Tags: sql mysql c query rest table select io return tab show if condition ie record where records ci ws sh

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
 
Tell A Friend
Your Friend Name

 

 
Recently Viewed
Software Solutions
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.