A Guide to SQL
A Guide to SQL
9th Edition
ISBN: 9781111527273
Author: Philip J. Pratt
Publisher: Course Technology Ptr
bartleby

Concept explainers

Question
Book Icon
Chapter 4, Problem 14TD
Program Plan Intro

“SELECT” command:

The “SELECT” command is used to retrieve data in a database.

Syntax for selecting values from the table is as follows:

SELECT STUDENT_ID FROM STUDENT;

  • The given query is used to display each student ID from “STUDENT” table.

“COUNT” function:

  • It is the one function of aggregate function.
  • The “COUNT” function is used to compute the number of rows in a table.

Example:

The example for “COUNT” function is given below:

SELECT COUNT(*) FROM STUDENT WHERE MARK_CREDIT >= 90;

The above query is used to display the number of students whose mark credit is greater or equal to “90” by using “COUNT” function.

  • From the given query, the asterisk (*) represent any column.
  • User can also count the number of rows in a query by selecting a particular column instead of using the asterisk.
    • The below example is as follows

      SELECT COUNT(STUDENT_ID) FROM STUDENT WHERE MARK_CREDIT >= 90;

Blurred answer
Students have asked these similar questions
List the number of customers living at each state that is included in the Customer_T table.
Find the rep number, last name, and first name of each sales rep who represents at least one customer with a credit limit of $10.000
List the names of those products that have been sold to more than 10 customers. Sort your results by the product name. SQL

Chapter 4 Solutions

A Guide to SQL

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
  • Text book image
    A Guide to SQL
    Computer Science
    ISBN:9781111527273
    Author:Philip J. Pratt
    Publisher:Course Technology Ptr
    Text book image
    Oracle 12c: SQL
    Computer Science
    ISBN:9781305251038
    Author:Joan Casteel
    Publisher:Cengage Learning
Text book image
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Text book image
Oracle 12c: SQL
Computer Science
ISBN:9781305251038
Author:Joan Casteel
Publisher:Cengage Learning