DQL = Data Query Language
DQL command is used to retrieve or fetch the data from a table in Database. We can also call DQL commands as "DRL" (data Retrieval language) commands.
-> SELECT is the DQL command.
SYNTAX 1:
SELECT * from tablename;
SYNTAX 2:
SELECT columnName1, columnName2 from tablename;
SYNATX 3:
SELECT * from tablename where condition;
Examples :
select * from employee; ( This will fetch all columns and rows from the table)
select name, salary from employee; ( This will fetch only selected columns)
select * from employee where name='KRISH'; ( This will fetch based on the Where condition)
Below are the few test scenarios for beginners. Practice to get better.
-> Select ALL ROWS and ALL COLUMNS.
-> Select ALL ROWS and PARTICULAR COLUMNS.
-> Select PARTICULAR COLUMNS and ALL ROWS.
-> SELECT PARTICULAR ROWS and PARTICULAR COLUMNS.
If you have any doubts, Please drop a comment.
Thank You
Comments
Post a Comment