Ask Question, Ask an Expert

+61-413 786 465

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

Purpose of the assessment with ulo mapping the purpose of

Purpose of the assessment (with ULO Mapping) The purpose of this assignment is to develop skills in managing data in databases and to gain understanding of data model development and implementation using a commercially a ...

Assignment - queries functions and triggersaimthe aims of

Assignment - Queries, Functions and Triggers Aim The aims of this assignment are to: formulate SQL queries; populate an RDBMS with a real dataset, and analyse the data; design test data for testing SQL queries; create SQ ...

Continuing the project you have worked on in weeks 1-4 in

Continuing the project you have worked on in Weeks 1-4, in this final week, complete the following tasks: Refine your database and SQL statements by incorporating your instructor's feedback. Verify that the database comp ...

Complete the following tasksin microsoft access create the

Complete the following tasks: In Microsoft Access, create the database and tables that you identified in W3 Assignment 2. In Microsoft Word, write the SQL statements to create the database and tables. Write SQL statement ...

For this assignment you will be provided a database backup

For this assignment, you will be provided a database backup for a database called FinanceDB. You will have to restore this backup to your own version of SQL Server. All of the questions in this assignment relate to the F ...

  • 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

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As