ITM 111: Introduction to Databases

W06 Project: University Database

Design the University database

Watch the following video. Note: this video was created for the 14 week course. The week numbers for your course will be different.

(12:11 mins, “Project Part 1 Intro” Transcript)

Design a University ERD using the University Data. The data in this file is not organized into entities (tables). This data represents samples of what query result sets might look like, not necessarily just tables themselves. Carefully choose proper data types for each attribute.

One assumption: Only one faculty member teaches a section of a course. 

Hints:

Create the University database

Forward engineer the University database and copy the code used during that forward engineer into an sql file named University.sql. This is the same file you will be adding the insert statements to.

Load the University database

Insert the University Data. Use Insert statements and save as one file with the forward engineer code.

Query the University database

(04:27 mins, “Project Querying the University database” Transcript)

Write the queries listed below and add them your University.sql file. Use comments to number your queries.

  1. Students, and their birthdays, of students born in September. Format the date to look like it is shown in the result set. Sort by the student's last name.

    fname lname Sept Birthdays
    Preston Larsen September 22, 1996
    Julia Madsen September 22, 1998
  2. Student's age in years and days as of Jan. 5, 2017. Sorted from oldest to youngest. (You can assume a 365 day year and ignore leap day.) Hint: Use modulus for days left over after years. The 5th column is just the 3rd and 4th column combined with labels.

    lname fname Years Days Years and Days
    Smith Katie 21 173 21 - Yrs, 173 - Days
    Miller Paul 20 323 20 - Yrs, 323 - Days
    Larsen Preston 20 110 20 - Yrs, 110 - Days
    Murdock Mandy 20 49 20 - Yrs, 49 - Days
    Adams Alece 19 233 19 - Yrs, 233 - Days
    Carlson Bryce 19 49 19 - Yrs, 49 - Days
    Jones Kelly 18 202 18 - Yrs, 202 - Days
    Sorensen Susan 18 154 18 - Yrs, 154 - Days
    Madsen Julia 18 110 18 - Yrs, 110 - Days
    Merrill Devon 16 171 16 - Yrs, 171 - Days
  3. Students taught by John Jensen. Sorted by student's last name

    fname lname
    Bryce Carlson
    Devon Merrill
    Mandy Murdock
  4. Instructors Bryce will have in Winter 2018. Sort by the faculty's last name.

    fname lname
    John Jensen
    Marty Morring
    Nate Norris
  5. Students that take Econometrics in Fall 2019. Sort by student last name.

    fname lname
    Kelly Jones
    Mandy Murdock
    Katie Smith
  6. Report showing all of Bryce Carlson's courses for Winter 2018. Sort by the name of the course.

    department_code course_num name
    HUM 376 Classical Heritage
    ITM 111 Intro to Databases
    ECON 150 Micro Economics
  7. The number of enrollments for Fall 2019

    term year Enrollment
    Fall 2019 7
  8. The number of courses in each college. Sort by college name.

    Colleges Courses
    College of Business and Communication 2
    College of Language and Letters 1
    Physical Science and Engineering 1
  9. The total number of students each professor can teach in Winter 2018. Sort by that total number of students (teaching capacity).

    fname lname TeachingCapacity
    Marty Morring 30
    John Jensen 30
    Bill Barney 35
    Nate Norris 100
  10. Each student's total credit load for Fall 2019, but only students with a credit load greater than three. Sort by credit load in descending order.

    lname fname Credits
    Miller Paul 6
    Murdock Mandy 6
    Smith Katie 4
    Jones Kelly 4

Submission:

Submit the University.sql file, which includes forward engineering code, inserts, and queries in Canvas

Useful Links: