Concept explainers
SELECT statement:
It is used to retrieve information from the table or
Syntax:
SELECT * FROM table_Name;
GROUP BY Clause:
The GROUP BY clause is used to group the result of a SELECT statement done on a table where the tuple values are similar for more than one column
Syntax:
SELECT expression1, expression2, expression_n, aggregate_function (expression)FROM table_name WHERE conditions GROUP BY expression1, expression2, expression_n;
HAVING clause:
“HAVING” clause is used to limit groups and it overcomes “WHERE” clause as it makes use of aggregate functions.
Syntax:
SELECT column_Name1, column_Name2 FROM table_name WHERE [conditions] GROUP BY column_name(s) HAVING [conditions] ORDER BY column_name;
Trending nowThis is a popular solution!
Chapter 1 Solutions
A Guide to SQL
- Show students’ first name and last name, the course numbers the student took (don’t include currently taking) and its credits, and the grades of the courses in the ascending order of last name and first name and descending order of course number STUDENT TABLE 100001 Johnson Ariel 2000-07-10 Y 100002 Green Robin 2001-11-02 Y 100003 Johnson Charles 1995-01-12 Y 100004 Pearson Jeffery 1996-02-06 Y 100005 Sears Miguel 1998-10-31 Y 100006 Kyle Leah 2000-05-29 Y 100007 Myers Lynda 1980-08-24 Yarrow_forwardShow students’ first name, last name, the grades of the students, and the credits of the course for the students who took (don’t include currently taking) the course ‘MISM4221’. STUDENT TABLE 100001 Johnson Ariel 2000-07-10 Y100002 Green Robin 2001-11-02 Y100003 Johnson Charles 1995-01-12 Y100004 Pearson Jeffery 1996-02-06 Y100005 Sears Miguel 1998-10-31 Y100006 Kyle Leah 2000-05-29 Y100007 Myers Lynda 1980-08-24 Yarrow_forward
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology Ptr