Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


SQL Techniques for Performing Operations on Matrices

SQL does not support direct operations on matrices, but it does allow easy manipulations with matrices. Learn a few SQL techniques for performing some basic operations on matrices.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

atrices are very useful mathematical objects that science and technology professionals use to describe real-life scenarios and build abstract models for those scenarios. You will find matrices used in economics and statistics, in cryptography and genetics, and in computer graphics. Unfortunately for database developers, SQL and SQL Server do not support direct operations on matrices. However, because tables and matrices share the same structures, SQL allows easy manipulations with matrices. This article demonstrates a few SQL techniques for performing some basic operations on matrices.

Some Matrix Operation Definitions
A matrix is a rectangular array of elements, where the elements can be symbols, symbolic expressions, or numbers (see Figure 1 below):

Figure 1. Matrix Representation:
A matrix is a rectangular array of elements, which can be symbols, symbolic expressions, or numbers.

In general, matrix A in Figure 1 can be denoted by the following:

In this denotation, m is the number of rows and n is the number of columns in the matrix A. Notation m x n represents the size of the matrix, so matrix A can also be denoted by Am x n or by [A]m x n.

The first matrix in Figure 1 has three rows and four columns. Therefore, the size of that matrix is 3 x 4. The size of the second matrix in Figure 1 is 3 x 3. This matrix is also called a square matrix, because the number of rows is equal to the number of columns.

Each element of the matrix Am x n is denoted by aij, where the row number is 1 ≤ i ≤ m and the column number is 1 ≤ j ≤ n. The element a23 of the first matrix is located in the third column of the second row. Similarly, you can find the location of element a23 in the second matrix. The value of that element is a23 = 20.

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date