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

Database assignment 11 using heritage data release 1 in

Database Assignment 1: 1. Using heritage data (release 1) in SQL a. Find support for all single itemsets b. List all itemsets with 2 elements and support of at least 0.2 c. List all itemsets with 3 elements and support a ...

Given the relations below create the database tables using

Given the relations below, create the database tables using SQL DDL (Data Definition Language). Assume the following attribute data types: STUDENT (StudentID, StudentName) StudentID StudentName 38214 Alvaro 54907 Letterm ...

Sql assignmentwrite 10 sql statements against the student

SQL Assignment Write 10 SQL statements against the STUDENT schema you created for practice lab 1. Your statements should run error-free and should be valid. Submit two separate files: one plain text file (.txt or .sql fi ...

Assignmentwrite sql queries for the books database

Assignment Write SQL queries for the books database (discussed in Section 18.3) that perform each of the following tasks: a) Select all authors from the Authors table with the columns in the order lastName, firstName and ...

Assignmentthe following data model is designed to hold

Assignment The following data model is designed to hold information relating to Students, Student Courses and Tutors who deal with these students. For this scenario we need to define the following facts: The Entities req ...

Movie theater database sql commandswrite the sql data

Movie Theater Database: SQL Commands Write the SQL Data Definition Language (DDL) commands to create the movie theater database based upon the below Entity Relationship Model (ERM). Be sure to include commands to create ...

Projectcomplete the following queries using hr schema

Project Complete the following queries using HR Schema. Submit your answer in the form of a SQL text file to the Final Project Dropbox. 1. Show first name, last name, start date and end date for all employees. The dates ...

Structured query language sqlrefer to the database design

Structured Query Language (SQL) Refer to the database design crested in Lab 2: Modifying a Database Design to complete this Lab. Perform the following steps in MySQL: 1. Create the tables and relationships from the datab ...

Consider a typical sales invoice that would include the

Consider a typical sales invoice that would include the following information. Design a single table to hold all of the information required to store an invoice including this information. Next, apply normalization to re ...

Write the sql select statement to display the average rent

Write the SQL SELECT statement to display the average rent of the properties. Use the following PROPERTY table to answer the question: PropertyID Type Rooms Rent 306 Apt 3 550 308 House 6 1000 325 Apt 4 625 397 Apt 3 550 ...

  • 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

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen