What is MySql? How to use SELECT statement in MySql?
MySQL is a relational database management system and it is open-source.
MySQL is becoming so popular because of these following reasons:
o MySQL is an open-source database so you don’t have to pay anything.
o MySQL is quicker than other databases so it can work well even with the large data set.
o MySQL Platform independent we can use on different operating systems with multiple languages like PHP, PERL, C, C++, JAVA, etc.
o MySQL supports large databases, up to 50 million rows or more in a table. The default file size limit for a table is 4GB, but you can increase this (if your operating system can handle it) to a theoretical limit of 8 million terabytes (TB).
Now the most important capture when we are considering MySql is QUERY
SQL will be run by queries in different ways, Lets have a look on some:-
SELECT – most commonly use SELECT it will show how to use simple SELECT statement to query the data from a single table.
a. Filtering data
WHERE – learn how to use the WHERE clause to filter rows based on specified conditions.
AND – introduce you to the AND operator to combine Boolean expressions to form a complex condition for filtering data.
OR– will show you how to combine the OR operator with the AND operator to filter data.
IN – show you how to use the IN operator in the WHERE clause to determine if a value matches any value in a list or a sub query.
BETWEEN – show you how to query data based on a range using BETWEEN operator.
LIKE – provide you with technique to query data based on a specific pattern.
LIMIT – use LIMIT to constrain the number of rows returned by SELECT statement
IS NULL – test whether a value is NULL or not by using IS NULL operator.
b. Sorting data
ORDER BY – show you how to sort the result set using ORDER BY clause. The custom sort order with the FIELD function will be also covered.
c. Joining tables
MySQL alias –it will improve the readability of complex queries.
MySQL Join – give you an overview of joins supported in MySQL including cross join, inner join, left join, and right join.
INNER JOIN – use inner join clause to query data from multiple related tables.
LEFT JOIN – learn how to apply left join clause in various contexts.
RIGHT JOIN – it will figure out the data from two or more tables.
CROSS JOIN – make a Cartesian product of rows from multiple tables.
Self-join – joins a table to itself using table alias, and connects rows within the same table using other kinds of joins including inner join and left join.
d. Grouping data
GROUP BY clause
HAVING – filter the groups by a specific condition.
e. MySQL sub query, derived table, and CTE
MySQL sub query – show you how to nest a query (inner query) within another query (outer query) and use the result of the inner query for the outer query.
MySQL derived table –how to use it to simplify complex queries.
To learn MySql, Join CPD TECHNOLOGIES today.