Database Systems: Design Implementation & Management
11th Edition
ISBN: 9781305850378
Author: Coronel
Publisher: Cengage
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 13, Problem 12P
Using the answer to Problem 10 as your base, what command would you need to generate the same output but with subtotals in all columns? (Hint: Use the CUBE command.) Figure P13.12 shows the result of the query.
FIGURE P13.12 PROBLEM 12 RESULT
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Task 2:
The Driver Relationship team wants to ensure that the all driving license IDs in the active drivers table have the length of 7. Alter the ACTIVE_DRIVERS table created in Chapter 8, Activity 1 to check the length of the DRIVER_DRIVING_LICENSE_ID.
Add a CHECK to the ACTIVE_DRIVERS table to enforce a driver license length of 7.
Test Query:
SELECT DISTINCT(constraint_name)
FROM information_schema.check_constraints
WHERE constraint_schema = 'InstantRide'
AND constraint_name = 'ACTIVE_DRIVERS_chk_1'
Expected Results
CONSTRAINT_NAME
ACTIVE_DRIVERS_chk_1
Could you do typing the query here please?
Here are the previous steps that have been done before reaching the question below:
step 1:
Task 1: Q1.Please write a query statement from emp table to display deptno 10’s empno, ename, sal, and a new_sal which is increase by 15% from the original sal (round the new_sal value to a whole number). Label the column headings to EMPNO, ENAME, SAL, and NEW_SAL.
Answer:
SELECT empno, ename, sal, new_salFROM deptnoWHERE new_sal = orginal_sal * 1.15
ALTER TABLE deptnoRENAME COLUMN empno to EMPNO;
ALTER TABLE deptnoRENAME COLUMN ename TO ENAME;
ALTER TABLE deptnoRENAME COLUMN sal TO SAL;
ALTER TABLE deptnoRENAME new_sal empno TO NEW_SAL;
step2:
Task 2: Please write a query statement from emp table to display deptno 30’s empno, ename, sal, comm, and total_income which is a new column of the amount of sal + comm. Label the column heading to EMPNO, ENAME, SAL, COMM, TOTAL_INCOME. The result should be like below:
Answer:
ALTER TABLE deptnoADD total_income INT NOT NULL
SELECT empno, ename,…
Chapter 13 Solutions
Database Systems: Design Implementation & Management
Ch. 13 - Prob. 1RQCh. 13 - Prob. 2RQCh. 13 - Prob. 3RQCh. 13 - Prob. 4RQCh. 13 - Prob. 5RQCh. 13 - What is a data warehouse, and what are its main...Ch. 13 - Prob. 7RQCh. 13 - Prob. 8RQCh. 13 - Prob. 9RQCh. 13 - Prob. 10RQ
Ch. 13 - Prob. 11RQCh. 13 - Prob. 12RQCh. 13 - Prob. 13RQCh. 13 - Prob. 14RQCh. 13 - Prob. 15RQCh. 13 - Prob. 16RQCh. 13 - Prob. 17RQCh. 13 - Prob. 18RQCh. 13 - Prob. 19RQCh. 13 - Prob. 21RQCh. 13 - Prob. 22RQCh. 13 - Prob. 23RQCh. 13 - Prob. 24RQCh. 13 - Prob. 25RQCh. 13 - What is the SQL command to list the total sales by...Ch. 13 - What is the SQL command to list the total sales by...Ch. 13 - What is the SQL command to list the total sales by...Ch. 13 - What is the SQL command to list the total sales by...Ch. 13 - What is the SQL command to list the number of...Ch. 13 - What is the SQL command to list the number of...Ch. 13 - What is the SQL command to list the number of...Ch. 13 - Using the answer to Problem 10 as your base, what...
Knowledge Booster
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.Similar questions
- 10. When we find out that there are some miss spellings in the query?arrow_forwardCreate a Queries using the Design View.arrow_forwardTask 2: List the owner number and last name for all owners located in the city of Seattle. Your query should ignore case. For example, a customer with the city Seattle should be included, as should customers whose city is SEATTLE, SEAttle, SeAttle, and so on.arrow_forward
- Task 2: List the customer ID and first and last names for all customers located in the city of Cody. Your query should ignore case. For example, a customer with the city Cody should be included, as should customers whose city is CODY, cody, cOdY, and so on.arrow_forwardTask 18: List the item ID, description, unit price, and category for each item that has a unit price greater than the unit price of every item in category CAT. Use the ALLoperator in your query. Task 20: Repeat Task 18 using the ANY operator. *Both are needed answered but ideally task 20 needs to be done, task 18 is here for task 20arrow_forwardAll the queries should be executed in MySQL and Screen Shot has to be attached for each question.arrow_forward
- The 'customer' table contains ten columns but no rows. The table is then updated with 10 new rows and 3 rows discarded. What is the table'customer's degree and cardinality?arrow_forwardUsing the software.subscription table, pull all columns for subscriptions that have been cancelled. Use the results from the attachment to determine which column you need to filter on in your where clause. This is to write a query in a database.arrow_forwardThisarrow_forward
- What is the result of the query below: SELECT V_CODE, COUNT (P_CODE) FROM PRODUCT HAVING V_CODE != 21344; A) A list of V_CODE, and the number of products for each V_CODE that is equal to 21344. B) An error message. C) A list of V_CODE, and the number of products for each V_CODE that is not equal to 21344. D) The number of counts for each P_CODE that has a V_CODE that is not equal to 21344.arrow_forwardThere are ten columns in the table "customer," yet there is no row. A total of 10 new rows are added to the table, while 3 old ones are removed. What is the table 'customer's' degree and cardinality?arrow_forwardTask 3: The InstantRide Finance team wants to collect the price and discount information with the driver names for each travel in the system. You need to return the TRAVEL_ID, DRIVER_FIRST_NAME, DRIVER_LAST_NAME, TRAVEL_PRICE, and TRAVEL_DISCOUNT information from the TRAVELS and DRIVERS tables combined over DRIVER_ID field with the ON keyword. Task: Calculate each user's price and discount information. (SQL Database Test)arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology PtrDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781305627482Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781285196145Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos CoronelPublisher:Cengage Learning
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Cengage Learning
SQL Basics for Beginners | Learn SQL | SQL Tutorial for Beginners | Edureka; Author: edureka;https://www.youtube.com/watch?v=zbMHLJ0dY4w;License: Standard YouTube License, CC-BY