MYSQL Basics to know ….PART -2
MYSQL Basics to know ….PART -2
LoL…I used my YouTube channel name for syntax.
REVERSE(): This command reverses a string.
SUBSTRING( ): It works with parts of strings.
UPPER(): Converts a string into upper-case.
LOWER( ) : Converts a string into lower-case.
CONCAT () : This command adds two or more strings together.
CONCAT_WS (): Concat two or more strings into one string with a separator.
REPLACE( ): Replaces parts(characters)of a string with another set of characters.
DISTINCT( ): It collects unique values and it won’t show any duplicate values in the table.
ORDER BY( ): This command is used to sort the values in Ascending or Descending order. ASC -Ascending order, DESC-Descending order. In the below syntax the output shows in ascending order. Ascending by default.
DESC -Descending order
LIMIT( ): It shows several records or number of values as specified in the syntax.
LIKE ( ): This command shows exact matching values/pattern matching. In the below syntax ‘%a%’- Finds any value that has “a” in any position.
‘e%’-finds any values that start with e.
‘%y’-finds any values that end with y.
GROUP BY( ): It groups rows that have the same values in the table.
Inserted another value in the table
Over here GROUP BY command takes both the rows as one because of same title,author_fname,author_lname,released_year,stock_quantity,pages-‘To Kill a Mockingbird’,’christopher’,’sergel’,1970,42,128.
Comments
Post a Comment