Question: Question 2 Suppose we have a database for Grade 1 1 and 1 2 students of the Esplanade Secondary School. The layout of the records

Question 2
Suppose we have a database for Grade 11 and 12 students of the Esplanade Secondary
School. The layout of the records in this database is as follows:
student(Surname, First_Name, Gender,Grade, [List_of_subjects]).
The first entry in the list of subjects represents the subject the student takes as first language
and the second entry the subject the student takes as second language. The other entries
represent the other subjects the student takes.
(a) Write Prolog clauses for the following: Given a Surname and First_Name, return
the list of subjects this student takes, e.g.
student_subs (Surname, First_Name, L) should return the list L of the subjects
student First_Name Surname takes. Do this for the gender and the grade of the
student as well.
(b) Build your own database using some entries reflecting the records of students. Use the
Prolog clauses you defined in (a) to run queries to ask the following questions:
Who takes Portuguese as second language?
Who takes more than 6 subjects?
Is there a student with the surname Brown in Grade 12?
 Question 2 Suppose we have a database for Grade 11 and

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!