Question
Provide SQL Code Using the SQL code pasted below can you help create a stored procedure for (1) and a single querey code for (2)
Provide SQL Code Using the SQL code pasted below can you help create a stored procedure for (1) and a single querey code for (2) that provides the information? Thank you!
(1).A seller adds two new products. The first is a selfdriving video camera which automatically follows a subject that is being recorded. The second is a holographic keyboard that emits a threedimensional projection of a keyboard and recognizes virtual key presses from the typist. Invoke the stored procedure twice to add these products, keeping in mind that products have at a minimum a name, description, price, and category.
(2.) A seller is considering developing a new electronic product, and requests a list of existing products in the Computers or Electronics categories that cost $30 or less.
Table Creation: CREATE TABLE Sellers( Seller_ID VARCHAR2(50) PRIMARY KEY, Seller_first_name VARCHAR2(50), Seller_last_name VARCHAR2(50), Seller_type_code VARCHAR2(50) ); create table category( category_id number, category_name varchar2(100), category_desc varchar2(100) );
CREATE TABLE Customer( Customer_ID VARCHAR2(50) PRIMARY KEY, Cus_First_name VARCHAR2(50), Cus_Last_name VARCHAR2(50), Phone_Number NUMBER(20), Email_Address VARCHAR2(50) );
CREATE TABLE Addresses( Address_ID VARCHAR2(50) PRIMARY KEY, number_building VARCHAR2(50), Street_name VARCHAR2(50), Apartment_number VARCHAR2(50), City VARCHAR2(50), zipcode VARCHAR2(50), Country_code VARCHAR2(50) );
CREATE TABLE Product( Product_ID VARCHAR2(50) PRIMARY KEY, Product_category_code VARCHAR2(50), total_product_quantity NUMBER(20), seller_id VARCHAR2(50) REFERENCES Sellers(Seller_Id), product_name VARCHAR2(50), product_desc VARCHAR2(200), product_price NUMBER(10), Product_condition_code VARCHAR2(50) );
CREATE TABLE Customer_Orders( Order_id VARCHAR2(50) UNIQUE, customer_Id VARCHAR2(50) REFERENCES Customer(Customer_ID), Cus_Pay_method VARCHAR2(50), Order_price NUMBER(10), Order_status VARCHAR2(50), Ship_speed_code VARCHAR2(50), Order_placed VARCHAR2(50), PRIMARY KEY(Order_id,customer_id) );
CREATE TABLE Customer_Addresses( Customer_id VARCHAR2(50) REFERENCES Customer(Customer_ID), Address_id VARCHAR2(50) REFERENCES Addresses(Address_id), address_type_code VARCHAR2(50), PRIMARY KEY(Customer_id,Address_id) );
CREATE TABLE Customer_order_products( order_id VARCHAR2(50) REFERENCES Customer_Orders(Order_id), Product_id VARCHAR2(50) REFERENCES Product_Warehouse(Product_ID), Product_quantity VARCHAR2(50), PRIMARY KEY(order_id,Product_id) );
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started