select * from book,class where book.classid=class.classid and class.pid=3