20 Python Codes_merged (1)
20 Python Codes_merged (1)
{15 SQL QUERIES}
Selected database table:
Query 1:
Display all records from the STUDENTS table
Query 2:
Find students with marks greater than 80;
SELECT Name, Marks FROM STUDENTS WHERE Marks > 80;
Query 3:
List the names of female students
Query 4:
Find the average marks of the class
Query 5:
Count the number of male students
Query 6:
Display students in descending order of marks
SELECT Name, Age FROM STUDENTS WHERE Age = (SELECT MIN(Age) FROM STUDENTS);
Query 8:
Display the total marks scored by male students
Query 9:
Find the maximum marks in the class
Query 10:
List students with marks between 70 and 90
SELECT Name, Marks FROM STUDENTS WHERE Marks BETWEEN 70 AND 90;
Query 11:
Find the total number of students
Query 12:
Group students by gender and find the average marks
Query 13:
Display the names of students whose names start with 'A'
Query 14:
Find students who failed (Marks < 70)