Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask PL-SQL Expert

USING ORACLE 11G

Present table creation statements (consisting of constraints) for Database Model. Present them all in a single script file.

Also present a document describeing what test data you employed to test your constraints. This would be data that you aren't including in your insert data for this assignment because you were using it to make sure the constraints were working (that is, as long as everything is working correctly, the database won't accept it).

problem1) Make a database based on the below model.

1296_data base structure.jpg

Save your table creation statements as a script (you'll be submitting this script). Your script must follow the diagram exactly. Be sure to comprise the necessary constraints.

problem2) Make sample data. (See below for some sample data)  Save the scripts that load the data. Test the constraints with appropriate data. The data will be used for the reports described next.

problem3) Make SQL scripts for the assigned reports.

Format: Submit the code to make the tables, insert the sample data, and make reports as scripts. You should submit the code as scripts that the instructor can run from an SQL prompt on an Oracle DBMS. Your submission must include a description of the scripts, their actions, and the order in which they should be run. Your code should not have any "side effects" (that is, it must not do anything not listed in the assignment description, and all of its actions should be describeed in program header).

The code for each part should be submitted as a single text file for that part.
Criteria:

i) Well-written code
ii) Code meets requirements
iii) Good test data

--------------------------------------------------------
--  File created - Saturday-March-30-2013  
--------------------------------------------------------
  DROP TABLE "FACULTY" cascade constraints;
  DROP TABLE "STUDENT" cascade constraints;
--------------------------------------------------------
--  DDL for Table FACULTY
--------------------------------------------------------

  CREATE TABLE "FACULTY"
   (    "FACULTYID" VARCHAR2(6),
    "FACULTYNAME" VARCHAR2(45),
    "OFFICETELEPHONENUMBER" VARCHAR2(15),
    "OFFICENUMBER" NUMBER(5,0)
   ) ;
--------------------------------------------------------
--  DDL for Table STUDENT
--------------------------------------------------------

  CREATE TABLE "STUDENT"
   (    "STUDENTID" VARCHAR2(6),
    "STUDENTNAME" VARCHAR2(45),
    "FACULTYID" VARCHAR2(6),
    "HOMETELEPHONENUMBER" VARCHAR2(15),
    "HOMEADDRESS" VARCHAR2(45),
    "ENROLMENTSTATUS" VARCHAR2(15)
   ) ;

---------------------------------------------------
--   DATA FOR TABLE FACULTY
--   FILTER = none used
---------------------------------------------------
REM INSERTING into FACULTY
Insert into FACULTY (FACULTYID,FACULTYNAME,OFFICETELEPHONENUMBER,OFFICENUMBER) values ('FAC101','John Breto','83289428492',81);
Insert into FACULTY (FACULTYID,FACULTYNAME,OFFICETELEPHONENUMBER,OFFICENUMBER) values ('FAC102','Agasi Henry','89498340949',24);
Insert into FACULTY (FACULTYID,FACULTYNAME,OFFICETELEPHONENUMBER,OFFICENUMBER) values ('FAC103','Peter William','89489489844',90);
Insert into FACULTY (FACULTYID,FACULTYNAME,OFFICETELEPHONENUMBER,OFFICENUMBER) values ('FAC104','Francis David','98439834982',12);
Insert into FACULTY (FACULTYID,FACULTYNAME,OFFICETELEPHONENUMBER,OFFICENUMBER) values ('FAC105','Victor Beni','98904094099',21);

---------------------------------------------------
--   END DATA FOR TABLE FACULTY
---------------------------------------------------


---------------------------------------------------
--   DATA FOR TABLE STUDENT
--   FILTER = none used
---------------------------------------------------
REM INSERTING into STUDENT
Insert into STUDENT (STUDENTID,STUDENTNAME,FACULTYID,HOMETELEPHONENUMBER,HOMEADDRESS,ENROLMENTSTATUS) values ('STU101','Million Cint','FAC102','98498438934','36, Green Road, NY','Enrolled');
Insert into STUDENT (STUDENTID,STUDENTNAME,FACULTYID,HOMETELEPHONENUMBER,HOMEADDRESS,ENROLMENTSTATUS) values ('STU102','Nilson Stephen','FAC104','98438948943','12, Yellow Road, SYR','Not Enrolled');
Insert into STUDENT (STUDENTID,STUDENTNAME,FACULTYID,HOMETELEPHONENUMBER,HOMEADDRESS,ENROLMENTSTATUS) values ('STU103','Queen Berth','FAC102','45345345345','45, Red Road, FL','Enrolled');
Insert into STUDENT (STUDENTID,STUDENTNAME,FACULTYID,HOMETELEPHONENUMBER,HOMEADDRESS,ENROLMENTSTATUS) values ('STU104','Xavier Ester','FAC101','98489345893','54, Yellow Road, NY','Enrolled');
Insert into STUDENT (STUDENTID,STUDENTNAME,FACULTYID,HOMETELEPHONENUMBER,HOMEADDRESS,ENROLMENTSTATUS) values ('STU105','Benny Jenny','FAC105','89348348488','90, Rose Road, NY','Enrolled');
Insert into STUDENT (STUDENTID,STUDENTNAME,FACULTYID,HOMETELEPHONENUMBER,HOMEADDRESS,ENROLMENTSTATUS) values ('STU106','George Stephen','FAC103','8948438348','120, White Palace, NY','Enrolled');

---------------------------------------------------
--   END DATA FOR TABLE STUDENT
---------------------------------------------------

--------------------------------------------------------
--  Constraints for Table STUDENT
--------------------------------------------------------

  ALTER TABLE "STUDENT" ADD CONSTRAINT "STUDENT_PK" PRIMARY KEY ("STUDENTID", "FACULTYID") ENABLE;

  ALTER TABLE "STUDENT" MODIFY ("STUDENTID" NOT NULL ENABLE);

  ALTER TABLE "STUDENT" MODIFY ("STUDENTNAME" NOT NULL ENABLE);

  ALTER TABLE "STUDENT" MODIFY ("FACULTYID" NOT NULL ENABLE);

  ALTER TABLE "STUDENT" MODIFY ("HOMETELEPHONENUMBER" NOT NULL ENABLE);

  ALTER TABLE "STUDENT" MODIFY ("HOMEADDRESS" NOT NULL ENABLE);

  ALTER TABLE "STUDENT" MODIFY ("ENROLMENTSTATUS" NOT NULL ENABLE);
--------------------------------------------------------
--  Constraints for Table FACULTY
--------------------------------------------------------

  ALTER TABLE "FACULTY" ADD CONSTRAINT "FACULTY_PK" PRIMARY KEY ("FACULTYID") ENABLE;

  ALTER TABLE "FACULTY" MODIFY ("FACULTYID" NOT NULL ENABLE);

  ALTER TABLE "FACULTY" MODIFY ("FACULTYNAME" NOT NULL ENABLE);
--------------------------------------------------------
--  DDL for Index STUDENT_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "STUDENT_PK" ON "STUDENT" ("STUDENTID", "FACULTYID")
  ;
--------------------------------------------------------
--  DDL for Index FACULTY_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "FACULTY_PK" ON "FACULTY" ("FACULTYID")
  ;

--------------------------------------------------------
--  Ref Constraints for Table STUDENT
--------------------------------------------------------
ALTER TABLE "STUDENT" ADD CONSTRAINT "STUDENT_FACULTY_FK1" FOREIGN KEY ("FACULTYID")
  REFERENCES "FACULTY" ("FACULTYID") ENABLE;

PL-SQL, Programming

  • Category:- PL-SQL
  • Reference No.:- M9876

Have any Question? 


Related Questions in PL-SQL

Use mysql workbench for these questions do not use

Use MySQL Workbench for these questions. Do NOT use Lucidchart. MySQL Workbench has more capability than Lucidchart, as it allows creation of DDL SQL from the model. Turn in 1 Workbench file , 1 document with the forward ...

Module triggersmodule overview- in this module you will

Module Triggers Module Overview - In this module you will learn how to write PL/SQL and T-SQL triggers Objectives After completing this module you will be able: - to develop, test and debug Oracle PL/SQL triggers - to de ...

These exercises all use the createmyguitarshopsql links to

These exercises all use the create_my_guitar_shop.sql (Links to an external site.). Write the code for each and save the code (each code segment identified and separated) in Notepad. Submit your completed assignment via ...

The stevens company is converting from the sql server

The Stevens Company is converting from the SQL Server database to the Oracle database. Using the sample shown below, create a Risk Information Sheet for at least five potential risks that might be encountered during the ...

Database assignment aggregate functions nested queries

Database Assignment: Aggregate Functions, Nested Queries, Union, Intersect, Except Name__Shelly Rideout Write the SQL code for the following queries (you do not have to give the results of the query) 1. List the employee ...

Sql fundamentalsprojectwrite a script that will create the

SQL Fundamentals Project Write a script that will create the below tables with the indicated relations. Your script must build a database that contains the tables specified in the diagram. You can use any name for your d ...

Case study susan the sql programmerplease assist with the

Case Study: Susan the SQL Programmer Please assist with the following. CASE EXAMPLE IS ATTACHED AS A .JPG Read the case example about Susan the SQL Programmer on page 6-1 of the Ethical Hacking and Countermeasures: Web A ...

Using the data model shown below write sql statements as

Using the data model shown below write SQL statements as specified below. Some questions may require more than one SQL statement to get the full answer. You may make up whatever data values you like to complete the assig ...

The following assignment is based on the database

The following assignment is based on the database environment created Design and develop the below queries using professional principles and standards: • A set of SQL Statements that returns all rows and all data for eac ...

What is sqlanswer the following question in 500 words or

What is SQL Answer the following question in 500 words or more. You MUST use two outside sources to support your answer. You MUST cite these sources in APA Format. Title page, reference page, or cited sources do not coun ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate