Table name: Supplier Column Name Role Data Type Length Constraint supplierID Stores the ID of a supplier Number 10 Primary key supplierFName Stores the first name of a supplier Varchar2 30 Cannot be null supplierLName Stores the last Name of a supplier Varchar2 30 Cannot be null supplierDOB Stores the date of birth of a supplier Date -   supplierNBPro Stores the number of products supplied by a  supplier Number 3 Should be greater than 10   a. Write in SQL a statement that adds a new column named comapnyID of type char(5). This column should be defined as a foreign key that relates the table Supplier to the table Company b. Write in SQL a  query that displays the ids of the suppliers who supply the highest number of products.  c. Create a view named ‘SupplierDetails’ to hold all the details of suppliers whose last names start with ‘bait’ and who supply  between 50 and 200 products.

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter1: Overview Of Database Concepts
Section: Chapter Questions
Problem 5HOA: Access path A database table is composed of records and fields hold data. Data is stored in records....
icon
Related questions
Question

Table name: Supplier

Column Name

Role

Data Type

Length

Constraint

supplierID

Stores the ID of a supplier

Number

10

Primary key

supplierFName

Stores the first name of a supplier

Varchar2

30

Cannot be null

supplierLName

Stores the last Name of a supplier

Varchar2

30

Cannot be null

supplierDOB

Stores the date of birth of a supplier

Date

-

 

supplierNBPro

Stores the number of products supplied by a  supplier

Number

3

Should be greater than 10

 

a. Write in SQL a statement that adds a new column named comapnyID of type char(5). This column should be defined as a foreign key that relates the table Supplier to the table Company

b. Write in SQL a  query that displays the ids of the suppliers who supply the highest number of products. 

c. Create a view named ‘SupplierDetails’ to hold all the details of suppliers whose last names start with ‘bait’ and who supply  between 50 and 200 products.

 

 
Expert Solution
steps

Step by step

Solved in 3 steps

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-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage