Using Microsoft Access, define a database called Student Registration consisting
ID: 3906687 • Letter: U
Question
Using Microsoft Access, define a database called Student Registration consisting of six tables: Student, with the following fields: ID, primary key, short text of length 4 Last Name, short text of length 15 First Name, short text of length 15 Major Code, short text of length 3 Advisor Code, short text of length4 . . Credits, integer Major: Major Code, primary key, short text of length 3 Major Name, short text of length 30 Advisor: .Advisor id, primary key, short text of length 4 Last Name, short text of length 15 .First Name, short text of length 15 Course Course Code, primary key, short text of length 8 . Course Name, short text of length 30 . Credits, integer Section . Section ID, primary key, short text of length 8 . Course ID, short text of length S .Term, short text of length 8 . Section Year, short text of length 4 Instructor, short text of 30 Registration . . . Student ID, primary key, short text of length 4 Section ID, primary key, short text of length 8 Grade, text of length 2 SAMSUNG
Explanation / Answer
Solution:
As per the tables given above, i analyzed the queries you wrote. Please find below my comments and also re-written queries. I have indented the queries for better understanding
1)
We do need all four tables to connect (or JOIN) in order to get the required details. You missed the credits feild offered for each course.
SELECT
student.FirstName, student.LastName, course.CourseName, course.Credits, registration.Grade,
FROM
Student student, Course course, Registration resgistration, Section section
WHERE
course.CourseID = section.CourseID
AND
section.SectionID = resgistration.SectionID
AND
registration.StudentID = student.ID
2)
This query is perfectly fine. No optimization required.
SELECT
student.FirstName, student.LastName, major.MajorName, advisor.FirstName, advisor.LastName
FROM
Student student, Major major, Advisor advisor
WHERE
student.MajorCode = major.MajorCode
AND
student.AdvisorCode = advisor.AdvisorId
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.