Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are given a table products with the following structure: create table products ( name varchar ( 2 0 ) primary key, price integer not

You are given a table products with the following structure:
create table products
(
name varchar
(
20
)
primary key, price integer not null, quantity integer not null
)
;
It represents the product types that can be bought in a shop. Each row of the table contains information about a product:
name
-
unique key, name of the product type
price
-
price per single item of this product in dollars
quantity
-
number of items of this product available in the shop
What is the maximum number of items that can be bought by spending at most $
100
?
The items bought can be of different types and their number can't exceed their availability in the shop.
Write an SQL query that finds this number. The result table should comprise one column, quantity, that contains an integer describing the maximum number of items that can be bought with $
100

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learn To Program Databases With Visual Basic 6

Authors: John Smiley

1st Edition

1902745035, 978-1902745039

More Books

Students also viewed these Databases questions