If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Write the following queries in Datalog.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-05-07, 04:35
zenun zenun is offline
Registered User
 
Join Date: Oct 2007
Posts: 1
Write the following queries in Datalog.

HELLO EVERYBODY

I have e problem but i don't know where to post it so I decide to post here.
If anybody can help me God bless him or her.

Suppose we have the following relations or predicates:
Students(id, name)
Courses(number, prereq)
Enrolls(id, number)

The interpretation should be obvious: students have ID's (key) and names, courses have numbers (key) and prerequisties, which are themselves course numbers, and enrollments are pairs consisting of a student ID and the number of a course in which that student is enrolled. Write the following queries in Datalog. You may use more than one rule if you wish.

a) Find the names of the students enrolled in CS145.

b) Find the students who are enrolled in a course and one of its prerequisites at the same time.

c) Find the students who are enrolled in only one course.

with respect
Zenun
Reply With Quote
  #2 (permalink)  
Old 10-05-07, 04:50
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
What course is this for?
__________________
George
Twitter | Blog
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On