Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Apex Oracle on website to do database please help me Vendor VendorID 100 200 VName Titan ABC Manufacturers Sales_Order Order ID 200 201 202

Using Apex Oracle on website to do database please help meimage text in transcribedimage text in transcribed

image text in transcribed
image text in transcribed
Vendor VendorID 100 200 VName Titan ABC Manufacturers Sales_Order Order ID 200 201 202 203 Order Date 2018-01-11 2017-10-21 2016-05-04 2018-02-11 Customer ID 101 102 103 102 What to submit Create a word document having following information: 1. SQL commands used to create above tables [25 Marks] 2. SQL commands used to insert the above tuples in the tables. [15 Marks] 3. Snapshot of the description of each table. To get description, go to SQL workshop SQL Command Type desc table_name [5 Marks] 4. Answer the following [10 Marks]: (a) What would happen when you delete a tuple from customer table with id =101 ? Will it get deleted? If not, then why? (b) What would happen if you insert the below tuple in customer table . Explain. (c) What would happen when you delete a tuple from preference table with id = 'P3? Will it affect any other table? If yes, which one and how? (d) What would happen when you delete a tuple from customer table with id =102? Will it affect any other table? If yes, which one and how? (e) What would happen when you delete a tuple from vendor table with id =100? Will it affect any other table? If yes, which one and how? PART B - Basic SQL to understand Constraints Ques 1. (a) Write the SQL statements (SQL Workshop SQL Commands) needed to create the following relations using all required and mentioned constraints. Check the database instance given in part (b) to identify the appropriate data types. Table Name Attributes Constraints Preference PrefID is a primary key. Vendor VendorID is a primary key Customer 1. PrefID 2. PrefName 1. VendorID 2. VName 1. Customer ID 2. Customer_Name 3. Customer_Age 4. Customer City 5. Customer_Preference Customer_ID is Primary key No two customers can have same age Set default value of Customer_Preference as 'PPPP Customer_Preference is a foreign key. Sales Order 1. Order_ID 2. Order_Date 3. Customer ID Order_ID is Primary key For Order_Date, use Date datatype. Customer_ID is a foreign key. Use ON DELETE CASCADE constraint Product_ID is Primary key For Standard_Price, use REAL datatype. Vendor_ID is a foreign key. Product 1. Product_ID 2. Product_Name 3. Standard Price 4. Vendor ID (b) Write SQL commands to insert the below tuples in the relations. Preference Product Pref ID PrefName Prod ID Product Name Standard Price Vendor ID P1 Cash on Delivery 1000 Office Desk 105 100 P2 Online Payment 1001 Managers 209.20 200 P3 Cash on Delivery Desk PPPP Deleted Ones 2000 Office Chair 89.40 NULL 2001 Managers 229 100 Desk Customer Customer ID Customer Name Customer_Age Customer_City Customer Preference 101 102 103 104 105 Simon Goldberg Smith Richard Andrew Catherine Wong Jamie 21 23 34 27 29 New York San Francisco San Diego P1 P2 P1 P1 P3 Vancouver PART B-Basic SQL to understand Constraints Ques 1. (a) Write the SQL statements (SQL Workshop SQL Commands) needed to create the following relations using all required and mentioned constraints. Check the database instance given in part (b) to identify the appropriate data types. Table Name Attributes Constraints Preference PrefiD is a primary key Vendor . Vendor ID is a primary key Customer 1. PrefID 2. PreName 1. VendorID 2 VName 1. Customer 10 2. Customer_Name 3. Customer Age 4. Customer City 5. Customer Preference Customer ID is Primary key No two customers can have same age Set default value of Customer Preference as "PPPP Customer Preference is a foreign key Sales Order 1. Order ID 2. Order Date 3. Customer_10 Order ID is Primary key For Order Date, use Date datatype Customer ID is a foreign key Use ON DELETE CASCADE constraint Product ID is Primary key For Standard_Price, use REAL datatype. Vendor ID is a foreign key. Product 1. Product ID 2. Product Name 3. Standard Price 4. Vendor 10 (b) Write SQL commands to insert the below tuples in the relations Preference Product Pref 10 Pref Name P1 ProdID Cash on Delivery Product Name Standard Price Vendor ID 1000 P2 Office Desk 100 Online Payment 105 1001 Managers 209.20 200 P3 Cash On Delivery Desk PPPP Deleted Ones 2000 ofke Chair 20 NURI 2001 Managers 220 100 Desk Customer Customer 10 Customer Name Customer Age Customer City Customer reference 101 Sinon L New York PI P2 102 Goldberg Smith San Francisco 10 34 PI Richard Ander San Diego 104 Catherine Wong 29 2 105 Jamie Vandort Vendor VendorID VName Sales_Order 100 Order 10 Titan Order Date Customer ID 200 200 2018-01-11 101 ABC Manufacturers 201 2017-10-21 102 202 2016-05-04 103 203 2018-02-11 102 What to submit Create a word document having following information: 1. SQL commands used to create above tables [25 Marks] 2. SQL commands used to insert the above tuples in the tables. [15 Marks) 3. Snapshot of the description of each table. To get description, go to SQL workshop SQL Command Type desc table_name (5 Marks] 4. Answer the following [10 Marks): (a) What would happen when you delete a tuple from customer table with id =101 ? WH it get deleted? If not, then why? (b) What would happen if you insert the below tuple in customer table . Explain. () What would happen when you delete a tuple from preference table with id = *P37 will It affect any other table? If yes, which one and how? (d) What would happen when you delete a tuple from customer table with id 1022 wirit affect any other table? If yes, which one and how? (e) What would happen when you delete a tuple from vendor table with id 1002 Wiwit affect any other table? If yes, which one and how? Vendor VendorID 100 200 VName Titan ABC Manufacturers Sales_Order Order ID 200 201 202 203 Order Date 2018-01-11 2017-10-21 2016-05-04 2018-02-11 Customer ID 101 102 103 102 What to submit Create a word document having following information: 1. SQL commands used to create above tables [25 Marks] 2. SQL commands used to insert the above tuples in the tables. [15 Marks] 3. Snapshot of the description of each table. To get description, go to SQL workshop SQL Command Type desc table_name [5 Marks] 4. Answer the following [10 Marks]: (a) What would happen when you delete a tuple from customer table with id =101 ? Will it get deleted? If not, then why? (b) What would happen if you insert the below tuple in customer table . Explain. (c) What would happen when you delete a tuple from preference table with id = 'P3? Will it affect any other table? If yes, which one and how? (d) What would happen when you delete a tuple from customer table with id =102? Will it affect any other table? If yes, which one and how? (e) What would happen when you delete a tuple from vendor table with id =100? Will it affect any other table? If yes, which one and how? PART B - Basic SQL to understand Constraints Ques 1. (a) Write the SQL statements (SQL Workshop SQL Commands) needed to create the following relations using all required and mentioned constraints. Check the database instance given in part (b) to identify the appropriate data types. Table Name Attributes Constraints Preference PrefID is a primary key. Vendor VendorID is a primary key Customer 1. PrefID 2. PrefName 1. VendorID 2. VName 1. Customer ID 2. Customer_Name 3. Customer_Age 4. Customer City 5. Customer_Preference Customer_ID is Primary key No two customers can have same age Set default value of Customer_Preference as 'PPPP Customer_Preference is a foreign key. Sales Order 1. Order_ID 2. Order_Date 3. Customer ID Order_ID is Primary key For Order_Date, use Date datatype. Customer_ID is a foreign key. Use ON DELETE CASCADE constraint Product_ID is Primary key For Standard_Price, use REAL datatype. Vendor_ID is a foreign key. Product 1. Product_ID 2. Product_Name 3. Standard Price 4. Vendor ID (b) Write SQL commands to insert the below tuples in the relations. Preference Product Pref ID PrefName Prod ID Product Name Standard Price Vendor ID P1 Cash on Delivery 1000 Office Desk 105 100 P2 Online Payment 1001 Managers 209.20 200 P3 Cash on Delivery Desk PPPP Deleted Ones 2000 Office Chair 89.40 NULL 2001 Managers 229 100 Desk Customer Customer ID Customer Name Customer_Age Customer_City Customer Preference 101 102 103 104 105 Simon Goldberg Smith Richard Andrew Catherine Wong Jamie 21 23 34 27 29 New York San Francisco San Diego P1 P2 P1 P1 P3 Vancouver PART B-Basic SQL to understand Constraints Ques 1. (a) Write the SQL statements (SQL Workshop SQL Commands) needed to create the following relations using all required and mentioned constraints. Check the database instance given in part (b) to identify the appropriate data types. Table Name Attributes Constraints Preference PrefiD is a primary key Vendor . Vendor ID is a primary key Customer 1. PrefID 2. PreName 1. VendorID 2 VName 1. Customer 10 2. Customer_Name 3. Customer Age 4. Customer City 5. Customer Preference Customer ID is Primary key No two customers can have same age Set default value of Customer Preference as "PPPP Customer Preference is a foreign key Sales Order 1. Order ID 2. Order Date 3. Customer_10 Order ID is Primary key For Order Date, use Date datatype Customer ID is a foreign key Use ON DELETE CASCADE constraint Product ID is Primary key For Standard_Price, use REAL datatype. Vendor ID is a foreign key. Product 1. Product ID 2. Product Name 3. Standard Price 4. Vendor 10 (b) Write SQL commands to insert the below tuples in the relations Preference Product Pref 10 Pref Name P1 ProdID Cash on Delivery Product Name Standard Price Vendor ID 1000 P2 Office Desk 100 Online Payment 105 1001 Managers 209.20 200 P3 Cash On Delivery Desk PPPP Deleted Ones 2000 ofke Chair 20 NURI 2001 Managers 220 100 Desk Customer Customer 10 Customer Name Customer Age Customer City Customer reference 101 Sinon L New York PI P2 102 Goldberg Smith San Francisco 10 34 PI Richard Ander San Diego 104 Catherine Wong 29 2 105 Jamie Vandort Vendor VendorID VName Sales_Order 100 Order 10 Titan Order Date Customer ID 200 200 2018-01-11 101 ABC Manufacturers 201 2017-10-21 102 202 2016-05-04 103 203 2018-02-11 102 What to submit Create a word document having following information: 1. SQL commands used to create above tables [25 Marks] 2. SQL commands used to insert the above tuples in the tables. [15 Marks) 3. Snapshot of the description of each table. To get description, go to SQL workshop SQL Command Type desc table_name (5 Marks] 4. Answer the following [10 Marks): (a) What would happen when you delete a tuple from customer table with id =101 ? WH it get deleted? If not, then why? (b) What would happen if you insert the below tuple in customer table . Explain. () What would happen when you delete a tuple from preference table with id = *P37 will It affect any other table? If yes, which one and how? (d) What would happen when you delete a tuple from customer table with id 1022 wirit affect any other table? If yes, which one and how? (e) What would happen when you delete a tuple from vendor table with id 1002 Wiwit affect any other table? If yes, which one and how

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

Students also viewed these Databases questions

Question

=+3. Who are the intercessory publics or major opinion leaders?

Answered: 1 week ago

Question

I receive useful feedback about my performance.

Answered: 1 week ago

Question

I am encouraged to offer opinions/suggestions.

Answered: 1 week ago