
Like if there are 10 rows in each table, it will simply multiply 10*10=100 records.Įxample: SELECT * FROM EMPLOYEE EMP CROSS JOIN DEP WHERE EMP.DEP_ID= DEP.DEP_ID Ĩ. CROSS JOIN: The Cartesian product of joined table rows will be provided. Syntax: SELECT T1.C1, T2.C2 FROM TABLE T1 RIGHT JOIN TABLE T2 ON T1.C1= T2.C1 Įxample: SELECT E.EMP_ID, D.DEP_ID FROM EMPLOYEE E RIGHT JOIN DEP D ON E.DEP_ID = D.DEP_ID ħ. RIGHT JOIN: This MySQL Query command helps retrieve the data from two or more tables, taking the complete records from the right table and matching the data with the left table to show the records.

Syntax: SELECT T1.C1, T2.C2 FROM TABLE T1 LEFT JOIN TABLE T2 ON T1.C1= T2.C1 Įxample: SELECT E.EMP_ID, D.DEP_ID FROM EMPLOYEE E LEFT JOIN DEP D ON E.DEP_ID = D.DEP_ID Ħ. LEFT JOIN: It helps you provide the data from two or more tables, retrieving all the columns from the left table and delivering the data from the right table that matches. Syntax: SELECT COLUMN1, COLUMN2 FROM INNER JOIN ON Condition Įxample: SELECT EMP_NAME, EMP_COUNTRY, DEP_ID FROM EMPLOYEE EMP INNER JOIN DEPARTMENT DEP on EMP.DEP_ID= DEP.DEP_ID ĥ. INNER JOIN: It allows you to retrieve the data from two table matches in one and other tables. Syntax: DELETE FROM WHERE CONDITION Įxample: DELETE FROM EMPLOYEE WHERE EMP_ID=154 Ĥ. DELETE: The Command is used to delete the record for a particular value from the table.
#MYSQL QUERY TO VISIDATA UPDATE#
Syntax: UPDATE SET COLUMN1 ='' WHERE COLUMN2 ='' Įxample: UPDATE EMPLOYEE SET EMP_SAL=6000 WHERE EMP_ID=200 ģ. UPDATE: This MySQL Query command updates the specific table and column for the particular record. Syntax: INSERT INTO TABLE NAME (Column1, Column2.) VALUES (val1, val2.) Įxample: INSERT INTO EMPLOYEE (EMP_NAME, EMP_SAL) Values ('TOM','3000') Ģ. INSERT: This statement allows you to insert one or more rows in the table. Syntax: SELECT Column1, Column2 FROM Column3 IS NULL Įxample: SELECT EMP_ID, EMP_NAME FROM EMPLOYEE WHERE EMP_SAL IS NULL Intermediate MySQL Query Commandsīelow is a list of intermediate commands:ġ. IS NULL: This is used for checking the value or retrieving the data for the particular null column. Syntax: SELECT Column1, Column2 FROM EMPLOYEE WHERE Column3 BETWEEN val1 AND val2 Įxample: SELECT EMP_ID, EMP_NAME FROM EMPLOYEE WHERE EMP_SAL BETWEEN 20 ġ0. BETWEEN: It ranges the data between the two conditions. Syntax: SELECT COLUMN1, COLUMN2 FROM WHERE COLUMN1 Like'' Įxample: SELECT EMP_ID, EMP_NAME, EMP_SALARY FROM EMPLOYEE WHERE EMP_NAME like'SA%' ĩ. LIKE: This MySQL Query Command retrieves the data from the table for the specific pattern. Syntax: SELECT COLUMN1, COLUMN2, FROM ORDER BY Column1 desc, Column2 asc Įxample: SELECT EMP_NAME, EMP_ID FROM EMPLOYEE ORDER BY EMP_NAME desc, EMP_ID asc Ĩ.


ORDER BY: It is used to sort the data in a particular order for a specific column in ascending or descending order.

Syntax: SELECT COLUMN1, COLUMN2… FROM WHERE IN ('val1','val2') Įxample: SELECT EMP_NAME, EMP_SALARY FROM EMPLOYEE WHERE EMP_COUNTRY IN ('INDIA','USA', 'NZ') ħ. IN: This operator helps filter the data based on a value match. Syntax: SELECT FROM WHERE TRUE OR FALSEĮxample: SELECT * FROM EMPLOYEE WHERE EMP_COUNTRY="INDIA" OR EMP_COUNTRY ="USA" Ħ. OR: This MySQL Query Command combines the data from the table for the specific condition. Syntax: SELECT FROM WHERE AND Įxample: SELECT EMP_NAME, FROM EMPLOYEE WHERE EMP_ID=200 AND EMP_COUNTRY="INDIA" ĥ. AND: This condition filters the data based on conditions.
