The Mastercard Foundation wants to find the majors are being paid an allowance greater than 7000. Write a MySQL statement to show this.
Question
The Mastercard Foundation wants to find the majors are being paid an allowance greater than 7000. Write a MySQL statement to show this.
Solution
Sure, here is a MySQL statement that could be used to find the majors that are being paid an allowance greater than 7000. This assumes that you have a table named 'students' with columns 'major' and 'allowance'.
SELECT DISTINCT major
FROM students
WHERE allowance > 7000;
This statement works as follows:
-
SELECT DISTINCT major: This part of the query selects the unique values from the column 'major'. The DISTINCT keyword ensures that each major is listed only once in the results. -
FROM students: This part of the query specifies the table that we are selecting data from, which in this case is the 'students' table. -
WHERE allowance > 7000: This is the condition that the selected data must meet. Only rows where the 'allowance' is greater than 7000 will be included in the result.
Similar Questions
The provost wants to see the number of students in each major. Write a MySQL statement to display this.
A parent wants to determine the number of majors Ashesi offers students. As the database administrator, you are supposed to write a MySQL query to retrieve the number of majors Ashesi offers using the tables provided.
Dr Stephane Nwolley wants to identify the students with a score greater than the average. Write a MySQL statement to identify these students. Display the student names (Join first name and last name and call it full_name), the score of the student, and their major.
Write a query to display the average payable_amount from bill table where payable_amount is greater than 10000. Give an alias name to the average payable amount as 'average_payable_amount'.
Write a SELECT statement that answers this question:Which instructors have an annual salary that’s greater than the average annual salary for all instructors?Display the Last Name, First Name, and Annual Salary columns for each Instructor. Order in descending Annual Salary.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.