Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Locate and open the Oracle 11.2 SQL Reference Manual online. Keep this open so you can easily find examples for your exam. Find an example

Locate and open the Oracle 11.2 SQL Reference Manual online. Keep this open so you can easily find examples for your exam. Find an example of the INSERT statement. Simply cut and paste an example of INSERT from the documentation here: (5 points)

SELECT title, pubdate

FROM books

Assume you are the manager of a retail chain of stores. You wish to store data about all of your stores and the employees who are assigned to each store. Draw an E-R diagram which represents the relationship between the entities, STORE and EMPLOYEE. (An employee can only be assigned to one store at a time). Use the space below and simply draw it freehand or use your favorite editor to draw it and paste into the document. (5 points)

Create tables for the two entities STORE and EMPLOYEE including primary, foreign key, and other integrity constraints as directed below. Please ADD YOUR FIRST AND LAST INITIAL TO THE TABLE NAMES like STORE_MG and EMPLOYEE_MG.

You MAY use separate ALTER TABLE commands to add the constraints or you may put it all together in a single command for each table as it is created.

STORE_xx table columns: (10 points)

store_number (PK)

store_name not null

street_address

zip_code

grand_open_date use todays date as the default value

CREATE TABLE STORE

( store# NUMBER(2),

store_name VARCHAR2 (10) NOT NULL,

store_address VARCHAR2 (20),

zip_code NUMBER(4),

CONSTRAINT store_number_pk PRIMARY KEY (store#),

CONSTRAINT store_name_uk UNIQUE (store_name) );

EMPLOYEE_xx table columns: (10 points)

Employee number (PK)

Lastname not null

Firstname

Birth_date

Store_number (FK)

Hr_rate( MUST be greater than 7.50)

CREATE TABLE EMPLOYEE

( employee# NUMBER(4),

emlastname VARCHAR2 (20) NOT NULL,

emfirstname VARCHAR2 (20),

store# NUMBER(2),

CONSTRAINT employee#_pk PRIMARY KEY (employee#),

CONSTRAINT store#_fk FOREIGN KEY (store#) );

INSERT at least three rows for your STORE_xx table. (10 points)

Create a sequence, EMPL_SEQUENCE_xx, that begins with 1000 and increments by 10 and uses all other defaults. Use your initials instead of the xx in the sequence name. (5 points)

Select the current value of your sequence. Credit is given for the correct command it does NOT matter what the output value of the sequence is as long as it is displayed along with the correct command. (3 points)

Using the INSERT statement, provide at least three rows for your EMPLOYEE_xx table. (10 points). Use the sequence you created earlier as the value for the employee ID. (2 points)

Add a column to your EMPLOYEE_xx table which can be used to store each employees zip_code. (10 points)

Update two rows in the EMPLOYEE_xx table and assign a zip_code. (you MAY use 2 statements) (10 points)

Delete one of your rows from the EMPLOYEE_xx table. Your choice which one. (10 points)

Drop your EMPLOYEE_xx table and make sure it HAS been purged from the recyclebin. (10 points)

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

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

What are some ways that identities can be stolen?

Answered: 1 week ago

Question

Describe how language reflects, builds on, and determines context?

Answered: 1 week ago