Database schema:
CREATE TABLE Students (
  student_id NUMBER PRIMARY KEY,
  bio_data TEXT,
  student_details TEXT
);
CREATE TABLE Transcripts (
  transcript_id NUMBER PRIMARY KEY,
  student_id NUMBER,
  date_of_transcript TIME,
  transcript_details TEXT,
  FOREIGN KEY (student_id) REFERENCES Students(student_id)
);
CREATE TABLE Behaviour_Monitoring (
  behaviour_monitoring_id NUMBER PRIMARY KEY,
  student_id NUMBER,
  behaviour_monitoring_details TEXT,
  FOREIGN KEY (student_id) REFERENCES Students(student_id)
);
CREATE TABLE Addresses (
  address_id NUMBER PRIMARY KEY,
  address_details TEXT
);
CREATE TABLE Ref_Event_Types (
  event_type_code TEXT PRIMARY KEY,
  event_type_description TEXT
);
CREATE TABLE Ref_Achievement_Type (
  achievement_type_code TEXT PRIMARY KEY,
  achievement_type_description TEXT
);
CREATE TABLE Ref_Address_Types (
  address_type_code TEXT PRIMARY KEY,
  address_type_description TEXT
);
CREATE TABLE Ref_Detention_Type (
  detention_type_code TEXT PRIMARY KEY,
  detention_type_description TEXT
);
CREATE TABLE Student_Events (
  event_id NUMBER PRIMARY KEY,
  event_type_code TEXT,
  student_id NUMBER,
  event_date TIME,
  other_details TEXT,
  FOREIGN KEY (event_type_code) REFERENCES Ref_Event_Types(event_type_code),
  FOREIGN KEY (student_id) REFERENCES Students(student_id)
);
CREATE TABLE Teachers (
  teacher_id NUMBER PRIMARY KEY,
  teacher_details TEXT
);
CREATE TABLE Student_Loans (
  student_loan_id NUMBER PRIMARY KEY,
  student_id NUMBER,
  date_of_loan TIME,
  amount_of_loan NUMBER,
  other_details TEXT,
  FOREIGN KEY (student_id) REFERENCES Students(student_id)
);
CREATE TABLE Classes (
  class_id NUMBER PRIMARY KEY,
  student_id NUMBER,
  teacher_id NUMBER,
  class_details TEXT,
  FOREIGN KEY (teacher_id) REFERENCES Teachers(teacher_id),
  FOREIGN KEY (student_id) REFERENCES Students(student_id)
);
CREATE TABLE Students_Addresses (
  student_address_id NUMBER PRIMARY KEY,
  address_id NUMBER,
  address_type_code TEXT,
  student_id NUMBER,
  date_from TIME,
  date_to TIME,
  FOREIGN KEY (address_type_code) REFERENCES Ref_Address_Types(address_type_code),
  FOREIGN KEY (address_id) REFERENCES Addresses(address_id),
  FOREIGN KEY (student_id) REFERENCES Students(student_id)
);
CREATE TABLE Detention (
  detention_id NUMBER PRIMARY KEY,
  detention_type_code TEXT,
  student_id NUMBER,
  datetime_detention_start TIME,
  datetime_detention_end TIME,
  detention_summary TEXT,
  other_details TEXT,
  FOREIGN KEY (detention_type_code) REFERENCES Ref_Detention_Type(detention_type_code),
  FOREIGN KEY (student_id) REFERENCES Students(student_id)
);
CREATE TABLE Achievements (
  achievement_id NUMBER PRIMARY KEY,
  achievement_type_code TEXT,
  student_id NUMBER,
  date_achievement TIME,
  achievement_details TEXT,
  other_details TEXT,
  FOREIGN KEY (achievement_type_code) REFERENCES Ref_Achievement_Type(achievement_type_code),
  FOREIGN KEY (student_id) REFERENCES Students(student_id)
);

Question: Which students only got the most common result for his or her all behaviour monitoring details? List the students' biographical information.
SQL: SELECT T1.bio_data FROM Students AS T1 JOIN Behaviour_Monitoring AS T2 ON T1.student_id  =  T2.student_id WHERE T2.behaviour_monitoring_details IN ( SELECT behaviour_monitoring_details FROM Behaviour_Monitoring GROUP BY behaviour_monitoring_details ORDER BY count(*) DESC LIMIT 1 ) EXCEPT SELECT T1.bio_data FROM Students AS T1 JOIN Behaviour_Monitoring AS T2 ON T1.student_id  =  T2.student_id WHERE T2.behaviour_monitoring_details NOT IN ( SELECT behaviour_monitoring_details FROM Behaviour_Monitoring GROUP BY behaviour_monitoring_details ORDER BY count(*) DESC LIMIT 1 )

Question: How many courses does each student take? List the student id, the student biographical data and the course count.
SQL: SELECT T1.student_id ,  T1.bio_data ,  count(*) FROM Students AS T1 JOIN Classes AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id

Question: Compute the average amount of student loans.
SQL: SELECT avg(amount_of_loan) FROM Student_Loans