SQL: Summary exercises

To address the different questions or obtain answers, perform the following steps:

To treat a question To have an answer
1-Select the question
2-Enter your SQL query
3-Click on "Execute"
1-Select the question
2-Click on "Answer"
3-Click on "Execute"

Note to English Readers: The value of a string attribute must be written in French. To view the actual content of string attributes, use the command:

SELECT Attribute_name FROM Name_of_the_table;

Using the STUDENTS database, defined in the column DB design, write the SQL queries in order to answer the following questions.

E01:
Display which was the average age of both men and women on January 1, 2000.
E02:
Show the name and rank of the history teachers.
E03:
Display the names and number of students without sociology notes.
E04:
Display the name and the coefficient of the subjects taught by Senior Lecturers (MCF) or Assistants (ASS).
E05:
Display for each student (name and number), in alphabetical order, the average they obtain in each subject.
E06:
Display the name, age and gender of the students who scored above the class average.
E07:
Display, for each student (name and number) who has a mark in each subject, the average he obtained the diploma.
E08:
Display the name, rank and seniority of the teachers who teach more than one subject.
E09:
Display the number of men and the number of women who completed the diploma: average mark > = 10.
E10:
Show the name, number and gender of students who have a grade in data processing higher than their math grade.
E11 :
Display the names of the couples, one man and one woman, whose age difference does not exceed 6 months (180 days).
E12 :
For students who do not have a grade on a subject, Show the number of the student and the name of the subject concerned.
E13 :
Display topics in which the average score is less than 10. Also display the name of the respective teacher.
E14 :
Show, for each subject, who is the highest grade and who is the student who got it.
E15 :
Display, for each gender (Male, Female), the average of the notes on the topic taught by Julie Boyer.

Selected query:

Previous section | SQL summary