You must complete exercise 11 in chapter 10 before beginning this exercise, and
ID: 3712650 • Letter: Y
Question
You must complete exercise 11 in chapter 10 before beginning this exercise, and thus have used the data definition Language to populate the table for the three relations COMPANY, STUDENT and INTERNSHIP, once the three tables have been populated, write SQL select staements to staisfy teh following requests:
a. Display the total monethly stipend recieved by each student.
b. For each internship, display the year and quarter offered, headquarters of the compamy offering the intersnhip, and location of the internship. The output should be displayed in ascending order by the headquarters of the company offering the company.
c. Display the names of all students who have not participated in an internship.
d. Display the namees of internships offered for each year, quarter, and internship location.
e. use pattern matching to dispaly the names of those students whose names begin with an Uppercase A and ends with some letter other than a lowercase a.
Explanation / Answer
Solution:
Note: Queries are provided since schema is not given the entities and attributes are based on assumption.
a)
SELECT SUM(stipend) FROM INTERNSHIP GROUP BY studentID
b)
SELECT year, quarter, headquarters FROM INTERNSHIP INNER JOIN COMPANY ON INTERNSHIP.internshipID= COMPANY.internshipID GROUP BY internshipID
c)
SELECT name FROM STUDENT INNER JOIN INTERNSHIP ON STUDENT.internshipID= INTERNSHIP.internshipID WHERE internshipID IS NULL
d)
SELECT internshipName, year, quarter, location FROM INTERNSHIP GROUP BY year, quarter, location
e)
SELECT name FROM STUDENT LIKE 'A%^a'
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.