Write a query to display the minimum price of tablets which status is abundant. Write a query to display the total price of tablets which their amount is more than 50 and their supplier address is Amman. Write a query to display the cities and number of suppliers located in them. Determine the number of specialties for teachers without listing them. Write a query to display the supplier name and the highest tablet price that has been supplied by that supplier. Exclude any group where the minimum price is less than $15. Write a query to display the supplier ID and the average amount of tablets belongs to this supplier, exclude any tablet which price is less than ‘tablet4’.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

DATABASE SQL

TABLES:

drop table tech_supplier cascade constraints;
drop table teacher cascade constraints;
drop table student cascade constraints;
drop table tablet cascade constraints;
drop table tablet_amountstatus cascade constraints;
create table tech_supplier(supplier_id number(5) primary key,supplier_name varchar2(15),address varchar2(15));
insert into tech_supplier values(201,'ali','Amman');
insert into tech_supplier values(202,'omar','Zarqa');
insert into tech_supplier values(203,'hend','Irbid');
insert into tech_supplier values(204,'bana','Amman');
insert into tech_supplier values(205,'zaid',null);
-----------------------------------------------------------------------------------------------------------------------
create table teacher(id number(5) primary key,name varchar2(15),specialty varchar2(25));
insert into teacher values(121,'said','physics');
insert into teacher values(122,'reem','math');
insert into teacher values(123,'ahmad','chymistry');
insert into teacher values(124,'lina','math');
insert into teacher values(125,'saleem','physics');
-----------------------------------------------------------------------------------------------------------------------
create table student(student_id number(5) primary key,first_name varchar2(13),last_name varchar2(13),
mobile varchar2(10),bdate date, t_id number(5) references teacher(id));
insert into student values(1,'asad','ahmad','0713333331','1-feb-10',121);
insert into student values(2,'areej','wajdi','0714444442','3-oct-12',122);
insert into student values(3,'barra','saleem','0715566878','6-jan-10',122);
insert into student values(4,'fadi','fadi','0716671888','7-jan-09',122);
insert into student values(5,'fars','moneer','0711111119','11-jan-11',123);
insert into student values(6,'lama','hani','0712222225','3-jun-11',124);
insert into student values(7,'wael','wael','0713333912','7-dec-10',122);
----------------------------------------------------------------------------------------------------------------------
create table tablet(d_name varchar2(10) primary key,supplier_id number(5) references tech_supplier(supplier_id),
amount number(3), price number(3));
insert into tablet values('tablet1',201,50,300);
insert into tablet values('tablet2',201,60,150);
insert into tablet values('tablet3',203,70,100);
insert into tablet values('tablet4',204,80,200);
insert into tablet values('tablet5',204,10,250);
insert into tablet values('tablet6',204,70,300);
-------------------------------------------------------------------------------------------------------------------
create table tablet_AmountStatus(status varchar2(30) primary key,lower_amount number(3) ,
upper_amount number(3));
insert into tablet_AmountStatus values('not available',0,0);
insert into tablet_AmountStatus values('very few',1,10);
insert into tablet_AmountStatus values('available',11,40);
insert into tablet_AmountStatus values('abundant',41,150);
commit;

 

-------------------------------------------------------------------------

The tables are student, teacher, tablet, tablet_amountstatus, tech_supplier

  1. Write a query to display the minimum price of tablets which status is abundant.

  2. Write a query to display the total price of tablets which their amount is more than 50 and their supplier address is Amman.

  3. Write a query to display the cities and number of suppliers located in them.

  4. Determine the number of specialties for teachers without listing them.

  5. Write a query to display the supplier name and the highest tablet price that has been supplied by that supplier. Exclude any group where the minimum price is less than $15.

  6. Write a query to display the supplier ID and the average amount of tablets belongs to this supplier, exclude any tablet which price is less than ‘tablet4’.

Expert Solution
steps

Step by step

Solved in 2 steps with 6 images

Blurred answer
Knowledge Booster
SQL Query
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY