Course Hero Logo

Project Part 2.sql - USE university - Q1 SELECT student...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 2 out of 3 pages.

USE university;-- Q1SELECT student_fname, student_lname, DATE_FORMAT(dob, '%M %e, %Y') AS "SeptBirthdays"FROM studentWHERE MONTH(dob) = 09ORDER BY student_lname;-- Q2SELECT student_lname, student_fname, FLOOR(DATEDIFF('2017-01-05', dob)/365) AS"Years",FLOOR(MOD(DATEDIFF('2017-01-05', dob), 365)) AS "Days",CONCAT(FLOOR(DATEDIFF('2017-01-05', dob)/365), " - Yrs, ",FLOOR(MOD(DATEDIFF('2017-01-05', dob), 365)), " Days") AS "Years and Days"FROM studentORDER BY years DESC;-- Q3SELECT student_fname, student_lnameFROM studentJOIN student_has_sectionON student.student_id = student_has_section.student_idJOIN sectionON section.section_id = student_has_section.section_idJOIN facultyON faculty.faculty_id = section.faculty_idWHERE fname = 'John' AND lname = 'Jensen'ORDER BY student_lname;-- Q4SELECT fname, lnameFROM facultyJOIN sectionON faculty.faculty_id = section.faculty_idJOIN student_has_section AS enrollmentON enrollment.section_id = section.section_idJOIN studentON student.student_id = enrollment.student_idWHERE student_fname = "Bryce" AND section.term_id = 2ORDER BY lname;-- Q5

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 3 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
DARINDAVIS
Tags
DAYS, Select STUDENT

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture