A Guide to SQL
9th Edition
ISBN: 9781111527273
Author: Philip J. Pratt
Publisher: Course Technology Ptr
expand_more
expand_more
format_list_bulleted
Question
Chapter 4, Problem 10SCG
Program Plan Intro
“SELECT” command:
The “SELECT” command is used to retrieve data in a
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.
Naming the computed column in SQL:
- User can assign a name to the computation by using below ways:
- Name the computation with the word “AS”.
- User desired name.
Example:
The example for naming the computed column in SQL is shown below:
SELECT STUDENT_ID, STUDENT_NAME, MAXIMUM_LIMIT – SCORE AS STUDENT_CREDIT FROM STUDENT;
The above query is used to display student id, student name and student credit from “STUDENT” table.
STUDENT_ID | STUDENT_NAME | STUDENT_CREDIT |
123 | Merry | 90 |
208 | John | 86 |
408 | Rose | 98 |
564 | Joseph | 78 |
Explanation:
- User can compute the student credit using the expression “MAXIMUM_LIMIT – SCORE”.
- From the given query, the computation is calculated by using “-” operator that is from “MAXIMUM_LIMIT – SCORE”.
- Here the computed result is name as “STUDENT_CREDIT” by using the word “AS”.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Based on the ERD below, display the first and last names, hire dates, and number of years employed for all employees who have worked for the organization more than 15 years. Order by the most recent hire date.
Based on the following table, please find the customers who locate in the same state.
sales.customers
*customer_id
first_name
last_name
phone
email
street
city
state
zip_code
. Based on the following table, please display the staff and their corresponding manager in the same store. Please display staff’s full name in one column, manager’s full name in another column, and store_id.
sales.staffs
*staff_id
first_name
last_name
email
phone
active
store_id
manager_id
Please help from attached file.
Find the distinct number of workers who work in the HR department and who earn more than ₹250,000.
Find the last name and title of all workers and the department they work in who earn less than the average salary.
What is the average salary paid for all workers in each department? List the department, the average salary for the department, and the number of workers in each department. Name the average column 'AvgSal' and the number of workers column to 'Num'.
What is the total compensation for each worker (salary and bonus) on a per monthly basis? List the name of the worker, their title, and the their monthly compensation (annual compensation divided by 12). Change the header for compensation to 'MonthlyComp' and round it to the nearest whole number.
List the full names of all workers in all capital letters who did not get a bonus.
What are the full names of all workers who have 'Manager' in their title. Do not "hard code" the titles; use string…
Chapter 4 Solutions
A Guide to SQL
Ch. 4 - Prob. 1RQCh. 4 - Prob. 2RQCh. 4 - Prob. 3RQCh. 4 - Prob. 4RQCh. 4 - Prob. 5RQCh. 4 - In which clause would you use a wildcard in a...Ch. 4 - Prob. 7RQCh. 4 - How do you determine whether a column contains one...Ch. 4 - Prob. 9RQCh. 4 - Prob. 10RQ
Ch. 4 - Prob. 11RQCh. 4 - Prob. 12RQCh. 4 - Prob. 13RQCh. 4 - Prob. 14RQCh. 4 - Prob. 15RQCh. 4 - Prob. 16RQCh. 4 - How do you find rows in which a particular column...Ch. 4 - Use the Internet to research the SQL [charlist]...Ch. 4 - Prob. 1TDCh. 4 - Prob. 2TDCh. 4 - Prob. 3TDCh. 4 - Prob. 4TDCh. 4 - Prob. 5TDCh. 4 - Prob. 6TDCh. 4 - Prob. 7TDCh. 4 - Prob. 8TDCh. 4 - Prob. 9TDCh. 4 - Prob. 10TDCh. 4 - Prob. 11TDCh. 4 - Prob. 12TDCh. 4 - Prob. 13TDCh. 4 - Prob. 14TDCh. 4 - Prob. 15TDCh. 4 - Prob. 16TDCh. 4 - What is the price of the least expensive item in...Ch. 4 - Prob. 18TDCh. 4 - Prob. 19TDCh. 4 - Prob. 20TDCh. 4 - Prob. 21TDCh. 4 - Prob. 22TDCh. 4 - Prob. 23TDCh. 4 - Prob. 1CATCh. 4 - Prob. 2CATCh. 4 - Prob. 3CATCh. 4 - Prob. 4CATCh. 4 - Prob. 5CATCh. 4 - Prob. 6CATCh. 4 - Prob. 7CATCh. 4 - Prob. 8CATCh. 4 - Prob. 9CATCh. 4 - Prob. 10CATCh. 4 - Prob. 11CATCh. 4 - Prob. 12CATCh. 4 - Prob. 13CATCh. 4 - Prob. 14CATCh. 4 - Prob. 15CATCh. 4 - Prob. 16CATCh. 4 - Prob. 17CATCh. 4 - Prob. 18CATCh. 4 - Prob. 19CATCh. 4 - List the reservation ID and trip ID for all trips...Ch. 4 - Prob. 1SCGCh. 4 - Prob. 2SCGCh. 4 - Prob. 3SCGCh. 4 - Prob. 4SCGCh. 4 - Prob. 5SCGCh. 4 - Prob. 6SCGCh. 4 - Prob. 7SCGCh. 4 - Prob. 8SCGCh. 4 - Prob. 9SCGCh. 4 - Prob. 10SCGCh. 4 - Prob. 11SCGCh. 4 - Prob. 12SCGCh. 4 - Prob. 13SCGCh. 4 - Prob. 14SCGCh. 4 - Prob. 15SCGCh. 4 - Prob. 16SCG
Knowledge Booster
Similar questions
- Which tables and fields would you access to determine which book titles have been purchased by a customer and when the order shipped?arrow_forwardDisplay only the products (name and ID) that have a quantity greater than the average quantity of all products.arrow_forwardCount and display the booking code of customers who already paid for booking.arrow_forward
- Display details of employee with ID 150 or 160.arrow_forwardList the department name and its instructor’s average salary in which the instructors teach a course in the Spring 2010 semester, and where the average salary of the instructors is more than $40,000arrow_forwardSelect FirstName,LastName,department,project_name,hours from employeetab,Project where employeetab.emp_id=Project.employeeid group by emp_id; [please give the explaination of this sql codearrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology PtrNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage