h. จากข้อ e เมื่อแปลออกมาเป็นภาษาคำถามของมนุษย์จะได้ว่า "ให้เลือกแสดงฟิลด์รหัสนิสิต ชื่อนิสิต อาจารย์ที่ปรึกษา และชั้น จากตารางนักเรียน ( student ) โดยมีเงื่อนไขคือเป็นนิสิตชั้นปี 2" ให้ลองแปลข้อ f ออกมาเป็นภาษาคำถามของมนุษย์
ตอบ ให้เลือกแสดงฟิลด์รหัสนิสิต ชื่อนิสิต อาจารย์ที่ปรึกษา ชั้น และงานอดิเรก จากตารางนักเรียน (student) โดยมีเงือนไขคือ งานอดิเรกคือคำว่า 'อ่านหนังสือ'
.................................................................................................................................................................
i. ให้นิสิตสืบค้นข้อมูลด้วยภาษา SQL ตามคำถาม "ให้เลือกฟิลด์ทั้งหมดจากตารางรายวิชา (subject)"
ตอบ SELECT subjectid,name,credit,book,teacher
FROM subject;
...........................................................................................................................................................
j. ให้นิสิตสืบค้นข้อมูลด้วยภาษา SQL ตามคำถาม "ให้เลือกฟิลด์รหัสรายวิชา ชื่อรายวิชา และจำนวนหน่วยกิต จากตารางรายวิชา(subject)
ตอบ SELECT subjectid , Name ,Credit
FROM subject;
.............................................................................................................................
ตอบ SELECT subjectid , Name, Credit
FROM subject
WHERE subjectid =104111;
..............................................................................................................................
l. ทดลอง พิมพ์ SELECTStudent.Studentid,Student.Name,Register.Score,Register.Grade FROM Register,student
WHERE (Register.Studentid=Student.Studentid AND Register.Studentid=4902)แล้วเลือก Run Query
ตอบ เมื่อทำการ Run Query แล้วจะได้ดังภาพ
..............................................................................................................................
m. ทดลอง ปรับเป็น
SELECTstudent.Studentid,student.Name,Register.Score,Register.Grade,Subject.Name FROM Register,Student,Subject WHERE(Register.Studentid=student.Studentid AND Register.Studentid=4902 ) AND (Register.Subjectid=Subject.Subjectid)
ตอบ เมื่อทำการ Run Query แล้วจะได้ดังภาพ
..........................................................................................................................
n. ทดลองปรับเป็น SELECT student.Studentid,student.Name,Register.Score,Register.Grade,Subject.Name
FROM Register,student,Subject WHERE (Register.Studentid=student.Studentid) AND (Register.Subjectid=Subject.Subjectid AND Register.Subjectid=104111)
............................................................................................................................
ตอบ ให้เลือกแสดงฟิลด์ รหัสนิสิต ชื่อนิสิต คะแนน เกรด และชื่อรายวิชา จากตารางนักเรียนstudent การลงทะเบียนจากตาราง Register และรายวิชาจากตาราง Subject โดยมีเงื่อนไขคือ แสดงรหัสรายวิชา"104111" เท่านั้น
..............................................................................................................................
p. ให้ นิสิตสืบค้นข้อมูลด้วยภาษาSQLตามคำถาม"ให้เลือกแสดงฟิลด์รหัสนิสิต ชื่อนิสิต คะแนน เกรด และชื่อรายวิชา จากตารางนักเรียน(Student)การลงทะเบียน(Register) และรายวิชา(Subject) โดยมีเงือนไขคือแสดงเฉพาะรายวิชารหัส 104111เท่านั้น และนิสิตอยู่ในชมรมภูมิศาสตร์เท่านั้น
ตอบ SELECTStudent.Studentid,student.Name,Register.Score,Register.Grade,Subject.Name ,student.Club
FROM Register,student,Subject
WHERE Register.Studentid=student.Studentid AND Register.Subjectid=Subject.Subjectid AND Register.Subjectid=104111 AND student.Club='ภูมิศาสตร์';
.............................................................................................................................