CodesJava

Easy learning with example program codes

FROM clause in MariaDB

MariaDB FROM
MariaDB FROM clause is used to specify the tables from which the records needs to be retrieved. It thus has a mandatory existence with the MariaDB SELECT statement.

Syntax: To select all fields from a table.

SELECT * FROM table_name;  

Example: Selecting all fields from a table.

SELECT * FROM Players;

Output:

ID	NAME	        SPORTS
1	Sachin	        Cricket
2	Dhoni	        Cricket
3	Sunil	        Football
4	Srikanth	Badminton
5	Mary	        Boxing

Syntax: To select specific fields from a table.

SELECT expressions  
FROM table_name
WHERE conditions;   

Example: Selecting specific fields from a table.

SELECT name, sports  
FROM Players  
WHERE id > 3  
ORDER BY name; 

Output:

NAME	        SPORTS
Mary	        Boxing
Srikanth	Badminton

Please follow and like us:
error









Copyright © 2019 CodesJava DMCA.com Protection Status