Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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?
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

Psychological, financial, and career counseling.

Answered: 1 week ago