Mysql Practice Question
Mysql Practice Question
Write a query to display the names (firstname, lastname) using alias name “First Name”, “Last
Name”
Write a MySQL query to get the details of all students according to first name in descending order
Write a MySQL query to get the names (firstname, lastname), Fee, Scholarship of all the student
(Scholarship is calculated as 15% of Admission Fee)
Write a query to get the student ID, names (firstname, lastname), admission Fee in ascending order
of admission Fee
Write a MySQL query to get the maximum and minimum admission fee from students table
Write a MySQL query to get the average admission fee and number of students in the students table
Write a MySQL query to get the number of students studying in the institute
Write a query get all first name from students table in lower case
Write a query get all first name from students table in upper case
Write a query get the first 3 characters of first name from students table
Write a query to get monthly admission fees of each and every student
Write a MySQL to get first name of all students table after removing white spaces from both side
Write a MySQL query to display the firstname, lastname and fee for all students whose fee is not in
the range 1000 through 1500
Write a MySQL query to display the firstname, lastname and branch ID of all student in branch 111
or 666 in ascending order
Write MySQL query to display the firstname, lastname and admission date for all students who took
admission in year 2016
Write a MySQL query to display the firstname of all students who have both “a” and “i” in their first
name
Write a MySQL query to display the last name of students whose name have exactly 5 characters
Write a query to display the last name of employees having ‘e’ as the fourth character
Write a MySQL query to select all records from students where last name in Smith, Johnson & Lee
Write a MySQL query to list the number of branchs available in the student table
Write a MySQL query to get the total admission fee of all students
Write a MySQL query to get the minimum admission fee from students table
Write a MySQL query to get the maximum admission fee from students table
Write a MySQL query to get the average fee and number of students studying in ‘Computer
Engineering’
Write a MySQL query to get the highest, lowest, sum, and average salary of all students
Write a MySQL query to get the number of students with the same branch
Write a MySQL query to get the difference between the highest and lowest salaries
Write a MySQL query to get Branch ID and the total admission fee of each branch
Write a MySQL query to get the average admission fee for each branch excluding ‘Computer
Engineering’
Write a MySQL query to get the total salary, maximum, minimum, average salary of students(Branch
ID wise), for Branch ID 111 only
Write a MySQL query to get the branch ID and maximum fee of the students where maximum fee is
greater than or equal to 1000
Write a MySQL query to get the average fee for all students more than 2 students stuyding in same
branch
Write a MySQL query to update the Branch number in the stuents table, where firstname = John
Write a MySQL query to get details of the students where the length of the first name greater than
or equal to 5
Write a MySQL query to append ‘@example.com’ to firstname field
Write a MySQL query to get the student id, first name and admission month
Write a MySQL query to get the student id, email id (discard the last three characters)
Write a MySQL query to find all students where first names are in upper case
Write a MySQL query to find all students where first names are in lower case
Write a MySQL query to extract the last 3 numbers from admission fees