A Guide to SQL
A Guide to SQL
9th Edition
ISBN: 9781111527273
Author: Philip J. Pratt
Publisher: Course Technology Ptr
Question
Book Icon
Chapter 4, Problem 10TD
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.

“IN” Clause:

  • The “IN” clause consists of an “IN” operator followed by a set of values.
  • Using an “IN” clause, user can determine whether a column contains one of a particular group of values.

Example:

The example for “IN” clause is given below:

SELECT STUDENT_ID, STUDENT_NAME, STUDENT_CREDIT FROM STUDENT WHERE STUDENT_CREDIT IN(50, 70, 100);

 The above query is used to list student ID, name, and credit for each student with a credit limit of “50”, “70” or “100”.

  • From the given query, user can determine whether a student credit limit is “50”, “70” or “100” using an “IN” operator.

Blurred answer
Students have asked these similar questions
the employee table have the following . ask user what is the employee_id and how much employee wants to contribute 2 substitutions variable from end user &emp_id      &contribution_amount If employee salary is in between $1000-$3999 And if  employee's contribution amount is less than $100 then company match $100                   if  employee's contribution amount is greater than 100 but less than $200 then company match $75                  if  employee's contribution amount is greater than $200 then company match $50 $4000-$6999 And if  employee's contribution amount is less than $100 then company match $150                   if  employee's contribution amount is greater than 100 but less than $200 then company match $100                  if  employee's contribution amount is greater than $200 then company match $75  $7000-$12000And if  employee's contribution amount is less than $100 then company match $200                   if  employee's contribution amount is greater than…
The Book table has the following columns: ID Title Author Genre Year Price Complete the SELECT statement to select the year and the average price of books for that year. SELECT *Type your code here */ FROM Book GROUP BY Pick
The Book table has the following columns: ID Title Author Genre Year Price Complete the SELECT statement to select the genre and the total number of books for that genre. SELECT /* Type your code here */ FROM Book GROUP BY Pick ✓

Chapter 4 Solutions

A Guide to SQL

Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
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
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Text book image
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Text book image
CMPTR
Computer Science
ISBN:9781337681872
Author:PINARD
Publisher:Cengage
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning