CREATE TABLE Addresses (
    address_id NUMBER PRIMARY KEY,
    line_1 TEXT,
    line_2 TEXT,
    line_3 TEXT,
    city TEXT,
    zip_postcode TEXT,
    state_province_county TEXT,
    country TEXT,
    other_address_details TEXT
);
CREATE TABLE Courses (
    course_id NUMBER PRIMARY KEY,
    course_name TEXT,
    course_description TEXT,
    other_details TEXT
);
CREATE TABLE Departments (
    department_id NUMBER PRIMARY KEY,
    department_name TEXT,
    department_description TEXT,
    other_details TEXT
);
CREATE TABLE Degree_Programs (
    degree_program_id NUMBER PRIMARY KEY,
    department_id NUMBER,
    degree_summary_name TEXT,
    degree_summary_description TEXT,
    other_details TEXT,
    FOREIGN KEY ("department_id") REFERENCES Departments("department_id")
);
CREATE TABLE Sections (
    section_id NUMBER PRIMARY KEY,
    course_id NUMBER,
    section_name TEXT,
    section_description TEXT,
    other_details TEXT,
    FOREIGN KEY ("course_id") REFERENCES Courses("course_id")
);
CREATE TABLE Semesters (
    semester_id NUMBER PRIMARY KEY,
    semester_name TEXT,
    semester_description TEXT,
    other_details TEXT
);
CREATE TABLE Students (
    student_id NUMBER PRIMARY KEY,
    current_address_id NUMBER,
    permanent_address_id NUMBER,
    first_name TEXT,
    middle_name TEXT,
    last_name TEXT,
    cell_mobile_number TEXT,
    email_address TEXT,
    ssn TEXT,
    date_first_registered TIME,
    date_left TIME,
    other_student_details TEXT,
    FOREIGN KEY ("permanent_address_id") REFERENCES Addresses("address_id"),
    FOREIGN KEY ("current_address_id") REFERENCES Addresses("address_id")
);
CREATE TABLE Student_Enrolment (
    student_enrolment_id NUMBER PRIMARY KEY,
    degree_program_id NUMBER,
    semester_id NUMBER,
    student_id NUMBER,
    other_details TEXT,
    FOREIGN KEY ("student_id") REFERENCES Students("student_id"),
    FOREIGN KEY ("semester_id") REFERENCES Semesters("semester_id"),
    FOREIGN KEY ("degree_program_id") REFERENCES Degree_Programs("degree_program_id")
);
CREATE TABLE Student_Enrolment_Courses (
    student_course_id NUMBER PRIMARY KEY,
    course_id NUMBER,
    student_enrolment_id NUMBER,
    FOREIGN KEY ("student_enrolment_id") REFERENCES Student_Enrolment("student_enrolment_id"),
    FOREIGN KEY ("course_id") REFERENCES Courses("course_id")
);
CREATE TABLE Transcripts (
    transcript_id NUMBER PRIMARY KEY,
    transcript_date TIME,
    other_details TEXT
);
CREATE TABLE Transcript_Contents (
    student_course_id NUMBER,
    transcript_id NUMBER,
    FOREIGN KEY ("transcript_id") REFERENCES Transcripts("transcript_id"),
    FOREIGN KEY ("student_course_id") REFERENCES Student_Enrolment_Courses("student_course_id")
);

Question: What is the id of the semester that had both Masters and Bachelors students enrolled?
SQL: SELECT DISTINCT T2.semester_id FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id  =  T2.degree_program_id WHERE degree_summary_name  =  'Master' INTERSECT SELECT DISTINCT T2.semester_id FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id  =  T2.degree_program_id WHERE degree_summary_name  =  'Bachelor'

Question: How many different addresses do the students currently live?
SQL: SELECT count(DISTINCT current_address_id) FROM Students

Question: What are the different addresses that have students living there?
SQL: SELECT count(DISTINCT current_address_id) FROM Students

Question: List all the student details in reversed lexicographical order.
SQL: SELECT other_student_details FROM Students ORDER BY other_student_details DESC

Question: What other details can you tell me about students in reverse alphabetical order?
SQL: SELECT other_student_details FROM Students ORDER BY other_student_details DESC

Question: Describe the section h.
SQL: SELECT section_description FROM Sections WHERE section_name  =  'h'

Question: What is the description for the section named h?
SQL: SELECT section_description FROM Sections WHERE section_name  =  'h'

Question: Find the first name of the students who permanently live in the country Haiti or have the cell phone number 09700166582 .
SQL: select t1.first_name from students as t1 join addresses as t2 on t1.permanent_address_id  =  t2.address_id where t2.country  =  'haiti' or t1.cell_mobile_number  =  '09700166582'

Question: What are the first names of the students who live in Haiti permanently or have the cell phone number 09700166582 ?
SQL: select t1.first_name from students as t1 join addresses as t2 on t1.permanent_address_id  =  t2.address_id where t2.country  =  'haiti' or t1.cell_mobile_number  =  '09700166582'