DQL Commands
A SELECT query is used to retrieve data(records) from the table
We can retrieve complete table data, or specific records by specifying conditions using the WHERE clause.
A SELECT query is used to retrieve data(records) from the table
We can retrieve complete table data, or specific records by specifying conditions using the WHERE clause.
Syntax
SELECT column1, column2, ...
FROM table_name;
Displaying only specific columns using SELECT Query in DBMS
SELECT stuid,sname,score
from student;
Display all records present in the table using SELECT Query in DBMS
The ‘*’ operator is used to display all the columns present in the table
SELECT * from student;
Only those records that satisfy the condition specified in the ‘where’ clause are displayed
SELECT * from
student
where branch='computers';
We can use simple arithmetic operators upon column data while displaying records
But these changes are not affected in the actual database table they are just used for display purpose
SELECT stuid,sname,score,score+5
from student
where score>80;