To perform matrix addition, take two matrices. Enter the rows and columns of matrix one and matrix two. Remember, both the matrix should be a square matrix to add them.Now add elements to both the matrices. Declare a new array and add both the arrays in it.arr3[i, j] = arr1[i, j] + arr2[i, j];Let us see the complete code −Exampleusing System; using System.Linq; class Demo { static void Main() { int m, n, i, j; Console.Write("Enter number of rows and columns of the matrix "); ... Read More
This is created under the Current schema in your SQL editor. You can check schema name at the top −In the above snapshot, you can see the current schema name where the view is created. You need to find this schema under the Catalog folder in HANA Studio.
Let us see the below table ARTICLE_LOOKUP, we will create a database view with first 4 columns and will hide Family_NAME and FAMILY_CODE.SQL statement- To create a view on the above table, write down the below SQL statementcreate view view_Articlelookup as select ARTICLE_ID,ARTICLE_LABEL,CATEGORY,SALE_PRICE from "AA_HANA11"."ARTICLE_LOOKUP";This will create a database view in the mentioned schema and you can check it in Views folder (schema name here-AA_HANA11). You can see a view with the name- view_Articlelookup and only 4 data columns are there.
Subqueries can work well in a SELECT statement FROM clause. Following is the syntax for the same −SELECT … FROM(subquery) [AS] name …To make it understand we are using the following data from table ‘cars’ −mysql> Select * from Cars; +------+--------------+---------+ | ID | Name | Price | +------+--------------+---------+ | 1 | Nexa | 750000 | | 2 | Maruti Swift | 450000 | | 3 | BMW | 4450000 | | 4 | VOLVO | 2250000 | | ... Read More
The HTML onreset event attribute is triggered when the form is reset in an HTML document.SyntaxFollowing is the syntax −ExampleLet us see an example of HTML onreset event Attribute − Live Demo body { color: #000; height: 100vh; background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat; text-align: center; padding: 20px; } textarea { border: 2px solid #fff; background: transparent; font-size: 1rem; } ::placeholder { color: #000; ... Read More
To quickly convert decimal to other bases, use Stacks. Let us see an example.Firstly, I have set the variable “baseNum” as 2int baseNum = 2;In the same way, if you want another base, then −// base 8 int baseNum = 8; // base 10 int baseNum = 10;After getting the value, set a stack and get the values by getting the remainder and other calculations as shown below.Here, n is the decimal number.Stack s = new Stack(); do { s.Push(n % baseNum); n /= baseNum; } while (n != 0);After using the stack, pop out the elements. ... Read More
Followings are the synonyms statements of MySQL DESCRIBE i.e. the statements with the help of which we can get the same kind of information/structure of the table as we get from DESCRIBE −EXPLAIN StatementEXPLAIN is the synonym of the DESCRIBE statement. Its syntax is also similar to the DESCRIBE statement. Consider the following example −mysql> Explain Employee; +-------+-------------+------+-----+---------+------------------+ | Field | Type | Null | Key | Default | Extra | +-------+-------------+------+-----+---------+------------------+ | ID | int(11) | NO | PRI | NULL | auto_increment | | ... Read More
We can sort multiple columns in a single query by giving more than one column name with ORDER BY Clause. The syntax of the above is as follows −SyntaxSelect Col1, Col2, … from table_name ORDER BY Col1, Col2, …ExampleSuppose we want to sort the table named ‘Student’ by columns ‘Name’ and ‘RollNo’ both then we can write the single query for this as follows −mysql> Select Name, RollNo from student order by name, rollno; +--------+--------+ | name | rollno | +--------+--------+ | Aarav | 150 | | Aryan | 165 | | Gaurav | 100 | ... Read More
To display Armstrong numbers from 1 to 100, firstly use a while loop.Examplewhile (val
With the statement SHOW FULL COLUMNS, we can get more information about the columns of a table than the information we got by DESCRIBE, EXPLAIN, and SHOW COLUMNS MySQL statements.SyntaxSHOW FULL COLUMNS from Table_name;Examplemysql> SHOW FULL COLUMNS FROM EMPLOYEE\G; *************************** 1. row *************************** Field: ID Type: int(11) Collation: NULL Null: NO Key: PRI Default: NULL Extra: auto_increment Privileges: select, insert, update, references Comment: *************************** 2. row *************************** Field: Name Type: varchar(20) Collation: latin1_swedish_ci Null: YES ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP