The 1.SQL statement selects the first two records from the Websites table:
SELECT * from Websites LIMIT 2;
< Span class= "Hl-code" >select TOP 50 PERCENT * from Websites
2. Wildcard characters
The A.SQL statement selects all Web sites with the URL beginning with the letter "https":
< Span class= "Hl-code" >select * from Websites
WHERE url like ' https% ' b.sql statement select name starts with an arbitrary character, then all customers with "Oogle"
SELECT * from Websites
WHERE name like ' _oogle ';
The C.SQL statement selects all Web sites that have the name start with "G", "F", or "s":
SELECT * from Websites
WHERE name REGEXP ' ^[gfs] ';
The D.SQL statement selects a Web site whose name begins with a to H letter:
SELECT * from Websites
WHERE name REGEXP ' ^[a-h] ';
The E.SQL statement selects a Web site whose name does not start with a to H letter:
SELECT * from Websites
WHERE name REGEXP ' ^[^a-h] ';
4. Aliases
SELECT name, CONCAT (URL, ', ', Alexa, ', ', country) as Site_info
From Websites;
5. "Websites" and "access_log" tables and specify table aliases "W" and "a" for each of them, respectively
SELECT W.name, W.url, A.count, a.date
From Websites as W, Access_log as a
WHERE A.site_id=w.id and W.name= "rookie Tutorial";
SQL Beginner Tutorial Learning (ii)