I need to write a SELECT query in SQL using these instructions. Attached is the code that created the tables. SHOW name-of-tech part which are less than $300 and The Name of the Supplier. This will show which supplier has what parts under $300. FOR [Supplier] QUERY WILL USE: JOIN yes SUBQUERY no AGGREGATION no
I need to write a SELECT query in SQL using these instructions. Attached is the code that created the tables. SHOW name-of-tech part which are less than $300 and The Name of the Supplier. This will show which supplier has what parts under $300. FOR [Supplier] QUERY WILL USE: JOIN yes SUBQUERY no AGGREGATION no
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
Related questions
Question
I need to write a SELECT query in SQL using these instructions. Attached is the code that created the tables.
SHOW name-of-tech part which are less than $300 and The Name of the Supplier. This will show which supplier has what parts under $300.
FOR [Supplier]
QUERY WILL USE: JOIN yes SUBQUERY no AGGREGATION no
![CREATE TABLE t_customer (
id INT AUTO_INCREMENT,
fname VARCHAR(30) NOT NULL,
mname VARCHAR (30),
lname VARCHAR(30) NOT NULL,
street VARCHAR(50),
city VARCHAR(50),
st VARCHAR(10),
email VARCHAR (50),
phone VARCHAR (20),
PRIMARY KEY (id)
> ENGINE = innodb;
CREATE TABLE employee(
id INT AUTO_INCREMENT,
fname VARCHAR(30) NOT NULL,
mname VARCHAR (30),
lname VARCHAR(30) NOT NULL,
street VARCHAR (50),
city VARCHAR(50),
st VARCHAR(10),
email VARCHAR (50),
phone VARCHAR (20),
PRIMARY KEY (id)
) ENGINE = innodb;
CREATE TABLE supplier (
id INT AUTO_INCREMENT,
name VARCHAR(50) NOT NULL,
phone VARCHAR (20),
PRIMARY KEY (id)
) ENGINE = innodb;](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ffdd8708c-11a5-4d9b-add1-8d4b47168741%2Fe3f7e6b8-b4c0-460d-9273-cbdc1a383edf%2Fns9j1bu_processed.png&w=3840&q=75)
Transcribed Image Text:CREATE TABLE t_customer (
id INT AUTO_INCREMENT,
fname VARCHAR(30) NOT NULL,
mname VARCHAR (30),
lname VARCHAR(30) NOT NULL,
street VARCHAR(50),
city VARCHAR(50),
st VARCHAR(10),
email VARCHAR (50),
phone VARCHAR (20),
PRIMARY KEY (id)
> ENGINE = innodb;
CREATE TABLE employee(
id INT AUTO_INCREMENT,
fname VARCHAR(30) NOT NULL,
mname VARCHAR (30),
lname VARCHAR(30) NOT NULL,
street VARCHAR (50),
city VARCHAR(50),
st VARCHAR(10),
email VARCHAR (50),
phone VARCHAR (20),
PRIMARY KEY (id)
) ENGINE = innodb;
CREATE TABLE supplier (
id INT AUTO_INCREMENT,
name VARCHAR(50) NOT NULL,
phone VARCHAR (20),
PRIMARY KEY (id)
) ENGINE = innodb;
![CREATE TABLE tech_parts(
id INT AUTO_INCREMENT,
part number INT NOT NULL,
name VARCHAR(30) NOT NULL,
brand VARCHAR(30),
price INT,
bought_date DATE,
cus_id INT,
sup_id INT,
FOREIGN KEY (cus_id) REFERENCES t_customer(id),
FOREIGN KEY (sup_id) REFERENCES supplier(id),
PRIMARY KEY (id)
) ENGINE = innodb;
CREATE TABLE product (
id INT AUTO_INCREMENT,
brand VARCHAR(30),
devicetype VARCHAR(30),
cus_id INT NOT NULL,
emp_id INT NOT NULL,
part_id INT,
FOREIGN KEY (cus_id) REFERENCES t_customer(id),
FOREIGN KEY (emp_id) REFERENCES employee (id),
FOREIGN KEY (part_id) REFERENCES tech_parts(id),
PRIMARY KEY (id)
) ENGINE = innodb;
CREATE TABLE refurbished_item (
id INT AUTO_INCREMENT,
item_source VARCHAR(30) NOT NULL,
brand VARCHAR (30),
device_type VARCHAR(30),
price INT,
t_customer_id INT NOT NULL,
employee_id INT NOT NULL,
FOREIGN KEY (t_customer_id) REFERENCES t_customer(id),
FOREIGN KEY (employee_id) REFERENCES employee (id),
PRIMARY KEY (id)
) ENGINE = innodb;](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ffdd8708c-11a5-4d9b-add1-8d4b47168741%2Fe3f7e6b8-b4c0-460d-9273-cbdc1a383edf%2F4tf3uf39_processed.png&w=3840&q=75)
Transcribed Image Text:CREATE TABLE tech_parts(
id INT AUTO_INCREMENT,
part number INT NOT NULL,
name VARCHAR(30) NOT NULL,
brand VARCHAR(30),
price INT,
bought_date DATE,
cus_id INT,
sup_id INT,
FOREIGN KEY (cus_id) REFERENCES t_customer(id),
FOREIGN KEY (sup_id) REFERENCES supplier(id),
PRIMARY KEY (id)
) ENGINE = innodb;
CREATE TABLE product (
id INT AUTO_INCREMENT,
brand VARCHAR(30),
devicetype VARCHAR(30),
cus_id INT NOT NULL,
emp_id INT NOT NULL,
part_id INT,
FOREIGN KEY (cus_id) REFERENCES t_customer(id),
FOREIGN KEY (emp_id) REFERENCES employee (id),
FOREIGN KEY (part_id) REFERENCES tech_parts(id),
PRIMARY KEY (id)
) ENGINE = innodb;
CREATE TABLE refurbished_item (
id INT AUTO_INCREMENT,
item_source VARCHAR(30) NOT NULL,
brand VARCHAR (30),
device_type VARCHAR(30),
price INT,
t_customer_id INT NOT NULL,
employee_id INT NOT NULL,
FOREIGN KEY (t_customer_id) REFERENCES t_customer(id),
FOREIGN KEY (employee_id) REFERENCES employee (id),
PRIMARY KEY (id)
) ENGINE = innodb;
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
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.Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education