- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Find out the records of students with more than a specific score in MySQL?
Set it with WHERE and get the records of students more than a specific score. Let us first create a table −
mysql> create table DemoTable -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> StudentName varchar(100), -> StudentScore int -> ); Query OK, 0 rows affected (1.65 sec
Insert some records in the table using insert command −
mysql> insert into DemoTable(StudentName,StudentScore) values('John',43); Query OK, 1 row affected (0.81 sec) mysql> insert into DemoTable(StudentName,StudentScore) values('Sam',48); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable(StudentName,StudentScore) values('Chris',33); Query OK, 1 row affected (1.50 sec) mysql> insert into DemoTable(StudentName,StudentScore) values('Robert',89); Query OK, 1 row affected (0.27 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable;
Output
This will produce the following output −
+----+-------------+--------------+ | Id | StudentName | StudentScore | +----+-------------+--------------+ | 1 | John | 43 | | 2 | Sam | 48 | | 3 | Chris | 33 | | 4 | Robert | 89 | +----+-------------+--------------+ 4 rows in set (0.00 sec)
Following is the query to get the record of students with score more than 45 marks −
mysql> select StudentName from DemoTable where StudentScore > 45;
Output
This will produce the following output −
+-------------+ | StudentName | +-------------+ | Sam | | Robert | +-------------+ 2 rows in set (0.00 sec)
- Related Articles
- Display records with more than two occurrences in MySQL?
- Find MongoDB records with Price less than a specific value
- Find records with a specific last digit in column with MySQL
- Find specific records from a column with comma separated values in MySQL
- How to sum the score of students with the same name in MySQL with ORDER BY?
- Find out the popular domains from a MySQL table with domain records and search volume
- MySQL RegExp to fetch records with only a specific number of words
- Aggregation framework to get the name of students with test one score less than the total average of all the tests
- How to select records that begin with a specific value in MySQL?
- Find specific records which has whitespace on the second place in MySQL
- Find the records with % character in a LIKE query with MySQL
- Get the record of a specific year out of timestamp in MySQL?
- Fetch records containing a specific character twice in MySQL
- Fetch ordered records after a specific limit in MySQL
- MySQL query to count records that begin with specific letters

Advertisements