# Register now to access 7 million high quality study materials (What's Course Hero?) Course Hero is the premier provider of high quality online educational resources. With millions of study documents, online tutors, digital flashcards and free courseware, Course Hero is helping students learn more efficiently and effectively. Whether you're interested in exploring new subjects or mastering key topics for your next exam, Course Hero has the tools you need to achieve your goals.

4 Pages

### RDB-fundamentals-2-V-T-V-O

Course: CS 252, Fall 2009
School: East Los Angeles College
Rating:

Word Count: 1056

#### Document Preview

Values, HACD.2: Types, Variables, Operators 02/10/2008 Values, Types, Variables, Operators Hugh Darwen hugh@dcs.warwick.ac.uk www.dcs.warwick.ac.uk/~hugh Anatomy of an Imperative Example: Y := X + 1 ; Denotes a variable An invocation (of +) Denotes a value CS252.HACD: Fundamentals of Relational Databases Section 2: Values, Types, Variables, Operators Denotes current value of a variable An update operator A...

Register Now

#### Unformatted Document Excerpt

Coursehero >> California >> East Los Angeles College >> CS 252

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.
Values, HACD.2: Types, Variables, Operators 02/10/2008 Values, Types, Variables, Operators Hugh Darwen hugh@dcs.warwick.ac.uk www.dcs.warwick.ac.uk/~hugh Anatomy of an Imperative Example: Y := X + 1 ; Denotes a variable An invocation (of +) Denotes a value CS252.HACD: Fundamentals of Relational Databases Section 2: Values, Types, Variables, Operators Denotes current value of a variable An update operator A read-only operator X and 1 are arguments to the invocation of + Y and X+1 are arguments to the invocation of := 1 2 Important Distinctions The following very important distinctions emerge from all this and should be firmly taken on board: Value versus variable Variable versus variable reference Update operator versus read-only operator Operator versus invocation Parameter versus argument Parameter subject to update versus parameter not subject to update A Closer Look at an Operator (+) Look its a relation! a 1 2 2 The predicate: a + b = c Attributes a and b can be considered as the parameters of +. Its also a function: no two tuples with the same a value also have the same b value, so, given an a and a b, we know the c. 3 4 b 2 3 1 c 3 5 3 and so on (ad infinitum) An Operator Definition In Tutorial D: OPERATOR HIGHER_OF ( A INTEGER, B INTEGER ) RETURNS INTEGER ; IF A > B THEN RETURN A ; ELSE RETURN B ; END IF ; END OPERATOR ; So the invocation HIGHER_OF(2,3) = 3 Examples: What Is a Type? A type (= domain) is a named set of values. WEEKDAY: { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday } INTEGER: { , -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, } Monday etc. and -7 etc. are literals. Every value of every type should be able to be denoted by some literal. 5 6 CS252: Fundamentals of Relational Databases 1 HACD.2: Values, Types, Variables, Operators 02/10/2008 What is a Type For? It is for constraining the values permitted for some purpose. For example, constraining: the values that can be assigned to a variable the values that can be substituted for a parameter the values that an operator can yield when invoked the values that can appear for a given attribute of a relation The declared type (of the variable, parameter, operator or attribute) constrains its possible values to be of that type. What is the Type of This? StudentId S1 S1 S2 S3 S4 Name Anne Anne Boris Cindy Devinder CourseId C1 C2 C1 C3 C1 Perhaps RELATION { StudentId SID, Name NAME, CourseId CID } where SID is the declared type of StudentId , NAME that of Name, and CID that of CourseId. 7 8 How to Write This as a Literal? StudentId S1 S1 S2 S3 S4 See next slide Name Anne Anne Boris Cindy Devinder CourseId C1 C2 C1 C3 C1 A Relation Literal in Tutorial D Try: RELATION { TUPLE { StudentId S1, CourseId C1, Name Anne }, TUPLE { StudentId S1, CourseId C2, Name Anne }, TUPLE { StudentId S2, CourseId C1, Name Boris }, TUPLE { StudentId S3, CourseId C3, Name Cindy }, TUPLE { StudentId S4, CourseId C1, Name Devinder } } But this assumes that S1, C1, and Boris are themselves valid literals. They arent in most languages, including Tutorial D. 9 10 Literals for Student Ids, etc Recall the declared of types the attributes: SID, NAME, CID. Suppose that values of type SID are represented by character strings (values of type CHAR). Suppose that character strings are denoted by text in quotes, like this: S1. Then a literal for the student identifier S1 might be: SID ( S1 ) SID ( S1 ) is an invocation of an operator called SID whose single parameter is of type CHAR. We call SID a selector, because it can be used to select any value of type SID. 11 A Tuple Literal From our first try: TUPLE { StudentId S1, CourseId C1, Name Anne } We can now write this as: TUPLE { StudentId SID ( S1 ) , CourseId CID ( C1 ) , Name NAME( Anne ) } and thats just fine. (See the lecture Notes for the relation literal.) 12 CS252: Fundamentals of Relational Databases 2 HACD.2: Values, Types, Variables, Operators 02/10/2008 Types and Representations Consider the invocation SID ( S1 ), a literal of type SID. SID is an operator that, when invoked with a suitable character string, returns a value of type SID. Also, every value of type SID can be denoted by an invocation of operator SID. We call such an operator a selector (for values of the type in question). And the parameters (signature) of a selector we call a possible representation (possrep for short). 13 A Type Definition for SID In Tutorial D: TYPE SID POSSREP SID { C CHAR } CONSTRAINT constraint to specify exactly which strings are suitable ; The definition implies operator definitions: OPERATOR SID ( C CHAR ) RETURNS SID ; OPERATOR THE_C ( S SID ) RETURNS CHAR ; whereby, e.g., THE_C ( SID ( S1 ) ) = S1 14 Type Constraint for SID So, we can write the required type constraint something like this: CONSTRAINT LENGTH ( THE_C ( SID ) ) <= 5 AND LEFT ( THE_C ( SID ) , 1) = S AND DIGITS (SUBSTR ( THE_C (SID, 2 ))) Where: LEFT returns a specified leftmost portion of a string, SUBSTR returns the substring specified by a start position and length (defaulting to length of remainder), and DIGITS returns TRUE iff every character of the given string is a digit. 15 What Is a Variable? Here is a variable declaration in Tutorial D: VAR SN SID INIT SID ( S1 ) ; initial value imperative key word variable name declared type So a variable has a name, a declared type, and a value. The value can change from time to time. The name and type cannot. 16 Updating a Variable A value is assigned to a variable by invoking an update operator. E.g, assignment (available on variables of all types): SN := SID ( S2 ) ; SN := SID ( LEFT ( THE_C (SN), 1 ) || 5 ) ; Additional update operators might be defined, invoked via CALL: CALL SET_DIGITS ( SN , 23 ) ; Pseudovariable assignment might be supported: THE_C ( SN ) := S2 ; SUBSTR (THE_C ( SN ), 2 ) := 23 ; Important Distinctions Arising You should now be able to distinguish clearly between: values and variables values and representations of values types and representations read-only operators and update operators operators and invocations parameters and arguments 17 18 CS252: Fundamentals of Relational Databases 3 HACD.2: Values, Types, Variables, Operators 02/10/2008 EXERCISES (see Notes) 19 CS252: Fundamentals of Relational Databases 4
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:

East Los Angeles College - CS - 252
File: CS252-HACD-Notes5.doc Printed at: 16:14 on Friday, 10 October, 2008CS252:HACD Fundamentals of Relational Databases Notes for Section 5: Relational Algebra Part II 1. Cover slideIn Part I we met JOIN and projection, the relational algebra cou
East Los Angeles College - CS - 118
Lecture 3SeminarsSeminar 2s begin today at 5pm These will take place in the rooms indicated on the timetable You should complete problem sheet 2 Hand in your solutions beforehand if you want feedback Post the solutions in the CS118 letterbox at the
W. Alabama - PSYCH - 353
Confirmation Bias We tend to ask questions that will confirm our hypotheses Snyder &amp; Swan told to find out whether someone is an introvert people tend to ask questions like &quot;what factors make it hard for you to really open up to people?&quot; Told to
East Los Angeles College - CS - 118
Lecture 4You should have done, or be working through, problem sheet 2; next is sheet 3 Coursework - common mistakes do { } while (robot.look(direction) = IRobot.WALL); if (robot.look(IRobot.AHEAD) = IRobot.WALL) { }CS118 Term plannerYou are he
East Los Angeles College - CS - 118
Lecture 6CourseworkWe have covered enough material for Part 1 This lecture will help you start Part 2 You should not need any additional materialLecture 6CourseworkWe have covered enough material for Part 1 This lecture will help you start Part
East Los Angeles College - CS - 118
Lecture 5Coursework: documenting your solutionsImportant: keep a record of your solutions (Ex4.java etc.) Make sure you comment your code Keep a record of any non-program answers (e.g. Ex. 6)Coursework troubleshootingExercise 6 requires you to e
W. Alabama - ME - 269
Tutorial #98.1. At what speed will a 12-pole 60-Hz induction motor operate if the slip is 0.06? (Ans. 564 rpm)8.3. A three-phase induction motor runs at almost 1200 r/min at no load and 1140 r/min at full load when supplied with power from a 60-Hz
W. Alabama - ECE - 710
Slides are from G. H. Freeman and E. R. Vrscay, Wavelet and fractal-based methods for image compression. Short Course, Inst. for Computer Research, Univ. of Waterloo (Waterloo, ON), Jun. 910, 1998 George Freeman 1998Wavelets Signal Processing Fu
W. Alabama - ECE - 710
Slides are from G. H. Freeman and E. R. Vrscay, Wavelet and fractal-based methods for image compression. Short Course, Inst. for Computer Research, Univ. of Waterloo (Waterloo, ON), Jun. 910, 1998 George Freeman 1998Wavelets Signal Processing ba
W. Alabama - ECE - 9531284572
MASSolutions In-Car Satellite AntennaOur company is proud to introduce the worlds most ecient, highest performance, and lowest cost antenna currently available for mobile satellite reception. The newest revolutionary technologies - previously availa
W. Alabama - MATH - 213
University of Waterloo David R. Cheriton School of Computer ScienceMATH 213 Advanced Mathematics for Software Engineers Midterm Exam, Spring 2008June 26, 2008, 6:00-8:00 PM Instructor: Dr. Oleg MichailovichStudents name: Students ID #:Instruc
W. Alabama - ECE - 413
Matlab Tips and TricksGabriel Peyr e gabriel.peyre@polytechnique.fr August 28, 2005First keep in mind that this is not a Matlab tutorial. This is just a list of tricks I have found useful while writing my toolboxes available on the Matlab Central r
W. Alabama - ECE - 443
W. Alabama - ECE - 443
Sensitivity AnalysisUseful for:Analyzing the effect of small variations in element values on the response of a circuit Comparing two designs that have the same response Used in gradient based optimization Analyze the effect of elements with nomin
Allan Hancock College - CCP - 176
Naidoo176-+No-+Talk-+Computational Fluid Dynamics-+A non-staggered central scheme for hyperbolic systems with source terms and applications-+A second order central difference scheme, based on the work of Nessyahu and Tadmor, is derived for
W. Alabama - ME - 269
Lecture Notes ME 269Chapter 6Synchronous MachineAli Naderian2/8/2007ME 269. Synchr. Machine1Classification of AC Rotating Machines Synchronous Machines: Synchronous Generators: A primary source of electrical energy. Synchronous Motor
W. Alabama - ME - 269
University of Waterloo Department of Electrical and Computer EngineeringME 269: Electromechanical Devices and Power ProcessingFinal Examination, W06Time Allowed: 2 hoursName: ID #Instructions:1. Answer all 5 questions. 2. This is a closed
W. Alabama - ECE - 477
Chapter 7 Photonic Transmission Systems (Digital &amp; Analog)Content Digital Photonic transmission System Digital Photonic Receiver (BER, Quantum Limit) Analog Photonic Transmission System Photonic Digital Link Analysis &amp; Design - Link Loss budget
W. Alabama - ECE - 380
E&amp;CE 380 Section 5.Stabilitycomplex GH-plane complex s-planemapping s GH(s)j Im{GH(j ) }-1Re{GH(j ) }RHSCopyright 1998 by William J. Wilson. All rights reservedStability Definitions Bounded Input Bounded Output Stability: A syste
W. Alabama - ECE - 434
Jan. 20th, 2009 ECE 434 Medici Tutorial Introduction: Medici is a 2D device simulator for modeling electrical, optical and thermal characteristics of semiconductor devices such as MOS and bipolar transistors and diodes. For example, Medici can simul
W. Alabama - ECE - 327
ECE-327 Study Hints for Final Exam- overall distribution of marks will match roughly time/pages spent on each topic since the beginning of the term. - final will be mixture of short questions (breadth) and long questions (depth)
W. Alabama - ECE - 327
ECE-327Digital Systems Engineering2008t1 (Winter)Project: Kirsch Edge DetecterDeliverable Dataow Diagram Main Project Report Demo 1 Overview 1.1 Edge Detection . . . . . . 1.2 System Implementation . . 1.3 Running the Edge Detector 1.4 Provid
W. Alabama - ECE - 327
E&amp;CE 327 Midterm Solution2008t1 (Winter)All requests for re-marks must be submitted in writing to Mark Aagaard before noon on Wed March 5. A random collection of midterms were photocopied. Exams that are submitted for re-marking will be veried aga
W. Alabama - ECE - 327
6.5.1 How Data Encoding Can Reduce PowerTwo ways to understand the pattern for Gray-code counting. Both methods are based on noting when a bit in the Gray code toggles from 0 to 1 or 1 to 0. To convert from binary to Gray, a bit in the Gray code to
W. Alabama - ECE - 327
E&amp;CE 427 Final2002t3 (Fall) Mark AagaardInstructions and General Information Write your name and student id number at the bottom of every page. 100 marks total Time limit: 3 hours Calculators are allowed No books, no notes, no computers
W. Alabama - ECE - 327
E&amp;CE 427 Midterm2004t1 (Winter)Instructions and General Information Write your name and student id number at the bottom of every page. 100 marks total Time limit: 1 hour, 30 minutes Calculators are allowed No books, no notes, no computers
W. Alabama - ECE - 327
E&amp;CE 427 Midterm2006t1 (Winter)Instructions and General Information Write your name and UW UserID at the bottom of every page. 100 marks total Time limit: 1 hour, 15 minutes Calculators are allowed No books, no notes, no computers Proctor
W. Alabama - ECE - 327
E&amp;CE 327 Midterm2007t3 (Fall)Instructions and General Information 100 marks total. Time limit: 1 hour, 30 minutes No books, no notes, no computers. Calculators are allowed If you need extra paper, request some from a proctor. Write neatly. To
W. Alabama - ECE - 327
E&amp;CE 427 Midterm2004t3 (Fall)Instructions and General Information 100 marks total Time limit: 1 hour, 30 minutes Calculators are allowed No books, no notes, no computers The proctors and instructors will not answer questions, except in ca
W. Alabama - ECE - 327
E&amp;CE 427 Project: Sobel Edge Detecter2005t3 (Fall)Deliverable Main Project Report Demo Due Date Sunday, Nov. 20 11:59pm 8:30am after project submission Nov 28Dec 4 Submission Method Electronic Drop box SignupContents1 2 3 Introduction Edge Detec
W. Alabama - ECE - 327
P1.6 Delta-Cycle Simulation: PongNote: Corrected Version In the course notes, the last two delta cycles were incorrect. This is the corrected version (2005/10/03) Perform a delta-cycle simulation of the following VHDL code by drawing a waveform diag
W. Alabama - ECE - 327
E&amp;CE 427 Final Solution2005t3 (Fall)Q1 (28 Marks) Short AnswerQ1a (7 Marks) VHDLYou are on the committee to dene a uniquely Canadian hardware description language: CanHDL a hot language from a cool country. One proposal is to restrict the langu
W. Alabama - ECE - 327
E&amp;CE 427 Final2005t3 (Fall)Instructions and General Information100 marks total Time limit: 2.5 hours Calculators are allowed No books, no notes, no computers If you need extra paper, request some from a proctor. Write neatly. The proctors and ins
W. Alabama - ECE - 327
Design Comparison. . One add per clock cyclea b c d e fTwo adds per clock cyclea b c d e f0 10 1+x1+x1+x22+x2+x33+x32+x44+x4+x5 z5 6+x5 z3 4inputs outputs registers adders clock period latency6
W. Alabama - ECE - 327
CHAPTER 1. VHDL54CHAPTER 1. VHDL561.6 1.6.1Details of Process Execution Definitions and AlgorithmProcess Modesactivesu e spatentivd1.6.1.1 tionTemporal Granularities of Simula-postponed resumeacsuspended1.6.1 Definit
W. Alabama - ECE - 327
E&amp;CE 427: Digital Systems EngineeringMark Aagaard 2005t3Fall University of Waterloo Dept of Electrical and Computer Engineering September 5, 2005ii1.6ContentsI Course Notes1 VHDL 1.1 Introduction to VHDL . . . . . . . . . . . . . . . . . . .
W. Alabama - ECE - 327
CONTENTS 1.3.1 Syntactic Categories . . . . . . . . . . . . . . 1.3.2 Library Units . . . . . . . . . . . . . . . . . . 1.3.3 Entities and Architecture . . . . . . . . . . . . 1.3.4 Concurrent Statements . . . . . . . . . . . . 1.3.5 Component Declar
W. Alabama - ECE - 327
1.6.2 Example: Process Executionprocess mode (S=suspended, P=postponend A=active) simulation-step pointer (one per process) P visible-assignment value95PPprovisional-assignment value procA: process (a, b) begin c &lt;= a AND b; U end process; a
W. Alabama - ECE - 327
P3.5 Design a circuit that performs the following operation: p =(a+d)+(b-c)-1)NOTES: 1) You must use registers on all input and output ports. 2) a, b, c, and d are to be implemented as 4-bit signed signals. 3) A2-input 8-bit ALU that supports both
W. Alabama - ECE - 327
E&amp;CE 427: Digital Systems EngineeringMark Aagaard 2005t3Fall University of Waterloo Dept of Electrical and Computer Engineering September 5, 2005iiContentsI Course Notes1 VHDL 1.1 Introduction to VHDL . . . . . . . . . . . . . . . . . . . . .
W. Alabama - ECE - 327
ECE 427 LAB #2Due: Wednesday, October 5, 2005 11:59pm1 Background ReadingIn addition to the handouts for Lab 1, it is recommended that you complete Tut-02x and read the Timing Simulation handout before attempting Lab 2.2 InstructionsRead all i
Neumont - EN - 1976
Neumont - CSC - 1976
W. Alabama - ECE - 327
ECE 427 LAB #3Due: Sunday, October 16, 2005 11:59pm1 Background ReadingIn addition to Tut-01x, Tut-02x, and the handouts for Lab 1 and 2, it is recommended that you read the following before attempting Lab 3. They are available online in the ece4
W. Alabama - ECE - 327
Causes of Latch Inference. .Usually, &quot;latch inference&quot; refers to the unintentional creation of latches. The most common cause of unintended latch inference is missing assignments to signals in if-thenelse and case statements. Latch inference happ
W. Alabama - ECE - 327
P2.4.1 Maximum performanceb c41CHAPTER 2. DESIGN PROBLEMSb c 4 2 0 0 clock cycles ALUs dividers multipliers42ad 1ad-1 xor andData ow for odd caseb cDataow for entire circuitdP2.4.2 Minimum areaWhat is the minimum number of
W. Alabama - ECE - 327
ECE427Lab #11ECE 427 LAB #1Due: Friday, January 20, 2006 11:59pm 1 Background ReadingIt is recommended that you complete Tut-01x and read the following ECE-427 handouts before attempting Lab 1. Solaris Policy Logging into a SunEE Computer
W. Alabama - ECE - 327
E&amp;CE 427 Final2006t1 (Winter)Instructions and General Information 100 marks total Time limit: 2.5 hours Calculators are allowed No books, no notes, no computers If you need extra paper, request some from a proctor. Write neatly. The proctor
W. Alabama - ECE - 327
398CHAPTER 6. POWER ANALYSIS AND POWER-AWARE DESIGNChapter 7 Fault Testing and Testability7.1 Faults and Testing7.1.1 Overview of Faults and Testing7.1.1.1 Faults (Smith 14.3)During manufacturing, faults can occur that make the physical prod
W. Alabama - ECE - 327
ECE427 DIGITAL SYSTEM ENGINEERING LAB-3GREATEST COMMON DIVISOR (GCD) DIGITAL SYSTEM DESIGNDUE Wed Feb 6 11:59pmObjectives 1 Apply digital system design techniques to a math problem. 2 Apply test bench to verify correct operation before implementa
W. Alabama - ECE - 327
ECE 427 LAB #2Due: Monday, October 4, 2004 11:59pm1 Background ReadingIn addition to the handouts for Lab 1, it is recommended that you complete Tut-02x and read the Timing Simulation handout before attempting Lab 2.2 InstructionsRead all inst
W. Alabama - ECE - 327
LEC-18 Preliminaries1LEC-18 Preliminaries3LEC-18: Dataow Diagrams and Clock PeriodsSchedulewk-01 02 wk-03 04 wk-05 06 wk-06 07 VHDL RTL Design Techniques Functional Verication Performance Analysis and Optimization lec-16 Intro to perfo
W. Alabama - ECE - 327
LEC-21 Preliminaries1LEC-21 Preliminaries3LEC-21: Timing Analysis of Storage DevicesAnnouncementsMidterm marking on Thur, hopefully back on Fri Vol II of Course Notes available next Monday Faculty of Engineering planning exercise: look for
W. Alabama - ECE - 327
LEC-16 Preliminaries1LEC-16 Preliminaries3LEC-16: Performance Analysis AnnouncementsMidterm review session today Oct 20 5:30pm (RCH-301) No tutorials this week or next week 414 days + 30 minutesUniversity of WaterlooNo more VHDL in
W. Alabama - ECE - 327
LEC-3 Preliminaries1LEC-3 Preliminaries3LEC-3: Details of Process ExecutionReading for Next Lecture : AnnouncementsSection 1.7 Hardware building blocks Section 1.8 Synthesizable vs Non-Synthesizable CodeUniversity of Waterloo Dept of E
W. Alabama - ECE - 327
Diagonal Left Edge + NEHorizontal Edge +N Derivative Direction -S North010Vertical Edge Derivative W Direction E +Diagonal Right Edge + NWDerivative Direction - SW Northeast110Derivative Direction -SE East000Northwest100Southwest
W. Alabama - ECE - 327
LEC-19:4.5.3Example: From Algorithm to Optimized Dataow (Page 258) 4LEC-19:4.5.3Example: From Algorithm to Optimized Dataow (Page 258) 124.5.3 Example: mized DataowFrom Algorithm to Opti-Register and Datapath Allocationa b d i j kT
W. Alabama - ECE - 327
E&amp;CE 427 Midterm Solution2004t3 (Fall)Q1 (25 Marks) Short AnswersBriey answer each of the following questions. Answers will be marked according to correctness, clarity, and conciseness. You may write in point-form; you do not need to write in com
W. Alabama - ECE - 327
LEC-25 Preliminaries1LEC-25 Preliminaries3LEC-25: Introduction to PowerScheduleUniversity of Waterloo Dept of Electrical and Computer Engineering E&amp;CE 427 Digital Systems Engineering 2004t3Fallwk-01 02 VHDL wk-03 04 RTL Design Techniq
W. Alabama - ECE - 327
W. Alabama - ECE - 327
LEC-32 Preliminaries1LEC-32 Preliminaries3LEC-32: Galois Fields!AnnouncementsKeep the labs clean Be careful with the FPGA boardsFinal review session: Wed Dec 8 5pm6:30pm MC-2065 Aagaards ofce hours (tentative) Mon Dec 6: 10:30am11:30am