SELECT Query in DBMS
About SELECT Query in DBMS
In this article, we will learn about SELECT Query in DBMS.
Queries in DBMS are commands which helps to request and retrieve data from the database uisng a proper soecified and sequential format.They are used to fetch data from the tables in which the data is stored.
Displaying only specific columns using SELECT Query in DBMS
Consider a table student where you need to display a student name, ID, and score
SELECT stuid,sname,score from student;O/P
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;
All the columns in the table get displayed.
Retrieve records based on some specified condition
Only those records that satisfy the condition specified in the ‘where’ clause are displayed
Display records of those students from the computers department
SELECT * from student where branch='computers';O/P
Performing some calculations on the column using SELECT
- 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
Increase score of students by 5 marks who are having a score greater than 80
SELECT stuid,sname,score,score+5 from student where score>80;O/P
Get over 200+ course One Subscription
Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others