Page 341 - TP_IT_V1.0_C10_flipbpookl
P. 341
WHERE <Condition>;
To display all rows and all columns from the table student:
SELECT * FROM Student;
+--------+---------------+------+------------+-------+----------+
| RollNo | Name | Fees | DOB | Marks | ClassSec |
+--------+---------------+------+------------+-------+----------+
| 14 | Jaya Kapoor | 7800 | 2008-03-08 | 78 | 9 |
| 35 | Sikha Arora | 8800 | 2004-12-15 | 87 | 5 |
| 8 | Aparna Aneja | 9000 | 2006-09-24 | 92 | 6 |
| 12 | Debrath Singh | 8600 | 2010-10-27 | 80 | 10A |
+--------+---------------+------+------------+-------+----------+
To display only Rollno and Name with all rows from the table student:
SELECT ROLLNO,NAME FROM Student;
+--------+---------------+
| ROLLNO | NAME |
+--------+---------------+
| 14 | Jaya Kapoor |
| 35 | Sikha Arora |
| 8 | Aparna Aneja |
| 12 | Debrath Singh |
+--------+---------------+
To display records of students whose fees is more than 8500.
SELECT * FROM Student WHERE FEES>8500;
+--------+---------------+------+------------+-------+----------+
| RollNo | Name | Fees | DOB | Marks | ClassSec |
+--------+---------------+------+------------+-------+----------+
| 35 | Sikha Arora | 8800 | 2004-12-15 | 87 | 5 |
| 8 | Aparna Aneja | 9000 | 2006-09-24 | 92 | 6 |
| 12 | Debrath Singh | 8600 | 2010-10-27 | 80 | 10A |
+--------+---------------+------+------------+-------+----------+
To display rollno and names of students whose rollno is 14 and fees is more than 5000.
SELECT ROLLNO,NAME
FROM STUDENT
WHERE ROLLNO=14 AND FEES>5000;
+--------+-------------+
| ROLLNO | NAME |
+--------+-------------+
| 14 | Jaya Kapoor |
+--------+-------------+
To display the Rollno, name and DOB of students whose marks are in the range of 80 and 90.
SELECT ROLLNO,NAME,DOB FROM student WHERE MARKS>=80 AND MARKS<=90;
Database Management System using LibreOffice Base 339

