Make a structured query language (SQL) for the following question in Access Data
ID: 3818302 • Letter: M
Question
Make a structured query language (SQL) for the following question in Access Database (ill put into access database myself, just need the SQL): (I have provided the necessary info in screenshots. Screenshot 1 is the relationships, 2 is Attendance table, 3 is Courses table, 4 is Employees table).
2a). List the course enrollment for each courseID during the period between #9/30/2003# and #5/31/2008#
2b). List all other courses that have the same prerequisite requirement as “Introduction to Access” (use subquery)
2c). Discount the cost by 20% (become 80% of its original cost) for those courses that have fewer than 5 employees ever enrolled.
All Access Obje H Employee: NAL CMIA Ascending Tis X Del Relati 1/1/2000 $3100.00 $6.110.00 9/23 1998 3/1/1956 $2,800.00 2/23/1997 810N1997 $3,400.00 2/1/1957 $3.200.00 $0.00 Ary doExplanation / Answer
2a).
select attendance.* from attendance inner join courses on attendance.courseId=courses.courseID
where attendance.attended between #9/30/2003# and #5/31/2008#
2b).
select course.* from courses
where prereq in (select courseID from courseId where Description='Introduction to Access')
2c).
select course.*,(cost*0.8) as DiscountCost FROM courses
where courseId in (select courseID from attendance inner join Employee on attendance.SSN=employee.SSN group by courseID having count(*)<=5)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.