DATABASE SYSTEMS (LL)-W/ACCESS>CUSTOM<
15th Edition
ISBN: 9781337762328
Author: Coronel
Publisher: CENGAGE C
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
write down a query for following .
screen shot attached below kindly refer to it .
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 (LL)-W/ACCESS>CUSTOM<
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
- What is the purpose of the following query?arrow_forwardCreate a Queries using the Design View.arrow_forwardPLZ help with the following: Complete the following query Using this table which you can change to solve the problem. Create table book (title INT, year INT, num INT, subject Varchar); Create table client (CID int,fname varchar(20)lname varchar(10),type varchar(6)); Create table author (year INT, ID INT, fname varchar,lname varchar(10); The question is bellow 1.Solve the following: Choose appropriate data types for each attribute and include primary key and foreign key constraints, Check and Not Null constraints and make the the primary key are : num, Id, cid. The problem is below The faculty and students (we refer to them in our system as clients) can electronically check out any book at any time. A book must have at least one author but can have more authors. An author must have written at least one book or more to be included in the system. A book may have never been checked out, but can be checked out many times by the same client or different clients over time. A client may have…arrow_forward
- Could you do typing the query here please?arrow_forwardTask 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 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
- 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_forwardquestion 8 please use the picture below to answer the following question Write a SQL statement to modify the Position table in order to define a constraint to ensure that the column position receives only values 'Sales Rep' or 'Manager'.arrow_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_forwardyour submission will be the query that you would write that would return the needed result Write a query that returns the First_Name and Last_Name of each actor, and the count of the number of times their films have been rented. Write a query that returns the First_Name and Last_Name of the actor, and the count of the number of time their film has been rented, of the actor with the most rentalsarrow_forward1. Write a query to display the author ID, first and last name for all authors that have never written a book with the subject Programming. Sort the results by author last name. (See the figure below for the output) 2. Write a query to display the book number, title, subject, author last name, and the number of books written by that author. Limit the results to books in the Cloud subject. Sort the results by book title and then author last name. (See the figure below for the output) 3. Write a query to display the lowest average cost of books within a subject and the highest average cost of books within a subject. (See the figure below for the output)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