Database Concepts (7th Edition)
7th Edition
ISBN: 9780133544626
Author: David M. Kroenke, David J. Auer
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 3, Problem 3.41RQ
Write an SQL statement to display the OwnerLastName, OwnerFirstName, PetName, PetType, PetBreed, and AverageLifeExpectancy for pets with a known PetBreed.
Figure 3-30 BREED Data
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Write an SQL statement to display the OwnerLastName, OwnerFirstName,PetName, PetType, PetBreed, and AverageLifeExpectancy for pets with a known PetBreed
Write an SQL SELECT statement for the following problem statement.
Retrieve the customer name, service description, employee name, employee title, charge identifier, charge start
time, and charge end time. The result should only include billed charges (ChgBilled - True) with a start time in
January 2020. Include a charge even if there is no employee associated with the charge.
For the 3 tables with structure described below, please write SQL statements:
List of products names for a given list of vendor IDs:
How many product types each vendor has:
List all vendors that have more than 2 product types in the system:
How many products (quantity) each vendor has:
The tables schemas are:
ProductTypes
Column name
Column Type
id
number
name
string
dateCreated
date
status
bit
vendorId
number
Vendors
Column name
Column Type
id
number
name
string
Quantities
Column name
Column Type
productId
number
quantity
number
Chapter 3 Solutions
Database Concepts (7th Edition)
Ch. 3 - Prob. 3.1RQCh. 3 - What is a data sublanguage?Ch. 3 - Prob. 3.3RQCh. 3 - Prob. 3.4RQCh. 3 - Prob. 3.5RQCh. 3 - Why do some standard SQL-92 statements fail to run...Ch. 3 - Use the following tables for your answers to...Ch. 3 - Write an SQL CREATE TABLE statement to create the...Ch. 3 - Prob. 3.9RQCh. 3 - Prob. 3.10RQ
Ch. 3 - Prob. 3.11RQCh. 3 - Is PET or PET_2 a better design? Explain your...Ch. 3 - Prob. 3.13RQCh. 3 - Prob. 3.14RQCh. 3 - Prob. 3.15RQCh. 3 - Prob. 3.16RQCh. 3 - Prob. 3.17RQCh. 3 - Write an SQL statement to display the breed, type,...Ch. 3 - Prob. 3.19RQCh. 3 - Prob. 3.20RQCh. 3 - Write an SQL statement to display the breed, type,...Ch. 3 - Write an SQL statement to display the name, breed,...Ch. 3 - Prob. 3.23RQCh. 3 - Prob. 3.24RQCh. 3 - Prob. 3.25RQCh. 3 - Write an SQL statement to display the name and...Ch. 3 - Prob. 3.27RQCh. 3 - Write an SQL statement to count the number of...Ch. 3 - Write an SQL statement to count the number of...Ch. 3 - Prob. 3.30RQCh. 3 - Prob. 3.31RQCh. 3 - Prob. 3.32RQCh. 3 - Prob. 3.33RQCh. 3 - Answer question 3.33, but do not consider any pet...Ch. 3 - Write an SQL statement to display the last name,...Ch. 3 - Write an SQL statement to display the last name,...Ch. 3 - Write SQL statements to (1) create the BREED...Ch. 3 - Prob. 3.38RQCh. 3 - Prob. 3.39RQCh. 3 - Prob. 3.40RQCh. 3 - Write an SQL statement to display the...Ch. 3 - Write SQL statements to add three new rows to the...Ch. 3 - Write SQL statements to add three new rows to the...Ch. 3 - Prob. 3.44RQCh. 3 - Explain what will happen if you leave the WHERE...Ch. 3 - Prob. 3.46RQCh. 3 - Prob. 3.47RQCh. 3 - Prob. 3.48RQ
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Describe a method that can be used to gather a piece of data such as the users age.
Web Development and Design Foundations with HTML5 (8th Edition)
Write a function called c that takes as its argument a d structure as defined in this chapter. The function sho...
Programming in C
Soft Skills 30. You are a member of a standardization committee for a new C++ standard, and there is a proposal...
Starting Out with C++: Early Objects (9th Edition)
When you create a class, it automatically has a toString method and an equals method. Why?
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Use the Web to research the history of the BASIC, C++, Java, and Python programming languages, and answer the f...
Starting Out with Programming Logic and Design (4th Edition)
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
- Write an SQL statement to display the minimum, maximum, and average weight of dogs.arrow_forwardWrite an SQL statement to show the sum of SubTotal for each customer. List CustomerID, LastName, FirstName, Phone, and the calculated result. Name the sum of SubTotal as SumOfSubTotal and sort the results by CustomerID, in descending order.arrow_forwardBased on SQL informationarrow_forward
- Write the following subqueries for these statements in SQL using this ERD diagram 1. CustomerNumberOfOrders: Make a complete list of the customer who placed maximumnumber of orders along with order number. 2. Find the information against those order, whose customer and employee city name issame.Your query must display the OrderNo, Customer CompanyName, Employee FirstName and City. 3. Find the top and least selling Product name. 4. OutOfStockProducts: Make a list of products that are out of stock. 5. Find the employee name who tackle minimum number of orders.arrow_forwardBelow are three tables and their attributes: Table 1: customers ( CustomerID, CustomerName, City, Country) Table 2: orders ( OrderID, ProductID, CustomerID) Table 3: products (ProductID, ProductName, Price, SupplierID) Can you come up with a SQL statement to find all customers who ordered products from a supplier whose SupplierID is '222'. Remove duplicatesarrow_forwardWrite an SQL statement to count the number of distinct breeds.The following table schema for the PET_3 table is another alternate version of the PETtable:PET_3 (PetID, PetName, PetType, PetBreed, PetDOB, PetWeight, OwnerID)Data for PET_3 are shown in Figure 3-20. Except as specifically noted in the question itself, usethe PET_3 table for your answers to all the remaining review questions.arrow_forward
- Write a SQL statement that retrieve all the attributes from employee_tbl and the salary attribute from employee_pay_tbl for the common employees . Assume the emp_id is the common attribute in both the tables. Detailed answer please. I will like correct and detailed answerarrow_forwardI need help with the SQL query for the following question: 1. Get a list of 10 product reviews that got review rating 5 and price more than thousand. Here is the information on the field names: The table name is: Reviews Review Form Fields Product/ModelName: Product/Category: Product/Price: Retailer/Name: Retailer/ZipCode: Retailer/City: Retailer/State: Product/On Sale: Manufacturer/Name: Manufacturer/Rebate: Review/UserId: Review/Rating: Review/Date: Review/Text: Example of Review Form Filled out ProductModelName: Galaxy S4 ProductCategory: Smart Phone ProductPrice: 499 RetailerName: Bestbuy RetailerZipCode: 44114 RetailerCity: Cleveland RetailerState: OH ProductOnSale: No ManufacturerName: Samsung ManufacturerRebate: No ReviewUserId: xmm473 ReviewRating: 3 ReviewDate: 6/10/2012 ReviewText: overheats after 2 hoursarrow_forwardI want solution with steparrow_forward
- Question One From the Salesman and Customer tables below, write SQL statements to do the following: List the salesman id, rating and names of those salesmen who get rating from 3 to 5, sorted DESCENDING by rating. List all the customers’ information whose name starts with ‘F’ and the fourth character is ‘I’, rests may be any character. List the name and country of those customers and salesmen who belongs to the same country.arrow_forwardWrite SQL statement that retrieve the department_name that has the maximum number of employees: Select one: a. select d_name from depart where depart_id=( select depart_id from emp having count(*)= (select max(count(*)) from emp group by depart_id) group by depart_id); b. select depart_name from depart where depart_id=( select depart_id from emp where count(*)= (select max(count(*)) from emp group by depart_id) group by depart_id); c. select depart_name from depart where depart_id=( select depart_id from emp having count(*)= (select max(count(*)) from empl group by depart_id)); d. select depart_name from depart where depart_id=( select depart_id from emp having count(*)= (select max(count(*)) from emp group by depart_id) group by depart_id);arrow_forwardWrite SQL statements to answer each of the following questions. 1. List the Customer Id, Customer Last Name, and Customer City for all customers, sorted by Customer Last Name. 2. List the loan number and loan amount for all loans belonging to branch 1, ordered by loan amount. 3. List the loan number, loan amount from all branches with the branch name "UptownMPL" or "Lucky Spot" (use branch name, if you have a bank with 1000 branches, you are not going to know the branch number for each branch name). 4. List all account numbers for customers that have a state code of MN. 5. List all the loan numbers for the branches in the city of Fargo. 6. For each branch list the branch name, customer name, and customer city for all customers that have a loan at that branch. (note: loans, not accounts)arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database 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 SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher: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
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
How to Design DB Tables for any Application? (The Basics); Author: Studytonight;https://www.youtube.com/watch?v=XUdNVaSikqY;License: Standard YouTube License, CC-BY
Create a Table (Introduction to Oracle SQL); Author: Database Star;https://www.youtube.com/watch?v=BiV1IrzB1sY;License: Standard Youtube License