Write an SQL query that will return only the names of those employees who appear in the overlapping region of the diagram. Note that you will not be able to test it in MySQL. Write an SQL query that will return the names of all employees who have purchased items (are Customers too). Note that you will not be able to test it in MySQL

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
LGBRAND
BRAND_ID DECIMAL (4,0)
BRAND NAME VARCHAR(100)
BRAND_TYPE VARCHAR(20)
Indexes
LGVENDOR
VEND ID DECIMAL60)
VEND NAME VARCHAR(256)
ⒸVEND_STREET VARCHAR(50)
VEND CITY VARCHAR(50)
ⒸVEND_STATE VARCHAR(2)
VEND ZIP VARCHARIS)
Indexes
LGSUPPLIES
PROD SKU VARCHAR(15)
VEND_ID DECIMAL(5.0)
Indexes
LGPRODUCT
PROD_SKU VARCHAR(15)
PROD_DESCRIPT VARCHAR(255)
PROD_TYPE VARCHAR(255)
PROD_BASE VARCHAR(255)
PROD_CATEGORY VARCHAR(255)
PROD_PRICE DECIMAL(10,2)
PROD QOH DECIMAL(10,0)
PROD_MIN DECIMAL(10,0)
BRAND_ID DECIMAL (4,0)
Indexes
LGUINE
INV_NUM DECIMAL(36,0)
LINE_NUM DECIMAL (10,0)
PROD SKU VARCHAR(15)
LINE_QTY DECIMAL(10,0)
LINE PRICE DECIMAL (82)
Index
LGSALARY HISTORY
EMP_NUM DECIMAL(60)
SAL FROM DATE
SAL END DATE
SAL AMOUNT DECIMAL (10,2)
Indexes
LGCUSTOMER
CUST_CODE DECIMAL(38,0)
CUST_FNAME VARCHAR(20)
CUST_LNAME VARCHAR(20)
OCUST STREET VARCHAR(70)
OCUST CITY VARCHAR(50)
CUST_STATE CHAR(2)
CUST ZIP CHAR(S)
CUST BALANCE DECIMAL (8,2)
Indexes
LG DEPARTMENT
DEPT_NUM DECIMAL(5.0)
DEPT NAME VARCHAR(50)
DEPT MAIL BOX VARCHAR(3)
DEPT PHONE VARCHAR(9)
EMP_NUM DECIMAL(60)
Indexes
LGEMPLOYEE
EMP_NUM DECIMAL(0,0)
> EMP_FNAME VARCHAR(20)
EMP_LNAME VARCHAR(25)
> EMP_EMAIL VARCHAR(25)
EMP PHONE VARCHAR(20)
EMP_HIREDATE DATE
EMP TITLE VARCHAR(45)
EMP_COMM DECIMAL (2,2)
>DEPT_NUM DECIMAL (5,0)
Indexes
LGINVOICE
INV NUM DECIMAL 38,0)
INV DATE DATE
CUST_CODE DECIMAL)
INV TOTAL DECIMAL(112)
EMPLOYEE ID DECIMAL (8,0)
Indexes
Transcribed Image Text:LGBRAND BRAND_ID DECIMAL (4,0) BRAND NAME VARCHAR(100) BRAND_TYPE VARCHAR(20) Indexes LGVENDOR VEND ID DECIMAL60) VEND NAME VARCHAR(256) ⒸVEND_STREET VARCHAR(50) VEND CITY VARCHAR(50) ⒸVEND_STATE VARCHAR(2) VEND ZIP VARCHARIS) Indexes LGSUPPLIES PROD SKU VARCHAR(15) VEND_ID DECIMAL(5.0) Indexes LGPRODUCT PROD_SKU VARCHAR(15) PROD_DESCRIPT VARCHAR(255) PROD_TYPE VARCHAR(255) PROD_BASE VARCHAR(255) PROD_CATEGORY VARCHAR(255) PROD_PRICE DECIMAL(10,2) PROD QOH DECIMAL(10,0) PROD_MIN DECIMAL(10,0) BRAND_ID DECIMAL (4,0) Indexes LGUINE INV_NUM DECIMAL(36,0) LINE_NUM DECIMAL (10,0) PROD SKU VARCHAR(15) LINE_QTY DECIMAL(10,0) LINE PRICE DECIMAL (82) Index LGSALARY HISTORY EMP_NUM DECIMAL(60) SAL FROM DATE SAL END DATE SAL AMOUNT DECIMAL (10,2) Indexes LGCUSTOMER CUST_CODE DECIMAL(38,0) CUST_FNAME VARCHAR(20) CUST_LNAME VARCHAR(20) OCUST STREET VARCHAR(70) OCUST CITY VARCHAR(50) CUST_STATE CHAR(2) CUST ZIP CHAR(S) CUST BALANCE DECIMAL (8,2) Indexes LG DEPARTMENT DEPT_NUM DECIMAL(5.0) DEPT NAME VARCHAR(50) DEPT MAIL BOX VARCHAR(3) DEPT PHONE VARCHAR(9) EMP_NUM DECIMAL(60) Indexes LGEMPLOYEE EMP_NUM DECIMAL(0,0) > EMP_FNAME VARCHAR(20) EMP_LNAME VARCHAR(25) > EMP_EMAIL VARCHAR(25) EMP PHONE VARCHAR(20) EMP_HIREDATE DATE EMP TITLE VARCHAR(45) EMP_COMM DECIMAL (2,2) >DEPT_NUM DECIMAL (5,0) Indexes LGINVOICE INV NUM DECIMAL 38,0) INV DATE DATE CUST_CODE DECIMAL) INV TOTAL DECIMAL(112) EMPLOYEE ID DECIMAL (8,0) Indexes
Write an SQL query that will return only the names of those employees who appear in the
overlapping region of the diagram. Note that you will not be able to test it in MySQL.
Write an SQL query that will return the names of all employees who have purchased items (are
Customers too). Note that you will not be able to test it in MySQL
Transcribed Image Text:Write an SQL query that will return only the names of those employees who appear in the overlapping region of the diagram. Note that you will not be able to test it in MySQL. Write an SQL query that will return the names of all employees who have purchased items (are Customers too). Note that you will not be able to test it in MySQL
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Single Table
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.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education