0% found this document useful (0 votes)
38 views

Mysql Practice Question

The document contains sample data from a student table with columns for student ID, first name, last name, admission fee, admission date, and branch. It then lists 20 queries to retrieve various data from this table, such as getting unique branches, sorting by first name, calculating scholarship amounts, aggregating fees by branch, updating records, and performing string operations on names and fees.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Mysql Practice Question

The document contains sample data from a student table with columns for student ID, first name, last name, admission fee, admission date, and branch. It then lists 20 queries to retrieve various data from this table, such as getting unique branches, sorting by first name, calculating scholarship amounts, aggregating fees by branch, updating records, and performing string operations on names and fees.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

StudentId FirstName LastName Admission_fee Admission_dateBranch

1 John Smith 1000 2018-06-10 Computer Engineering

2 David Jones 1200 2018-06-20 Civil Engineering

3 MichaelJohnson 900 2018-08-15 Chemical Engineering

4 Chris Lee 1500 2018-07-10 Electrical Engineering

5 Mike Brown 1600 2018-09-10 Mechanical Engineering

6 Lisa Smith 1800 2018-07-10 Computer Engineering

7 Mary Smith 1600 2018-06-11 Computer Engineering

Write a query to display the names (firstname, lastname) using alias name “First Name”, “Last
Name”

Write a MySQL query to get unique branch from student table

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 total admission fee of students

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 MySQL query to calculate 401*14+1025-500

Write a query to get monthly admission fees of each and every student

Write a MySQL to get query to first 5 records from a table

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

You might also like