Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Log in to your Oracle Account and answer the following questions. Save your answers (the SQL commands) in a file with your student id as

image text in transcribed
Log in to your Oracle Account and answer the following questions. Save your answers (the SQL commands) in a file with your student id as its name. When you finish | send me the file by email (taher.ibr@cas.edu.om) Assume that you have the following database tables: Salesman(salesman id, name, city, commission), primary key is salesman_id Customer(cust_id, cust_name, city, grade, salesman_id), primary key is cust_id Order(odrno cust Id, salesman id amnt, ordDate), primary key is ordNo, cust_id, salesman_id, foreign keys cust_id, salesman_id. SALESMAN CUSTOMER CUST_ID CUS_NAME CITY GRADE SALESMAN_ID CUST_ID CUS_NAME CITY GRADE SALESMAN_ID 100 Ahmed ibri 35 100 Ahmed ibri A 35 200 Ali Muscat 15 200 Muscat 300 Salem Suhar 30 300 Salem Suhar 30 400 Mohammed ibri 400 A 20 Mohammed ibri 20 Nizwa 500 10 Saeed 500 Nizwa Saeed 10 ORD ORDNO CUST_ID SALESMAN_ID AMNT ORDDATE 1 100 10 235.75 10/12/2021 2 200 15 169.23 13/10/2021 3 200 15 316.5 09/01/2021 300 10 426.99 08/09/2021 5 300 20 39.95 07/12/2021 A All B 15 B B B A ma Write SQL commands to : 1. Create the 3 tables. Include primary keys, foreign keys and not null constraints where necessary. (4 marks) 2. Insert the data shown above in the 3 tables. (2 marks) 3- Display names and cities of all salesmen. (2 marks) 4- Add a column DoB of type Date to the table Customer. (2 marks) 5- Display names and cities of salesmen who have amnts more than 250. (2 marks) 6- Create a view SaleOrder that contains names of salesmen, names of customers and the amount of each order for customers who live in Ibri. Display contents of the view

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_2

Step: 3

blur-text-image_3

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

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions