Modern Database Management (12th Edition)
12th Edition
ISBN: 9780133544619
Author: Jeffrey A. Hoffer, Ramesh Venkataraman, Heikki Topi
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 7, Problem 7.7RQ
Program Plan Intro
The meaning of following statement with respect to SQL:
“Any query that can be written using the subquery approach can also be written using the joining approach but not vice versa ”
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Explain the following statement regarding SQL: Any query that can be written using the subquery approach can also be written using the joining approach but not vice versa.
J
SHORTAND NOTATION FOR RELATIONAL SQL TABLES
Notation Example Meaning
Underlined A or A, B The attribute(s) is
(are) a primary key
Superscript name
of relation
AR or AR, BR The attribute(s) is
(are) a foreign key
referencing
relation R
As an example, the schema
R(A, B, C, D, ES)
S(F, G, H)
corresponds to the following SQL tables:
CREATE TABLE R
( A <any SQL type>,
B <any SQL type>,
C <any SQL type>,
D <any SQL type>,
E <any SQL type>,
PRIMARY KEY(A),
FOREIGN KEY (E) REFERENCES S(F)
);
CREATE TABLE S
( F <any SQL type>,
G <any SQL type>,
H <any SQL type>,
PRIMARY KEY(F))
EXERCISE
Consider the following relational schema, representing five relations describing shopping transactions and
information about credit cards generating them [the used notation is explained above].
SHOPPINGTRANSACTION (TransId, Date, Amount, Currency, ExchangeRate, CardNbrCREDITCARD, StoreIdSTORE)
CREDITCARD (CardNbr, CardTypeCARDTYPE, CardOwnerOWNER, ExpDate, Limit)…
sql queries
Employees(EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE,JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID,DEPARTMENT_NAME)Department(DEPARTMENT_ID, DEPARTMENT_NAME, MANAGER_ID, LOCATION_ID)Location(LOCATION_ID,STREET_ADDRESS,POSTAL_CODE,CITY,STATE_PROVINCE,COUNTRY_ID)
Write a query in SQL to display the Entire data of All those employees whoseDEPARTMENT_ID is greater than the DEPARTMENT_ID of all those employees who earn morethan 50,000 per month
Write a query in SQL to display the minimum, maximum salary and DEPARTMENT_NAMEof all those departments whose minimum salary is greater than 4000 in ascending order.
Chapter 7 Solutions
Modern Database Management (12th Edition)
Ch. 7 - Prob. 7.1RQCh. 7 - Prob. 7.2RQCh. 7 - Prob. 7.3RQCh. 7 - Prob. 7.4RQCh. 7 - Prob. 7.5RQCh. 7 - Explain the relationship between EXISTS and...Ch. 7 - Prob. 7.7RQCh. 7 - Prob. 7.8RQCh. 7 - Prob. 7.9RQCh. 7 - Prob. 7.10RQ
Ch. 7 - Under what conditions can a UNION clause be used?Ch. 7 - Prob. 7.12RQCh. 7 - Prob. 7.13RQCh. 7 - List for advantages of SQL-invoked routines.Ch. 7 - Prob. 7.15RQCh. 7 - Prob. 7.16RQCh. 7 - Prob. 7.17RQCh. 7 - Prob. 7.18RQCh. 7 - Prob. 7.19RQCh. 7 - Prob. 7.20RQCh. 7 - Prob. 7.21RQCh. 7 - Prob. 7.22RQCh. 7 - Prob. 7.23RQCh. 7 - This chapter discusses the data dictionary views...Ch. 7 - Prob. 7.25PAECh. 7 - Prob. 7.26PAECh. 7 - Prob. 7.27PAECh. 7 - Are based on the class schedule 3NF relations...Ch. 7 - Prob. 7.29PAECh. 7 - Prob. 7.30PAECh. 7 - Prob. 7.31PAECh. 7 - Are based on Figure 7-17. This problem set...Ch. 7 - Prob. 7.33PAECh. 7 - Prob. 7.34PAECh. 7 - Prob. 7.35PAECh. 7 - Prob. 7.36PAECh. 7 - Prob. 7.37PAECh. 7 - Prob. 7.38PAECh. 7 - Prob. 7.39PAECh. 7 - Prob. 7.40PAECh. 7 - Prob. 7.41PAECh. 7 - Prob. 7.42PAECh. 7 - Prob. 7.43PAECh. 7 - Prob. 7.44PAECh. 7 - Write an SQL query to display the order number,...Ch. 7 - Prob. 7.46PAECh. 7 - Prob. 7.47PAECh. 7 - Prob. 7.48PAECh. 7 - Prob. 7.49PAECh. 7 - Prob. 7.50PAECh. 7 - Write an SQL query to list each customer who...Ch. 7 - Prob. 7.52PAECh. 7 - Modify Problem and Exercise 6-60 so that the list...Ch. 7 - Prob. 7.54PAECh. 7 - Prob. 7.55PAECh. 7 - Prob. 7.56PAECh. 7 - Prob. 7.57PAECh. 7 - Prob. 7.58PAECh. 7 - Prob. 7.59PAECh. 7 - Prob. 7.60PAECh. 7 - Prob. 7.61PAECh. 7 - Prob. 7.62PAECh. 7 - Prob. 7.63PAECh. 7 - Rewrite your answer to Problem and Exercise 6-71...Ch. 7 - Display the customer ID, name, and order ID for...Ch. 7 - Prob. 7.66PAECh. 7 - Prob. 7.67PAECh. 7 - Prob. 7.68PAECh. 7 - Prob. 7.69PAECh. 7 - Prob. 7.70PAECh. 7 - Prob. 7.71PAECh. 7 - Write an SQL query to list the order number,...Ch. 7 - Prob. 7.73PAECh. 7 - Prob. 7.74PAECh. 7 - Prob. 7.75PAECh. 7 - Prob. 7.76PAE
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
- SQL QUERIES Employees(EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE,JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID,DEPARTMENT_NAME)Department(DEPARTMENT_ID, DEPARTMENT_NAME, MANAGER_ID, LOCATION_ID)Location(LOCATION_ID,STREET_ADDRESS,POSTAL_CODE,CITY,STATE_PROVINCE,COUNTRY_ID) Write a Query in SQL to delete the record of all those cities where city name ends with b fromlocations table.arrow_forwardSQL QUERIES Employees(EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE,JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID,DEPARTMENT_NAME)Department(DEPARTMENT_ID, DEPARTMENT_NAME, MANAGER_ID, LOCATION_ID)Location(LOCATION_ID,STREET_ADDRESS,POSTAL_CODE,CITY,STATE_PROVINCE,COUNTRY_ID) Write a query in SQL to display the DEPARTMENT_NAME of all those Departments whoseDEPARTMENT_ID is greater than the DEPARTMENT_ID of Physics department. Write a Query in SQL to show the FIRST_NAME of all those employees whose salary is lessthan the salary of all those employees whose MANAGER_ID is 101 or 102.arrow_forwardSQL optimizer tries to convert queries with nested subqueries into a join operation for better performance True Falsearrow_forward
- Write a PL/SQL block that uses searched CASE statement to classify students based on their scores in a certain test according to the following table: Score Action >= 90 A scholarship is given 80-89 A certificate is given 70-79 A training course is recommended <70 The course should be repeated Write the searched CASE structure only.arrow_forwardTrue or FalseString comparisons in SQL are case sensitive.arrow_forwardPL/SQL Question I need to build pl/sql block that prompts a user for the number of visitors each day for the past 5 days and then displays the average number of visitors per day. For example; day 1: 19 day 2: 21 day 3: 23 ... The avg number of visitors is: ___ like this.arrow_forward
- WorksOn Database: Employee (EmployeeNumber, EmployeeName, BirthDate, Title, Salary, DepartmentNumber) Project (ProjectNumber, ProjectName, Budget, DepartmentNumber) Department (DepartmentNumber, DepartmentName, ManagerNumber) WorksOn (EmployeeNumber, ProjectNumber, Responsibility, Hours) Questions: 1) Write an SQL query that returns the project number and name for projects with a budget no greater than $1,050,000. 2) Write an SQL query that returns all works on records where hours worked is less than 5 and the responsibility is 'Manager'. 3) Write an SQL query that returns the employees (number and name only) who have a title of 'EE' or 'SA' and make more than $50,000. 4) Write an SQL query that returns the employees (name and salary only) in department 'D1' ordered by decreasing salary. 5) Write an SQL query that returns the departments (all fields) ordered by descending department name.arrow_forwardWhat are the advantages of using table-valued parameters in SQL functions?arrow_forwardIn SQL This sample database consists of the following tables(see image for tables and there is one more at the bottom in this text):• Customers: stores customer’s data• Products: stores a list of scale model cars• ProductLines: stores a list of product line categories• Orders: stores sales orders placed by customers• OrderDetails: stores sales order line items for each sales order• Payments: stores payments made by customers based on their accounts• Employees: stores all employee information as well as the organization structuresuch as who reports to whom• Offices: stores sales office data Write SQL code for the following:We want to add a new sale order for the customer (customerNumber = 145) in thedatabase. The steps of adding a sale order are described as follows:(1) Get latest sale order number from “orders” table, and use the next sale ordernumber as the new sale order number(2) Insert a new sale order into “orders” table for the customer (customerNumber =145). For this order, the…arrow_forward
- In SQL This sample database consists of the following tables(see image for tables and there is one more at the bottom in this text):• Customers: stores customer’s data• Products: stores a list of scale model cars• ProductLines: stores a list of product line categories• Orders: stores sales orders placed by customers• OrderDetails: stores sales order line items for each sales order• Payments: stores payments made by customers based on their accounts• Employees: stores all employee information as well as the organization structuresuch as who reports to whom• Offices: stores sales office data Write SQL code for the following:We want to add a new sale order for the customer (customerNumber = 145) in thedatabase. The steps of adding a sale order are described as follows:(1) Get latest sale order number from “orders” table, and use the next sale ordernumber as the new sale order number(2) Insert a new sale order into “orders” table for the customer (customerNumber =145). For this order, the…arrow_forwardWrite the appropriate SQL query for each of the following questions: 1) Display details of ALL the clubs running by the college 2) Display the details of the IT club (IT is the name of the club)arrow_forwardWhat is the purpose of keywords in SQL (Structured Query Language) when writing database queries?arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- 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 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 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
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