Posts

MySQL Practice questions for interview - student table | Set 1

 Here’s a sample table with some data and relevant queries for practice. Sample Table: students student_id name age course total_fees discount join_date 1 John Doe 20 Web Dev 30000 10 2024-01-10 2 Alice Smith 22 Data Science 50000 15 2023-12-15 3 Bob Johnson 25 AI & ML 60000 5 2024-03-05 4 Carol Baker 21 Cybersecurity 45000 20 2024-06-20 5 Dave Wilson 23 Web Dev 30000 0 2024-08-15 Practice Queries 1. Retrieve all students who joined after January 1, 2024. SELECT * FROM students WHERE join_date > '2024-01-01'; 2. Calculate the final fees (after discount) for each student. SELECT name, total_fees - (total_fees * discount / 100) AS final_fees FROM students; 3. Find students enrolled in the "Web Dev" course. SELECT * FROM students WHERE course = 'Web Dev'; 4. Find the average age of students. SELECT AVG(age) AS average_age FROM students; 5. List students with discounts grea...