

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 Questions & Answers
- Display records with more than two occurrences in MySQL?
- Find MongoDB records with Price less than a specific value
- How to sum the score of students with the same name in MySQL with ORDER BY?
- Find records with a specific last digit in column with MySQL
- Aggregation framework to get the name of students with test one score less than the total average of all the tests
- Find specific records from a column with comma separated values in MySQL
- MySQL query to find a value appearing more than once?
- C++ program to check how many students have greater score than first one
- Python program to find average score of each students from dictionary of scores
- Find out the popular domains from a MySQL table with domain records and search volume
- How to print all students name having percentage more than 70% in JavaScript?
- Get the record of a specific year out of timestamp in MySQL?
- Find the records with % character in a LIKE query with MySQL
- Prefixes with more a than b in C++
- MySQL RegExp to fetch records with only a specific number of words
Advertisements