Function | Description |
---|---|
SELECT | Collect rows from Table |
WHERE | Add condition to collect rows from the table |
BETWEEN | Condition to get Rows from a range of values |
CASE | Returns first matching condition with Else if not matched |
COUNT | Number of rows with matching conditions |
CONCAT | Join strings or column data |
DISTINCT | Unique records |
GROUP BY | Grouping data and counting |
GROUP_CONCAT | Grouping Concatenated non-NULL values |
HAVING | Grouping with condition |
IS | Checks data against Boolean values |
IF | Checking Condition with Group By |
INNER JOIN | Join tables |
IN | Rows Matching a List of data |
Left join | Joining two tables and getting matching records with unique combination |
Limit | Getting limited records with starting and ending limit |
Like | Matching record with wildcard and formatting |
Locate | Matching record and getting position of the search string |
MAX | Highest number of a column ( math functions: min, sum, average etc ) |
NULL value | Missing or unknown data |
Over() | Grouping window function using over() and partition |
Order By | displaying A to Z or Maximum to Minimum data |
OR AND | Logical operators to use in a query |
Rand | Random records from a table |
Replace | Updating part of data |
REGEXP | Regular expression to match pattern in string data |
Subqueries | Query inside a query |
Union | Joining tables and getting records |
CREATE TABLE student ( id int(2) NOT NULL auto_increment, name varchar(50) NOT NULL default '',
class varchar(10) NOT NULL default '', mark int(3) NOT NULL default '0',
UNIQUE KEY id (id) ) TYPE=MyISAM;
This will create the table for us. We can see that there are three fields in the
table. One is id which is an auto increment and will take one unique number each
time one record is added to the table. Next field is name of 50 length, this
will store the student name. Next is class field of 10 length.
INSERT INTO student VALUES (1, 'John Deo', 'Four', 75);
INSERT INTO student VALUES (2, 'Max Ruin', 'Three', 85);
INSERT INTO student VALUES (3, 'Arnold', 'Three', 55);
INSERT INTO student VALUES (4, 'Krish Star', 'Four', 60);
INSERT INTO student VALUES (5, 'John Mike', 'Four', 60);
INSERT INTO student VALUES (6, 'Alex John', 'Five', 55);
This SQL code will insert six records to the student table. Now our table with data is ready. We will start learning
one SQL command now .
Author
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.
alvin | 15-01-2010 |
nice tutorials |
Randy Orton | 05-07-2010 |
What is diferrence among SQL,MySQL and Oracle. I wanna Know that..! |
Neha | 23-08-2010 |
these are different database servers made by different companies. |
Wathum Nestore | 27-08-2010 |
I like what this site gives to the public! |
Marc | 30-05-2012 |
Need a step by step guide to the selection query and the rest of the most common queries and how to build put them all together |
sunil | 10-11-2012 |
i have just one word for this tutorial "awesome". |