30 Pages

integrityAndSets

Course: CSC 16132, Fall 2009
School: Adelphi
Rating:
 
 
 
 
 

Word Count: 920

Document Preview

Set CSC443 Integrity operations List operations Review Commands: Create Drop Alter Insert Select Syllabus New syllabus in course info Reading this week - 4.1-3; 8.6-8; finishing chap 3 Test: mostly on executing sql statements Integrity - Primary key Primary key uniqueness was serious SQL> insert into odetails values(1020, 10506, 1); 2 insert into odetails * ERROR at line 1: ORA-00001: unique...

Register Now

Unformatted Document Excerpt

Coursehero >> New York >> Adelphi >> CSC 16132

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Set CSC443 Integrity operations List operations Review Commands: Create Drop Alter Insert Select Syllabus New syllabus in course info Reading this week - 4.1-3; 8.6-8; finishing chap 3 Test: mostly on executing sql statements Integrity - Primary key Primary key uniqueness was serious SQL> insert into odetails values(1020, 10506, 1); 2 insert into odetails * ERROR at line 1: ORA-00001: unique constraint (S06_011.SYS_C0016803) violated Integrity - Foreign key Foreign key existence was serious SQL> insert into customers values (1113,'James','123 Park Ave',66666,'333-333-33 33'); insert into customers values (1113,'James','123 Park Ave',66666,'333-333-3333') * ERROR at line 1: ORA-02291: integrity constraint (PEPPERK.SYS_C0016470) violated - parent key not found Integrity - Check or Not Null qoh int check(qoh >= 0), -> set to -3 SQL> insert into parts values (3352,'bolt', -3,55.2,1); insert into parts values (3352,'bolt', -3,55.2,1) * ERROR at line 1: ORA-02290: check constraint (PEPPERK.SYS_C0016465) violated Large Object Types Clob = characters Blob = binary Book_review clob(10KB) Image blob(20MB) Assertions and Domains Domain - a new data type with a predefined check Assertion - statement that the database always validates is true DOES NOT EXIST IN SQL Triggers Procedure to keep tables in balance: First, created a reorder table: SQL> create table reorder 2 (pno number(5) primary key, 3 qty number(38)); Triggers - cont Trigger example: create trigger reorder_rule after update on parts referencing new as nrow for each row when (nrow.qoh < 200) begin insert into reorder values (:nrow.pno, 300); end reorder_rule; Triggers - last one Result: SQL> update parts set qoh = 50 where qoh = 60; 1 row updated. SQL> select * from reorder; PNO QTY ---------- ---------10509 300 Commit and Rollback Transactions - Need all together in order to be in sync. Example: SQL> commit; Commit complete. SQL> update parts set qoh = 30 where qoh = 100; 1 row updated. SQL> select * from parts where qoh = 100; no rows selected Commit & Rollback Cont SQL> rollback; Rollback complete. SQL> select * from parts where qoh = 100; PNO PNAME QOH PRICE OLEVEL ---------- ------------------------------ ---------- ---------- ---------10900 Dr. Zhivago 100 24.99 30 Back into Query Swing List the first name of each student with a grade of less than 75 in any course. List the average grade of each student assuming every component equal weight Change the query above to exclude compname programs and to only show students with avg over 80. Answers Select distinct fname from students s, scores g where s.sid = g.sid and points<75; Select avg(points), sid from scores group by sid; Select avg(points) as pavg, sid from scores where compname != 'programs' by group sid having avg(points) > 80; Set Operations Union Intersect Except Optional: all Union Example: Show the max points from components mixed as another row in scores select * from (select * from scores union all (select 'MAX',term, lineno, compname, maxpoints from components)) order by lineno, compname, sid; Intersect Find all sids with scores: select sid from students intersect select sid from scores; Find all sids with no scores select sid from students where sid not in (select sid from scores intersect select sid from students); Except - Minus Select all students with no grades Select distinct sid from students minus (select sid from scores); SubQueries and Lists Using a sub-query to get one value Select distinct sid from scores where points > (select avg(points) from scores); List Comparison - in Compare to values in a list - in or not in List student first names of sid 1111 and 2222 Select distinct fname from students where SID in (1111, 2222); List Comparison - in Can use a subquery to create the list: List student first names who are enrolled in term f96 Select distinct fname from enrolls where term = f96); You try: List first names of students in course 1030, 1031 and 1035 List Comparison - any, all, some > ,< , <>,=, >=, <= Select scores greater than all in the list: Select distinct sid from scores where points >= all (90, 340, 70) Substitute a query listing all points List Comparison - any, all, some Select scores greater than all in the list: Select distinct sid from scores where points >= all (select points from scores); 1111 You try: List scores less than all in the list List Comparison - any, all, so...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Adelphi - CSC - 443
CSC443Integrity Set operations List operationsReview Commands: Create Drop Alter Insert SelectSyllabus New syllabus in course info Reading this week - 4.1-3; 8.6-8; finishing chap 3 Test: mostly on executing sql statementsIntegrity -
Adelphi - CSC - 16132
The following slides are adapted from: Chapter 6: Entity-Relationship ModelDatabase System Concepts, 5th Ed.Silberschatz, Korth and Sudarshan See www.db-book.com for conditions on re-useChapter 6: Entity-Relationship Models Design Process s Mod
Adelphi - CSC - 443
The following slides are adapted from: Chapter 6: Entity-Relationship ModelDatabase System Concepts, 5th Ed.Silberschatz, Korth and Sudarshan See www.db-book.com for conditions on re-useChapter 6: Entity-Relationship Models Design Process s Mod
Adelphi - CSC - 16132
Introduction to Computers and their ApplicationsCourse Introduction Professor PepperMajor Course Objectivesl Create web sites l Know some of Office l Able to specify your own PC l Familiarity with IT terminology l Investigate IT ethical issues l
Adelphi - CSC - 170
Introduction to Computers and their ApplicationsCourse Introduction Professor PepperMajor Course Objectivesl Create web sites l Know some of Office l Able to specify your own PC l Familiarity with IT terminology l Investigate IT ethical issues l
Adelphi - CSC - 16132
Web Design IntroductionProfessor Pepper2 ComputersYou use two computers to create your web site.PantherYour PCWeb Server, serving all the browsers that ask it for files Remote (far from your PC) Gives your web page to everyone in the world
Adelphi - CSC - 170
Web Design IntroductionProfessor Pepper2 ComputersYou use two computers to create your web site.PantherYour PCWeb Server, serving all the browsers that ask it for files Remote (far from your PC) Gives your web page to everyone in the world
Adelphi - CSC - 16132
Diagram IntroductionPepperCredit to: J.W. Schmidt, F. Matthes, TU Hamburg-Harburg &amp; John Knight &amp;Use CaseClass and Package - OOInteraction / TransitionSome examples First 8 slides plus the sequence diagram of : http:/sunset.usc.edu/class
Adelphi - CSC - 443
Diagram IntroductionPepperCredit to: J.W. Schmidt, F. Matthes, TU Hamburg-Harburg &amp; John Knight &amp;Use CaseClass and Package - OOInteraction / TransitionSome examples First 8 slides plus the sequence diagram of : http:/sunset.usc.edu/class
Adelphi - CSC - 16132
Notes By: Pepper
Adelphi - CSC - 170
Notes By: Pepper
Adelphi - CSC - 16132
Loops 1. Let's get back to our original problem. We want to able to average any number of values. Let's start by outlining our algorithm: 1. Find out how many values there are. 2. Add up all the values. 3. Divide by the number of values 4. Print the
Adelphi - CSC - 171
Loops 1. Let's get back to our original problem. We want to able to average any number of values. Let's start by outlining our algorithm: 1. Find out how many values there are. 2. Add up all the values. 3. Divide by the number of values 4. Print the
Adelphi - CSC - 16132
What is wrong with the following programs, and how do you fix them? 1. boolean stop = false; while(stop= false){ System.out.println(&quot;What is your first name?&quot;); first=keyb.next(); if(first.equals (&quot;end&quot;) { stop= false; System.out.println(&quot;You are fin
Adelphi - CSC - 171
What is wrong with the following programs, and how do you fix them? 1. boolean stop = false; while(stop= false){ System.out.println(&quot;What is your first name?&quot;); first=keyb.next(); if(first.equals (&quot;end&quot;) { stop= false; System.out.println(&quot;You are fin
Adelphi - CSC - 16132
If-else exercises: 1. Redo the pounds to kilogram program written before which was: Our program will convert a weight expressed in pounds into kilograms. a. Our input is the weight in pounds. b. Our output is the weight in kilograms c. We also know t
Adelphi - CSC - 171
If-else exercises: 1. Redo the pounds to kilogram program written before which was: Our program will convert a weight expressed in pounds into kilograms. a. Our input is the weight in pounds. b. Our output is the weight in kilograms c. We also know t
Adelphi - CSC - 16132
SHOPPING LIST EXCEL EXERCISE: Assignment: Create a shopping list with the following features: Heading: &quot;SHOPPING LIST&quot; &quot;&lt;your name&gt;&quot; date Footer: page x of x Column Headings: Item, Section, Quantity Needed and Price. Underline and bold the words in t
Adelphi - CSC - 170
SHOPPING LIST EXCEL EXERCISE: Assignment: Create a shopping list with the following features: Heading: &quot;SHOPPING LIST&quot; &quot;&lt;your name&gt;&quot; date Footer: page x of x Column Headings: Item, Section, Quantity Needed and Price. Underline and bold the words in t
Adelphi - CSC - 16132
Peppers Photo Albumby Kris Pepper CSC170 August 14, 2008TABLE OF CONTENTS Our Family.1 The people..1 The Olive Dog.2 Olive is Crazy..2Pepper AlbumOur FamilyThe peopleKrisCarrie4/23/20091 17397aa973883da8b44064c634421b42b421d339.doc
Adelphi - CSC - 170
Peppers Photo Albumby Kris Pepper CSC170 August 14, 2008TABLE OF CONTENTS Our Family.1 The people..1 The Olive Dog.2 Olive is Crazy..2Pepper AlbumOur FamilyThe peopleKrisCarrie4/23/20091 17397aa973883da8b44064c634421b42b421d339.doc
Adelphi - CSC - 16132
All E-mail is Public (slide 2) No sarcasm No secrets No YELLINGEmail Etiquette (slide 1)&lt; enter your name&gt;Good vs Evil E-mail (replace with slide 3) Make a new slide with a table listing the following side by side and put the good on the lef
Adelphi - CSC - 170
All E-mail is Public (slide 2) No sarcasm No secrets No YELLINGEmail Etiquette (slide 1)&lt; enter your name&gt;Good vs Evil E-mail (replace with slide 3) Make a new slide with a table listing the following side by side and put the good on the lef
Adelphi - CSC - 16132
Web Design IntroductionProfessor Pepper2 ComputersYou use two computers to create your web site.geocitiesYour PCWeb Server, serving all the browsers that ask it for files Remote (far from your PC) Gives your web page to everyone in the worl
Adelphi - CSC - 170
Web Design IntroductionProfessor Pepper2 ComputersYou use two computers to create your web site.geocitiesYour PCWeb Server, serving all the browsers that ask it for files Remote (far from your PC) Gives your web page to everyone in the worl
Adelphi - CSC - 16132
load data infile 'crazy2.txt' into table crazycredits fields terminated by &quot;/&quot; (title, release_date, rev1, rev2, rev3, rev4, rev5, rev6, rev7)
Adelphi - CSC - 391
load data infile 'crazy2.txt' into table crazycredits fields terminated by &quot;/&quot; (title, release_date, rev1, rev2, rev3, rev4, rev5, rev6, rev7)
Adelphi - CSC - 160
CSC 160 Computer Programming for Non-MajorsIntroductionProf. Adam M. Wittenstein adamwittenstein@adelphi.edu http:/www.adelphi.edu/~wittensa/csc160/What's this course about?Fundamentals of computer programming Going from a word problem to a wo
Adelphi - CSC - 160
CSC160 ComputerProgramming forNonMajorsLecture#3a:Stepper,Words,Sentences(continued)Prof.AdamM.Wittenstein Wittenstein@adelphi.edu http:/www.adelphi.edu/~wittensa/csc160/The Debug Button Last class, I said the Simply Scheme mode does not have a
Adelphi - CSC - 160
CSC160 ComputerProgramming forNonMajorsLecture#5:DefiningFunctionsProf.AdamM.Wittenstein Wittenstein@adelphi.edu http:/www.adelphi.edu/~wittensa/csc160/This week. First, we learn how to write number functions Scheme-style. Then, we will write f
Adelphi - CSC - 160
CSC 160 Computer Programming for NonMajorsLecture #9: BooleansProf. Adam M. Wittenstein Wittenstein@adelphi.edu http:/www.adelphi.edu/~wittensa/csc160/Dealing with Conditions To deal with conditions, we need to have a way of saying a condition i
Adelphi - CSC - 160
CSC 160 Computer Programming for Non-MajorsSection 1.2: Drawing a UFOProf. Adam M. Wittenstein adamwittenstein@adelphi.edu http:/www.adelphi.edu/~wittensa/csc160/So far .We can (write a program to): - compute the UFO's locationBut we canno
Adelphi - CSC - 160
Section 1.2: Drawing a UFO (conclusion)Last time.Using figure 1, we can now find a UFO's location (using the X and Y functions). And, we can now draw and erase the UFO on the screen (using the UFO-draw and UFO-erase functions).Today.In pr
Adelphi - CSC - 160
CSC 160 Computer Programming for Non-MajorsDraft Chapter: The UFO ExampleProf. Adam M. Wittenstein adamwittenstein@adelphi.edu http:/www.adelphi.edu/~wittensa/csc160/A Word on ComputersComputers were originally used as number crunchers (to per
Adelphi - CSC - 160
CSC 160 Computer Programming for NonMajorsChapter 6: StructuresProf. Adam M. Wittenstein Wittenstein@adelphi.edu http:/www.adelphi.edu/~wittensa/csc160/Atomic vs. Compound Data So far our input has been a single number. Usually the input is a p
Adelphi - CSC - 160
ProgrammingwithImages (continued)Another teachpack tiles.ss Download from the website: http:/www.adelphi.edu/sbloch/class/171/tiles.plt Save to the folder: C:\ProgramFiles\PLT\Teachpack Open DrScheme. Go to Add Teachpack. Right click on file,
Adelphi - CSC - 160
CSC 160 Computer Programming for NonMajorsLecture #5 (continued): More on Writing FunctionsProf. Adam M. Wittenstein Wittenstein@adelphi.edu http:/www.adelphi.edu/~wittensa/csc160/REVIEW: Names vs. Values When we defined cube, we named the argum
Adelphi - CSC - 160
Section 6.1: Structures (continued)Example 1: in-left-side?; Purpose: To determine whether a point is in the leftmost 150 pixels of the screen. ; Contract : posn -&gt; boolean&quot;Examples of in-left-side?:&quot; (in-left-side? (make-posn 5 7) &quot;should be&quot; t
Adelphi - CSC - 160
CSC 160 Computer Programming for Non-MajorsIntroductionProf. Adam M. Wittenstein adamwittenstein@adelphi.edu http:/www.adelphi.edu/~wittensa/csc160/What's this course about?Fundamentals of computer programming Going from a word problem to a wo
Adelphi - CSC - 160
CSC 160 Computer Programming for NonMajorsLecture #3a: Stepper, Words, SentencesProf. Adam M. Wittenstein Wittenstein@adelphi.edu http:/www.adelphi.edu/~wittensa/csc160/A preview. Last time we called numeric functions, like +, -, *, /, and sqrt.
Adelphi - CSC - 160
CSC 160 Computer Programming for Non-MajorsChapter 2: Numbers, Expressions, and Simple ProgramsProf. Adam M. Wittenstein Wittenstein@adelphi.edu http:/www.adelphi.edu/~wittensa/csc160/Data TypesData is either simple (atomic) or compound. For t
Adelphi - CSC - 160
Section 4.4: Designing Conditional FunctionsREVIEW: Design Recipe V. 2 Figure out precisely what you need to do. 1. Understand the problem 2. Function contract 3. NEW STEP Data Analysis 4. Write examples (in Scheme notation) Tell the computer h
Adelphi - CSC - 160
CSC160 ComputerProgramming forNonMajorsLecture#11:ConditionalsIIProf.AdamM.Wittenstein Wittenstein@adelphi.edu http:/www.adelphi.edu/~wittensa/csc160/Review Functions that need to determine which of several conditions holds for the input are cal
Adelphi - CSC - 160
CSC 160 Fall 2007 Computer Programming for Non-Majors Prof. A. WittensteinContact Information Office: Alumnae Hall 114 Phone: 877-4486 Course Web Page: http:/www.adelphi.edu/~wittensa/csc160/f07 Email: Wittenstein@adelphi.eduOffice Hours MWF 11:00
Adelphi - CSC - 160
Name _Please fill out &amp; hand in on Tues. 9/12CSC 160 Course Preparation Log Week TwoAssignment Old stuff (if not already done): First week readings Start Date / Time _ _ Discussion Board/Essay Read online book Sections 2.0-2.1 Read Simply Schem
Adelphi - CSC - 160
Name _Please fill out &amp; hand in on Friday 8/31CSC 160 Course Preparation Log Week One: August 24-31Assignment Installing files. _ Start Date / Time End Date / Time_ _ __ _ _ _ _ _ _ _Read syllabus._ _Read Joys and Woes._ __Read Secti
Adelphi - CSC - 160
CSC 160 Final Exam TopicsThe exam will be on Tuesday May 16th from 3:30-5:30pm in our usual classroom. The exam will be closed-book, closed-notes, closed-computer. All of the following topics below are fair game for the exam: Data Types SIMPLE (ATOM
Adelphi - KC - 16911
YOGA ZONEKate Cutrone Adelphi University Physical Education: Grade 10Introducti onTasksProcess Evaluatio nConclusion/Referen cesIntroductionYoga is a lifetime activity that anyone at any age can participate in. A yoga practice incorporate
SUNY Albany - FY - 554862
University at Albany State University of New York Economics 803: Advanced Macroeconomics II Fall 2008 Section 7505; TTH 08:45AM-10:05AM HU 128 Instructor: Fang (Annie) Yang Office: BA 123E E-mail: fyang@albany.edu Phone: (518) 5918537 Office Hours: T
SUNY Albany - FY - 803
University at Albany State University of New York Economics 803: Advanced Macroeconomics II Fall 2008 Section 7505; TTH 08:45AM-10:05AM HU 128 Instructor: Fang (Annie) Yang Office: BA 123E E-mail: fyang@albany.edu Phone: (518) 5918537 Office Hours: T
Adelphi - CSC - 16132
Making a Smile FacePepperCode you have DrawingPanel panel = new DrawingPanel (300, 200); Graphics g = panel.getGraphics ( ); /first smiley face g.setColor (Color.YELLOW); g.fillOval (20, 10, 50, 50); g.setColor (Color.BLACK); g.fillOval (32, 25,
Adelphi - CSC - 171
Making a Smile FacePepperCode you have DrawingPanel panel = new DrawingPanel (300, 200); Graphics g = panel.getGraphics ( ); /first smiley face g.setColor (Color.YELLOW); g.fillOval (20, 10, 50, 50); g.setColor (Color.BLACK); g.fillOval (32, 25,
Adelphi - CSC - 16132
BuildingJavaProgramsChapter9:Inheritanceand InterfacesCopyright2006byPearsonEducation1Chapteroutlinebackground categoriesofemployees relationshipsandhierarchiesinheritanceprogramming creatingsubclasses overridingbehavior multip
Adelphi - CSC - 171
BuildingJavaProgramsChapter9:Inheritanceand InterfacesCopyright2006byPearsonEducation1Chapteroutlinebackground categoriesofemployees relationshipsandhierarchiesinheritanceprogramming creatingsubclasses overridingbehavior multip
Adelphi - CSC - 16132
Cumulativesumreading:4.1Copyright2006byPearsonEducation1AddingmanynumbersConsiderthiscodetoaddthreevalues: int num1 = 10; int num2 = 5; int num3 = 15; int sum = num1 + num2 + num3; System.out.println(&quot;The sum is &quot; + sum);Copyright2006byPe
Adelphi - CSC - 171
Cumulativesumreading:4.1Copyright2006byPearsonEducation1AddingmanynumbersConsiderthiscodetoaddthreevalues: int num1 = 10; int num2 = 5; int num3 = 15; int sum = num1 + num2 + num3; System.out.println(&quot;The sum is &quot; + sum);Copyright2006byPe
Adelphi - CSC - 16132
Introduction to Computer ProgrammingClassy Programming Techniques I: Introducing ObjectsWhat is Object-Oriented Programming? Object-oriented programming (or OOP) attempts to allow the programmer to use data objects in ways that represent how they
Adelphi - CSC - 171
Introduction to Computer ProgrammingClassy Programming Techniques I: Introducing ObjectsWhat is Object-Oriented Programming? Object-oriented programming (or OOP) attempts to allow the programmer to use data objects in ways that represent how they
Adelphi - CSC - 16132
Introduction to Computer ProgrammingLooping Around Loops I: Counting LoopsWhy loops? Computers offer several advantages over calculators. If it is necessary, they can perform the same steps over and over again, simply by rerunning the program.
Adelphi - CSC - 171
Introduction to Computer ProgrammingLooping Around Loops I: Counting LoopsWhy loops? Computers offer several advantages over calculators. If it is necessary, they can perform the same steps over and over again, simply by rerunning the program.
Adelphi - CSC - 16132
Introduction to Computer ProgrammingLooping Around Loops II : Conditional LoopsThe Problem with Counting Loops Many jobs involving the computer require repetition, and that this can be implemented using loops. Counting loops allows us to perform