Database Systems: Design, Implementation, & Management
13th Edition
ISBN: 9781337627900
Author: Carlos Coronel, Steven Morris
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 7, Problem 5RQ
Using tables named T1 and T2, write a query example for each of the three join types you described in Question 4. Assume that T1 and T2 share a common column named C1.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
The OR_CASE table has one bro per surgical case. The OR_LOG table has one row per surgical log. It's LOG_ID column identifies each log. If a case has an associated log, OR_CASE.LOG_ID will store the logs ID. Otherwise, it will be null. A query uses the following join:
FROM OR_CASE
INNER JOIN OR_LOG
ON OR_CASE.LOG_ID=OR_LOG.LOG_ID
which of the following would be the results?
A. A log with no associated case.B. A log with an associated case.
C. A case with no associated log.D. Rows with no case or log.
Consider the Table: Employee
Write a Query First to Alter Table to add a new Column managername to the employee table
Write an Update query using Self-Join and Case When/Then to update the managername for the respective employees in the managername column. Where there is no manager present, then the CASE When/Then should update the text ‘No Manager’ in the managername column. [Hint: Jennifer has no Manager, everyone else has a manager]
JOIN TABLES
One row in the PAT_ENC table represents one patient encounter. One row in the ORDER MED table
represents one medication order.
One patient encounter can have many medication orders but one medication order can only have one
patient encounter. In other words, the cardinality of this PAT_ENC to ORDER_MED relationship is one-to-
many.
You start a query with PAT_ENC. You then add ORDER_MED using an inner join. What is true about the
granularity of the result set before and after adding the ORDER_MED table?
SELECT ONE OF THE FOLLOWING
A. The granularity stays at one row per patient encounter.
B. The granularity stays at one row per medication order.
C. The granularity changes from one row per patient encounter to one row per medication order on an
encounter.
D. The granularity changes from one row per medication order to one row per patient encounter.
Chapter 7 Solutions
Database Systems: Design, Implementation, & Management
Ch. 7 - Prob. 1RQCh. 7 - Explain why the following command would create an...Ch. 7 - What is a cross join? Give an example of its...Ch. 7 - What three join types are included in the outer...Ch. 7 - Using tables named T1 and T2, write a query...Ch. 7 - Prob. 6RQCh. 7 - Rewrite the following WHERE clause without the use...Ch. 7 - Explain the difference between an ORDER BY clause...Ch. 7 - Explain why the following two commands produce...Ch. 7 - What is the difference between the COUNT aggregate...
Ch. 7 - Prob. 11RQCh. 7 - Prob. 12RQCh. 7 - Prob. 13RQCh. 7 - Prob. 14RQCh. 7 - Prob. 15RQCh. 7 - What does it mean to say that SQL operators are...Ch. 7 - Prob. 17RQCh. 7 - Prob. 18RQCh. 7 - Prob. 19RQCh. 7 - Prob. 20RQCh. 7 - Given the employee information in Question 19,...Ch. 7 - Given the employee information in Question 19,...Ch. 7 - Prob. 23RQCh. 7 - Prob. 24RQCh. 7 - Prob. 25RQCh. 7 - What Oracle function should you use to calculate...Ch. 7 - What string function should you use to list the...Ch. 7 - Prob. 28RQCh. 7 - Given the structure and contents of the...Ch. 7 - Using the EMPLOYEE, JOB, and PROJECT tables in the...Ch. 7 - Write the SQL code that will produce the same...Ch. 7 - Prob. 4PCh. 7 - Write the SQL code to validate the ASSIGN_CHARGE...Ch. 7 - Using the data in the ASSIGNMENT table, write the...Ch. 7 - Prob. 7PCh. 7 - Prob. 8PCh. 7 - Prob. 9PCh. 7 - Prob. 10PCh. 7 - Generate a listing of all purchases made by the...Ch. 7 - Prob. 12PCh. 7 - Prob. 13PCh. 7 - Modify the query in Problem 13 to include the...Ch. 7 - Prob. 15PCh. 7 - Prob. 16PCh. 7 - Prob. 17PCh. 7 - Prob. 18PCh. 7 - Prob. 19PCh. 7 - Prob. 20PCh. 7 - Prob. 21PCh. 7 - Create a query to find the balance characteristics...Ch. 7 - Prob. 23PCh. 7 - Prob. 24PCh. 7 - Prob. 25PCh. 7 - Find the total value of the product inventory. The...Ch. 7 - Prob. 27PCh. 7 - Write a query to display the SKU (stock keeping...Ch. 7 - Prob. 29PCh. 7 - Prob. 30PCh. 7 - Prob. 31PCh. 7 - Prob. 32PCh. 7 - Prob. 33PCh. 7 - Prob. 34PCh. 7 - Prob. 35PCh. 7 - Prob. 36PCh. 7 - Prob. 37PCh. 7 - Prob. 38PCh. 7 - Prob. 39PCh. 7 - Prob. 40PCh. 7 - Prob. 41PCh. 7 - Prob. 42PCh. 7 - Prob. 43PCh. 7 - Prob. 44PCh. 7 - Prob. 45PCh. 7 - Prob. 46PCh. 7 - Prob. 47PCh. 7 - Prob. 48PCh. 7 - Prob. 49PCh. 7 - Prob. 50PCh. 7 - Prob. 51PCh. 7 - Prob. 52PCh. 7 - Prob. 53PCh. 7 - Prob. 54PCh. 7 - Prob. 55PCh. 7 - Prob. 56PCh. 7 - Prob. 57PCh. 7 - Prob. 58PCh. 7 - Prob. 59PCh. 7 - Prob. 60PCh. 7 - Prob. 61PCh. 7 - Prob. 62PCh. 7 - Prob. 63PCh. 7 - Prob. 64PCh. 7 - Prob. 65PCh. 7 - Prob. 66PCh. 7 - Prob. 67PCh. 7 - Prob. 68PCh. 7 - Prob. 69PCh. 7 - Prob. 70PCh. 7 - Prob. 71PCh. 7 - Prob. 72PCh. 7 - Prob. 73PCh. 7 - Prob. 74PCh. 7 - Prob. 75PCh. 7 - Prob. 76PCh. 7 - Prob. 77PCh. 7 - Prob. 78PCh. 7 - Prob. 79PCh. 7 - Prob. 80PCh. 7 - Prob. 81PCh. 7 - Prob. 82PCh. 7 - Prob. 83PCh. 7 - Prob. 84PCh. 7 - Prob. 85PCh. 7 - Prob. 86PCh. 7 - Prob. 88PCh. 7 - Prob. 89PCh. 7 - Prob. 90PCh. 7 - Prob. 91PCh. 7 - Prob. 92PCh. 7 - Prob. 93PCh. 7 - Prob. 94PCh. 7 - Prob. 95PCh. 7 - Prob. 96PCh. 7 - Prob. 97PCh. 7 - Prob. 98PCh. 7 - Prob. 99PCh. 7 - Prob. 100PCh. 7 - Prob. 101PCh. 7 - Prob. 102PCh. 7 - Prob. 103PCh. 7 - Prob. 104PCh. 7 - Prob. 105PCh. 7 - Prob. 106PCh. 7 - Prob. 107PCh. 7 - Prob. 108PCh. 7 - Prob. 109P
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
- Using tables named T1 and T2, write a query example for each of the three join types you described in Question 2. Assume that T1 and T2 share a common column named Cl.arrow_forwardAssuming that the CUSTOMER table contains a CUST_AGE attribute, write the query to update the values in that attribute. (Hint: Use the results of the previous query.)arrow_forwardDelete the OWNER_INDEX 3 index from the OWNER table.arrow_forward
- Please writee the SQL queriees: Wrrite a query to display all departments no, which have more-than 2 instructors without using Join or Sub Queries. Wrrite a query to display instructors who have taught course which course id starts except "CS-4". Wrrite a query using Joins to display 2nd lowest salary of instructor using Join. Wrrite a query using Joins to display first name, age and department name of youngest instructor's from each department. Using Joinarrow_forwardThe OR_LOG table has one row per surgical log. The OR_CASE table has one row per surgical case. Its CASE_ID column idenifies each case.If a log has an associated case, OR_LOG.CASE_ID will store the case's ID. Otherwise, it will be NULL. A query uses the following join: FROM OR_LOG INNER JOIN OR_CASEON OR_LOG.CASE = OR_CASE.CASE_ID Which of the following would be in the results? A. A log with no associated caseB. A log associated with a caseC. A case with no associated logD. Rows with no case or logarrow_forwardQuestion 6 List classroom ID, building name, class ID and class description. Use a LEFT JOIN to list all the classrooms in the BSU_Classrooms table and show matching Class ID and class description from the BSU_Class table. Sort results in descending order by classroom ID. Paste the SQL code here: Paste the resulting table here:arrow_forward
- Animal animal_id name adopter_id Adopter adopter_id name Given the above data for an adoption agency, what does the result set for the following query represent? SELECT adopter.name, animal.name FROM Animal CROSS JOIN Adopter; It represents every single Animal in the animal table regardless of whether they have been adopted or not. O It represents every single animal matches with every single adopter. It represents each animal, with the name of their adopter if that has been specified via a Foreign Key. QI 77°F Sunny Imml Warrow_forwardDatabase based questionarrow_forwardStudent: studentNO, firstName, lastName, studentProgram Professor: professorID, professorProgram, professorName Student_professor: studentNO, professorID, mentor Complete the following requirements: Using the UNION operator, do a full outer join to display the student last name and student program as well as the professor name and professor program. No JOIN operator is to be used in this requirement. Create a query/subquery to display student first name, last name and program. The student program must be same as that in the professor table and the professor program name starts with a ‘C’. This query will use a subquery and not a join. Create a query to display the professor ID, professor name and mentor column including records where the professor ID is not on the student_professor table. Note, this will be a left join. Make sure to eliminate duplicates from the output. Display the average age of students in each student program. Display the number of students in the Computer…arrow_forward
- Macleren Assignment:arrow_forwardSQL SUM Problem -SELECT * FROM [Sale Order] INNER JOIN Product ON [Sale Order] productID = Product.productID here i've joined two tables , now what i need to do is sum the productPrice of the rows with the same customerID .. order id and product id are the primary keyarrow_forwardWrite a query which set the following constraints in Customers table (in MySQL). First Name and city must be entered. Last name must be different of each customer.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
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningA 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
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
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