Like clause in MySQL

MySQL LIKE In MySQL, the LIKE condition filters the results obtained through the SELECT, INSERT, UPDATE, and DELETE statements based on pattern matching. Syntax: WHERE expressions LIKE pattern [ ESCAPE ‘escape_character’ ] Parameters: expressions: It is used to specify a column or a field. pattern: It is used to specify the character expression for pattern … Read more

Having clause in MySQL

MySQL HAVING In MySQL, the HAVING condition is used with the GROUP BY clause to group the fetched data by one or more columns only when the condition is TRUE. Syntax: To group the rows by values in multiple columns. SELECT expressions FROM table_name GROUP BY columns HAVING having_conditions; Parameters: having_conditions: It is used to … Read more

GROUP BY in MySQL

MySQL GROUP BY In MySQL, the GROUP BY clause is used with the SELECT statement to group the fetched data by one or more columns. Syntax: To group the rows by values in multiple columns. SELECT expressions FROM table_name GROUP BY columns; Parameters: expressions: It is used to specify the columns or calculations to be … Read more

ORDER BY in MySQL

MySQL ORDER BY In MySQL, the ORDER BY clause is used with the SELECT statement to re-arrange the records of the result set in ascending or descending order. Syntax: SELECT expressions FROM table_name WHERE conditions; ORDER BY expression [ ASC | DESC ]; Parameters: expressions: It is used to specify the columns to be retrieved. … Read more

DISTINCT in MySQL

MySQL DISTINCT In MySQL, the DISTINCT clause is used with the SELECT statement to retrieve the unique records from the result set. Syntax: SELECT DISTINCT expressions FROM tables WHERE conditions; Parameters: expressions: It is used to specify the columns to be selected. table_name: It is used to specify the name of the table from which … Read more

WHERE clause in MySQL

MySQL WHERE In MySQL, the WHERE clause is used to filter the results obtained through the SELECT, INSERT, UPDATE, and DELETE statements. Syntax: WHERE conditions; Parameters: conditions: It is used to specify the conditions to be strictly followed for selection. Example: Selecting specific fields from a table. Items table: ID NAME QUANTITY 1 Electronics 30 … Read more