ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 9 Weeks Ago, 4 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 23 Apr 2017 My Price 9.00

a simple movies database

I'm currentley using Oracle 11g.

 

Study the movie database code in movies.sql so that you know how command file works. In particular, consider the purpose of the StatusValue table.

Try the following, noting what happens and why. Store your DDL/DML commands along with explanations of how/why they work

  • Try adding records to the movie relation that cause these intra-relation issues:a repeated primary key value
  • a NULL primary key value
  • a repeated primary key value
  • a NULL primary key value
  • a violation of a CHECK constraint
  • a violation of an SQL datatype constraint
  • a negative score value

 

-- This command file loads a simple movies database, dropping any existingtables-- with the same names, rebuilding the schema and loading the data fresh.---- Drop current databaseDROP TABLE Casting;DROP TABLE Movie;DROP TABLE Performer;-- Create database schemaCREATE TABLE Movie (id integer,title varchar(70) NOT NULL,year decimal(4),score float,votes integer,PRIMARY KEY (id),CHECK (year > 1900));CREATE TABLE Performer (id integer,name varchar(35),PRIMARY KEY (id));CREATE TABLE Casting (movieId integer,performerId integer,status varchar(6),FOREIGN KEY (movieId) REFERENCES Movie(Id) ON DELETE CASCADE,FOREIGN KEY (performerId) REFERENCES Performer(Id) ON DELETE SET NULL,CHECK (status in ('star', 'costar', 'extra')));-- Load sample dataINSERT INTO Movie VALUES (1,'Star Wars',1977,8.9, 2000);INSERT INTO Movie VALUES (2,'Blade Runner',1982,8.6, 1500);INSERT INTO Performer VALUES (1,'Harrison Ford');INSERT INTO Performer VALUES (2,'Rutger Hauer');INSERT INTO Performer VALUES (3,'The Mighty Chewbacca');INSERT INTO Performer VALUES (4,'Rachael');INSERT INTO Casting VALUES (1,1,'star');INSERT INTO Casting VALUES (1,3,'extra');INSERT INTO Casting VALUES (2,1,'star');INSERT INTO Casting VALUES (2,2,'costar');INSERT INTO Casting VALUES (2,4,'costar');

Answers

(11)
Status NEW Posted 23 Apr 2017 02:04 PM My Price 9.00

-----------

Attachments

file 1492958151-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)