Question 2: Select Firstname , Lastname , Department , Rank , and Salary for all
ID: 3911837 • Letter: Q
Question
Question 2: Select Firstname, Lastname, Department, Rank, and Salary for all faculty whose last name begins with ‘JO’ [Hint: use LIKE in your where clause with a syntax LIKE ‘JO*’].
SELECT Firstname, Lastname, Department, Rank, Salary
FROM Faculty
WHERE LastName LIKE 'JO%';
Question 3. Select CourseNo, Title, and the number of times that a course has been offered
[Hint: In this query, you need to retrieve data from two tables – Course and Offering. Since it involves a COUNT(*) function in the SELECT phrase, the SQL should also have a GROUP BY phrase after the WHERE phrase. Remember that CourseNo appears in both Course and Offering tables, you need to have join condition and an alias may be needed to make your statement easy to write].
Explanation / Answer
Answer2: SELECT Firstname, Lastname, Department, Rank, Salary
FROM Faculty
WHERE LastName LIKE 'JO%';
In your query the Lastname column after where clause you are using capital N in LastName where as in select you are using small n in Lastname although it it is allowed and valid in some DBMS softwares that are case in sensitive but it's a good convention to follow.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.