Instructor: Craig Duckett. Lecture 04: Thursday, April 5, Relationships

Size: px
Start display at page:

Download "Instructor: Craig Duckett. Lecture 04: Thursday, April 5, Relationships"

Transcription

1 Instructor: Craig Duckett Lecture 04: Thursday, April 5, 2018 Relationships 1

2 Assignment 1 is due NEXT LECTURE 5, Tuesday, April 10 th in StudentTracker by MIDNIGHT MID-TERM EXAM is LECTURE 10, Tuesday, May 1 st, 2018 Assignment 2 is due LECTURE 12, Tuesday, May 8 th in StudentTracker by MIDNIGHT 2

3 3 x 150 Points (450 points Total) Assignment 1 (Stage 1): DUE LECTURE 5 Tuesday, April 10 th Assignment 2 (Stage 2): DUE LECTURE 12 Tuesday, May 8 th Assignment 3 (Stage 3): DUE LECTURE 20 Tuesday, June 5 th Database Presentation: DUE LECTURE 20 Tuesday, June 5 th 3

4 Tuesday (LECTURE 3) Database Design for Mere Mortals: Chapter 2, 3 Thursday (LECTURE 4) The Language of SQL: Chapter 3: Calculations and Aliases Chapter 4: Using Functions 4

5 Relationships No ICEs Today (Assignment 1 Workday and/or ICE Make-Up Day 5

6 Links of Interest: Join, Alias, Between SQL Joins (W3Schools) SQL INNER JOIN (W3Schools) SQL LEFT JOIN (W3Schools) SQL RIGHT JOIN (W3Schools) SQL FULL OUTER JOIN (W3Schools) SQL JOIN Tutorial (Tech on the Net) SQL JOIN Tutorial (SQL Guides) Using JOINS (TutorialsPoint) INNER JOIN (TutorialsPoint) LEFT JOIN (TutorialsPoint) RIGHT JOIN (TutorialsPoint) FULL JOIN (TutorialsPoint) SQL ALIAS (W3Schools) SQL ALIAS (Tech on the Net) SQL ALIAS (TutorialsPoint) SQL ALIAS (Beginner-SQL-Tutorial) SQL ALIAS (SQL Guides) SQL BETWEEN (W3Schools) SQL BETWEEN (Tech on the Net) SQL BETWEEN (Tizag) SQL Tutorial (Tizag) MySQL Tutorial (Tizag) 6

7 Relationships 7

8 Relationships Last week we talked about Relationships in the earlier section on the features of relational databases, but it's time to get more specific. You're organizing your database into individual tables, and many of these tables will need to know about each other.

9 Relationships Now, if you've started by sketching out a rough Entity Relationship (ER) diagram, you begin by just attempting to show that some kind of relationship exists between your entities, but to get closer to actually building this in a database, we need to say, what these Relationships are. And while it is common in an ER diagram to use a phrase or a verb to describe it like contains or refers to or belongs to that's for your benefit. The database can't describe it that way.

10 Relationships Now, there are only three kinds of relationship of cardinality* between tables in a relational database: one-to-one, one-to-many and many-to-many. Some people might add a fourth of none-at-all. The time to start defining these is yet another example of how you can keep to a process and order when designing databases * See:

11 Relationships First, you sketch out your entities, which will become your tables. Then you're going to define the data, the attribute for those entities, which will become columns in your tables, because only then can you say, which columns will be the primary keys, or if you need to generate primary keys. You can't properly define your relationship until these primary keys are specified.

12 Relationships I'm not trying to pretend that it's a purely linear process. Not all your tables will become obvious in the first couple of steps. When you go through the process of normalization, which we'll get to next week, you'll probably end up with a few new tables. So we will revisit everything we've started to define, but we can still work through a process.

13 Relationships The benefit of specifying our relationships formally in the database, rather than just informally putting things together in an application is that the database management system itself will take care of keeping those relationships valid and meaningful. You can then use those relationships to answer all sorts of questions. Everything from the basic idea of, how many orders has a particular customer had. How many products were in an order? Or say in a game system. What weapons belong to a particular player? How many quests has one player completed compared to another? All the data is stored in these separate tables, but it becomes easy to jump from one to another by following the relationships.

14 Relationships The most typical kind of cardinality in a relational database management system is one-to-many, which is just as easily described as many-to-one. It just depends on which side of the relationship you start at. In the example I showed earlier was perhaps the archetypal one-to-many or many-to-one relationship. Customer and Order, one customer can have many orders. Meaning, one Customer row can be associated with multiple Order rows but each Order row is only for one Customer.

15 One-to-Many Relationships Now creating this relationship depends on us having our primary keys defined first. If you're attempting to describe that we need to link from a row in one table to specific rows in another table, we need a way to get to those specific rows and getting to a specific row takes a primary key. So going into this, we must have our tables with our columns and primary keys at least roughly planned out.

16 One-to-Many Relationships Next, implementing a new one-to-many relationship requires a change to whatever table represents the many side of the relationship. So, to relate Customer and Order tables, I don't need to change anything about the Customer table, that's the one side. I need to add some extra information to the Order table, and it's the key to the Customer table.

17 One-to-Many Relationships So, Customer ID, and this again is called a Foreign Key. It represents a column in this Order table that is a key to a row in a different table. These will specifically refer to one and only one row in the Customer table.

18 One-to-Many Relationships You might find the Customer ID occurs more than once in order, but it's always pointing to only one row in the customer. We always make the change to the many side of the relationship because it's the only way to do it. I can add one column with one value to every Order row that will always point to a correct customer, but I cannot add one column with one value to the Customer row that could point to a variety of different orders.

19 One-to-Many Relationships Now very often, we would use the same column name across both of those tables. So in this case, Customer ID and Customer, Customer ID and Order, but it doesn't have to be the same because we are really making the match on the values in these columns. In some cases, you couldn't use the same name because there'd be a conflict. Perhaps both of these tables were defined with the primary key just called ID, or we couldn't reuse the ID column twice in the Order table. There would be a conflict there, it just wouldn't work. So, we call it something else like Customer ID. It's still a foreign key. It just happens to have a different column name between the different tables.

20 One-to-Many Relationships Another thing that you might see is a completely different name that attempts instead to describe the relationship. So, instead of using Customer ID, we might use something like Placed By as a column name. And Order is Placed By a particular Customer ID. It still refers to a value that's in the ID column in the other table, it's just using a different name. So, the name of the column doesn't have to match but the data type certainly should. It doesn't make sense to have a primary key that's an integer in one table, try and match a column that's described as character data in a different table.

21 One-to-Many Relationships Now it's also very common to have one table that takes part in multiple relationships. So, a customer can have many orders. We go to one-to-many relationship here, but we may decide that our customers can have multiple different addresses they may ship to, so we might add a new table for Address and have another one-to-many relationship between Customer and Address. This is perfectly acceptable and very common.

22 One-to-Many Relationships Another option is that a table that is on the many side of a one-to-many relationship could be on the one side of another. So, for example, Order might be the many side of the customer to order relationship but Order itself could have many order items, so it's on the one side of that relationship. One customer has many orders, one order can contain many order items.

23 One-to-Many Relationships Now as we start to get a bit further, we're going to want to start to diagram these a bit more specifically. I've shown the basics of entity relationship diagrams as they are very simple to just get started conceptually. Basically, boxes with lines between them. Although as you start to more formalize the actual database diagram, you'll see a different kind of layout emerge, and there's no fixed one standard.

24 One-to-Many Relationships You'll see different options used across different database management systems and different charting applications. But they usually boil down to this kind of idea. A box for each table with the name of the table at the top, then we'd have the column names. You may or may not add a little extra to show what kind of data these are, character data, dates, binary, integers, and so on. What is very common is you would add a PK for a Primary Key, and you would add an FK to denote a Foreign Key and then start adding the relationship connector lines between them.

25 One-to-Many Relationships This kind of diagram is very, very common across all relational databases. It's easy to see what tables exist, what columns, what relationships exist between the tables. Now in most relational database management system administration software, there is an option to generate these diagrams from an actual existing database in that server, and the relationships themselves will be shown with these connector lines. Different software tends to generate different looking lines. As I mentioned earlier, some will use the Crow's foot style to show the many part of a one-to-many relationship. Some will show the infinity symbol. There are other ways of doing this, but it's usually not that difficult to pick any one relationship and figure out which way it's going.

26 Relationships It's possible to create one-to-one relationships in your database, but it's actually very unusual and here is why. Let's imagine I'm building an HR database. So, I sketched out a few entities based on real world object. And as part of this system, I figured out I need to keep track of employee data and driver's license information so I'll create two tables just for those pieces of data.

27 One-to-One Relationships But let's say the only reason I need to do this, to keep track of driver's license data is so I can associate a license with an employee for making travel reservations. So, in this system that I'm describing, it's a pure one-to-one relationship. One employee row points to one driver's license row. There are never multiple employees for one driver's license, and there are never multiple licenses for one employee. Now, I understand there are always caveats, so I'm assuming that this system just doesn't care that a few people might possess two licenses for different states or countries. It's trying to model the idea that we need one listed primary driver's license. So, I could create these as two tables with a one-to-one relationship. I could store a foreign key to the driver's license table in my employee row, or I could do it the other way around or in fact, like I'm showing here, I could just use the same primary key for each table, just mapping one row directly to another.

28 One-to-One Relationships But if this is the actual situation that it's a pure one-to-one, then I might as well just combine the two tables and have the driver's license information stored directly in the employee row with no relationship needed. So even if that driver's license might be a physical different entity, this makes a lot more sense to do it this way.

29 One-to-One Relationships One thing to take care of, when you're new to database design, it sometimes happen that you think you've got a one-to-one relationship when you don't. Here is an example where I've seen this happen multiple times. Let's say we're drawing up a fairly basic situation with an Order, an OrderItem, and a Product. There's some kind of relationship here.

30 One-to-One Relationships Order is storing information like an Order ID, a date, a total amount due. Each OrderItem is storing a Foreign Key to order ID, storing a quantity, and product ID because it's linking to a different table product that's storing information like the description in the list price. Now I know there's a relationship between them. And if asked someone to diagram the probable relationships in between basic entities like this, I usually have something that goes this way. They know it's a one-to-many between Order and OrderItem. Okay, one order can contain multiple OrderItems and then they take the OrderItem which is for a product so it has a product key and a quantity. And the reasoning often goes, well, one OrderItem is for one and only one product so it's a one-to-one. But of course it isn't.

31 One-to-One Relationships What they've correctly determined is that it is a two-one relationship, meaning an OrderItem is for one and only one product but they haven't looked at it the other way, that the same product can be associated with multiple OrderItems.

32 One-to-One Relationships So, this really is a many-to-one. It's going from OrderItem to product and a one-to-many going from product to OrderItem. One product could be ordered multiple times. So, make sure that you're looking at your relationship both ways, particularly when you think you have found a oneto-one.

33 Relationships While I went through an example of a many-to-many relationship earlier, it's worth going through again, particularly if you're new to database design. So, I had used the example of author and book that one author could write multiple books, but also one book could be written by multiple authors. So, this is a many-to-many business scenario.

34 Many-to-Many Relationships I'm going to use a different business problem to describe at this time around, in this case, a database for a training center. So, let's imagine we have two tables right now, Class and Student. Class includes the information like a title of a training course, what date it's on, what classroom it's in, and the Student is just exactly the information you would imagine, first name, last name, , and so on. And what I want to describe is a relationship between them, that a class can be attended by multiple students but that also a student could take multiple different classes. It is a many-to-many relationship.

35 Many-to-Many Relationships And I cannot add one column to either table that would successfully represent all the possible combinations because if I had a StudentID column to the Class table, then I can only have on student in each class. If add a ClassID column to the Student table, then I can say that each student can only take one class. So once again, in relational database, you cannot represent a many-to-many relationship directly.

36 Many-to-Many Relationships You need to create a new table to link the two, in several names with this kind of table, a joining table, a joint table, a junction table, a linking table, a bridging table, a cross-reference table, it really doesn't matter, what ever you prefer. By convention, the name of this table is just usually made up by taking the names of the two tables that it's cross-referencing and putting them together. So in this case, ClassStudent, or StudentClass, either would work. And there's a one-tomany relationship from Class, the ClassStudent linking table, and another one-to-many relationship from the Student table to the ClassStudent table. But this linking table doesn't contain any other data than just two columns.

37 Many-to-Many Relationships One of those columns is a Foreign Key to the Class table with ClassID, the other is a Foreign Key to Student with StudentID, and this is how we represent a many-to-many relationship. So, if I want to take Student ID 102, Viola, and say that she takes multiple classes. Then what I need is multiple rows in that liking table both referring to Student ID 102 but referring to different Class IDs, in this case, 441 and 442, one student, multiple classes. And if I want to go the other way taking one class, say the database design class, Class ID 441, I'll take that over into the linking table, find all the rows with 441, find the student for those rows, 102, 101, 103, and just map those to the Student table, one class, multiple students.

38 Relationships So, why do we go to all this trouble? Well, it's usually easy to understand that relationships are a convenient way to link from one table to another. For a customer, we can just get all the orders.

39 Relationships Well, just as important, if not more so is the idea that a relationship describes a rule, a constraint that I cannot violate, that I now must not have an order row for a customer that doesn't exist.

40 Relationships The database will not let me add a new order row with a Customer ID 388 if there is no Customer ID 388 in the Customer table. I may say but I'm just about to add that customer, but at that moment the database would be no longer valid. It would no longer be internally consistent. This is what's considered a referential constraint. It's a rule that applies between tables where each table isn't just applying the rules of its own column definitions, but it's also cross-referencing the data in the Customer table to make sure that this is or is not allowed. If there isn't a Customer ID 388, you would not be able to enter that row. So, defining these rules will often imply a sequence in your database for creation of new content, but in this if I have a new customer and a new order for that customer, I must add the customer first before I can add the order for it.

41 Referential Integrity It would allow a customer without an order, but it won't allow an order for a non-existing customer. The idea that data is not just valid within one particular row or one particular table according to the rules of that table, but valid and meaningful between all your tables is known as referential integrity. There are two places that it primarily has an impact. Adding new rows as I just described, making sure we can't add an order row with a Customer ID that doesn't exist. This also applies for updates. I can't bypass it by adding a row for Customer 369 who does exist and then changing that to a value that doesn't. It will refuse that too. This is still referential integrity enforcing the rules of the relationship.

42 Referential Integrity What's more interesting is what happens with referential integrity when you delete something. So, if our data currently exist between these two tables in a valid meaningful state, say, I have Customer ID 367 who has two associated orders, well, what happens if I delete Customer 367? Well, in most database systems, it depends. It depends on you and your rules and what you want to have happen. One option you have when deleting between tables that have relationships is something called a Cascading Delete. If I want to delete a row from the Customer table, the database says, "You're the boss", and we'll just immediately delete any related row.

43 Referential Integrity Another option for deleting is cascading nullify. Some database systems have this option, although it is rarely used, where you would null the Foreign Key column. So, in this case, I delete Customer ID 367 and the database would automatically scan all the orders and where it finds 367, set that to null. So, it's a situation where I must keep the order, but it's kind of now detached from a particular customer. It still exists but with a null column.

44 Referential Integrity But more likely than either of this is simply refusal. No action. This is the default in most database management systems, that if you've created a relationship between these two tables and then you try and delete a customer that has existing orders, it's not going to let you do that. It will refuse the delete option. When deleting, you'd need to delete all the orders first or transfer their ownership to some other Customer ID and only then would I be allowed to delete that Customer row.

45 RELATIONSHIPS: Recommended Links Three Types of Relationships in Database Design A Quick Start Tutorial on Database Relationships Database Structure and Design Tutorial 45

46 NO ICEs TODAY In-CLASS Assignment 1 Workday / ICE Make-Up Day ATTENDANCE is OPTIONAL following the lecture. If you are all caught up you are free to leave early today Also: It is okay to look ahead at upcoming PowerPoints to learn about a topic we haven t covered yet. Look at the Topics listed in the Lecture accordion bar to find the topic you re interested in. 46

Instructor: Craig Duckett. Lecture 03: Tuesday, April 3, 2018 SQL Sorting, Aggregates and Joining Tables

Instructor: Craig Duckett. Lecture 03: Tuesday, April 3, 2018 SQL Sorting, Aggregates and Joining Tables Instructor: Craig Duckett Lecture 03: Tuesday, April 3, 2018 SQL Sorting, Aggregates and Joining Tables 1 Assignment 1 is due LECTURE 5, Tuesday, April 10 th, 2018 in StudentTracker by MIDNIGHT MID-TERM

More information

Instructor: Craig Duckett. Lecture 07: Tuesday, April 17 th, 2018 Conflicts and Isolation, MySQL Workbench

Instructor: Craig Duckett. Lecture 07: Tuesday, April 17 th, 2018 Conflicts and Isolation, MySQL Workbench Instructor: Craig Duckett Lecture 07: Tuesday, April 17 th, 2018 Conflicts and Isolation, MySQL Workbench 1 MID-TERM EXAM is LECTURE 10, Tuesday, May 1st Assignment 2 is due LECTURE 12, Tuesday, May 8

More information

Assignment 1 DUE TONIGHT

Assignment 1 DUE TONIGHT Instructor: Craig Duckett Assignment 1 DUE TONIGHT Lecture 05: Tuesday, April 10 th, 2018 Transactions, Acid Test, DML, DDL 1 Assignment 1 is due TONIGHT LECTURE 5, Tuesday, April 10 th in StudentTracker

More information

Instructor: Craig Duckett. Lecture 02: Thursday, March 29 th, 2018 SQL Basics and SELECT, FROM, WHERE

Instructor: Craig Duckett. Lecture 02: Thursday, March 29 th, 2018 SQL Basics and SELECT, FROM, WHERE Instructor: Craig Duckett Lecture 02: Thursday, March 29 th, 2018 SQL Basics and SELECT, FROM, WHERE 1 Assignment 1 is due LECTURE 5, Tuesday, April 10 th, 2018 in StudentTracker by MIDNIGHT MID-TERM EXAM

More information

In our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology.

In our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology. Guide to and Hi everybody! In our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology. This guide focuses on two of those symbols: and. These symbols represent concepts

More information

Instructor: Craig Duckett. Lecture 11: Thursday, May 3 th, Set Operations, Subqueries, Views

Instructor: Craig Duckett. Lecture 11: Thursday, May 3 th, Set Operations, Subqueries, Views Instructor: Craig Duckett Lecture 11: Thursday, May 3 th, 2018 Set Operations, Subqueries, Views 1 MID-TERM EXAM GRADED! Assignment 2 is due LECTURE 12, NEXT Tuesday, May 8 th in StudentTracker by MIDNIGHT

More information

Skill 1: Multiplying Polynomials

Skill 1: Multiplying Polynomials CS103 Spring 2018 Mathematical Prerequisites Although CS103 is primarily a math class, this course does not require any higher math as a prerequisite. The most advanced level of mathematics you'll need

More information

It Might Be Valid, But It's Still Wrong Paul Maskens and Andy Kramek

It Might Be Valid, But It's Still Wrong Paul Maskens and Andy Kramek Seite 1 von 5 Issue Date: FoxTalk July 2000 It Might Be Valid, But It's Still Wrong Paul Maskens and Andy Kramek This month, Paul Maskens and Andy Kramek discuss the problems of validating data entry.

More information

Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5

Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5 Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5 [talking head] This lecture we study theory design and implementation. Programmers have two roles to play here. In one role, they

More information

MITOCW ocw f99-lec12_300k

MITOCW ocw f99-lec12_300k MITOCW ocw-18.06-f99-lec12_300k This is lecture twelve. OK. We've reached twelve lectures. And this one is more than the others about applications of linear algebra. And I'll confess. When I'm giving you

More information

MITOCW watch?v=0jljzrnhwoi

MITOCW watch?v=0jljzrnhwoi MITOCW watch?v=0jljzrnhwoi The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To

More information

So on the survey, someone mentioned they wanted to work on heaps, and someone else mentioned they wanted to work on balanced binary search trees.

So on the survey, someone mentioned they wanted to work on heaps, and someone else mentioned they wanted to work on balanced binary search trees. So on the survey, someone mentioned they wanted to work on heaps, and someone else mentioned they wanted to work on balanced binary search trees. According to the 161 schedule, heaps were last week, hashing

More information

MITOCW ocw f99-lec07_300k

MITOCW ocw f99-lec07_300k MITOCW ocw-18.06-f99-lec07_300k OK, here's linear algebra lecture seven. I've been talking about vector spaces and specially the null space of a matrix and the column space of a matrix. What's in those

More information

MITOCW watch?v=rvrkt-jxvko

MITOCW watch?v=rvrkt-jxvko MITOCW watch?v=rvrkt-jxvko The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To

More information

The following content is provided under a Creative Commons license. Your support

The following content is provided under a Creative Commons license. Your support MITOCW Lecture 10 The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high-quality educational resources for free. To make a

More information

How to Improve Your Campaign Conversion Rates

How to Improve Your  Campaign Conversion Rates How to Improve Your Email Campaign Conversion Rates Chris Williams Author of 7 Figure Business Models How to Exponentially Increase Conversion Rates I'm going to teach you my system for optimizing an email

More information

Post Experiment Interview Questions

Post Experiment Interview Questions Post Experiment Interview Questions Questions about the Maximum Problem 1. What is this problem statement asking? 2. What is meant by positive integers? 3. What does it mean by the user entering valid

More information

PROFESSOR: Last time, we took a look at an explicit control evaluator for Lisp, and that bridged the gap between

PROFESSOR: Last time, we took a look at an explicit control evaluator for Lisp, and that bridged the gap between MITOCW Lecture 10A [MUSIC PLAYING] PROFESSOR: Last time, we took a look at an explicit control evaluator for Lisp, and that bridged the gap between all these high-level languages like Lisp and the query

More information

Linked Lists. What is a Linked List?

Linked Lists. What is a Linked List? Linked Lists Along with arrays, linked lists form the basis for pretty much every other data stucture out there. This makes learning and understand linked lists very important. They are also usually the

More information

Instructor: Craig Duckett. Lecture 01: Tuesday, March 27 th, 2018 Orientation and Database Introduction

Instructor: Craig Duckett. Lecture 01: Tuesday, March 27 th, 2018 Orientation and Database Introduction Instructor: Craig Duckett Lecture 01: Tuesday, March 27 th, 2018 Orientation and Database Introduction 1 Welcome to the BIT275 Database Design class! This is a fast-paced class that will cover a lot of

More information

Designing a Database -- Understanding Relational Design

Designing a Database -- Understanding Relational Design Designing a Database -- Understanding Relational Design Contents Overview The Database Design Process Steps in Designing a Database Common Design Problems Determining the Purpose Determining the Tables

More information

Slide 1 CS 170 Java Programming 1 Testing Karel

Slide 1 CS 170 Java Programming 1 Testing Karel CS 170 Java Programming 1 Testing Karel Introducing Unit Tests to Karel's World Slide 1 CS 170 Java Programming 1 Testing Karel Hi Everybody. This is the CS 170, Java Programming 1 lecture, Testing Karel.

More information

6.830 Lecture PS1 Due Next Time (Tuesday!) Lab 1 Out end of week start early!

6.830 Lecture PS1 Due Next Time (Tuesday!) Lab 1 Out end of week start early! 6.830 Lecture 3 9.13.2017 PS1 Due Next Time (Tuesday!) Lab 1 Out end of week start early! Relational Model Continued, and Schema Design and Normalization Animals(name,age,species,cageno,keptby,feedtime)

More information

The Stack, Free Store, and Global Namespace

The Stack, Free Store, and Global Namespace Pointers This tutorial is my attempt at clarifying pointers for anyone still confused about them. Pointers are notoriously hard to grasp, so I thought I'd take a shot at explaining them. The more information

More information

Class #7 Guidebook Page Expansion. By Ryan Stevenson

Class #7 Guidebook Page Expansion. By Ryan Stevenson Class #7 Guidebook Page Expansion By Ryan Stevenson Table of Contents 1. Class Purpose 2. Expansion Overview 3. Structure Changes 4. Traffic Funnel 5. Page Updates 6. Advertising Updates 7. Prepare for

More information

Database Management System Dr. S. Srinath Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No.

Database Management System Dr. S. Srinath Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No. Database Management System Dr. S. Srinath Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No. # 3 Relational Model Hello everyone, we have been looking into

More information

MITOCW watch?v=sdw8_0rdzuw

MITOCW watch?v=sdw8_0rdzuw MITOCW watch?v=sdw8_0rdzuw PROFESSOR: Directed acyclic graphs are a special class of graphs that really have and warrant a theory of their own. Of course, "directed acyclic graphs" is lot of syllables,

More information

Entity Relationships and Databases

Entity Relationships and Databases Entity Relationships and Databases The following is excerpted from Chapter 6, Data Modeling, in Business Systems Analysis and Design by William S. Davis (1994, Belmont, CA: Wadsworth Publishing Company),

More information

MITOCW watch?v=w_-sx4vr53m

MITOCW watch?v=w_-sx4vr53m MITOCW watch?v=w_-sx4vr53m The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high-quality educational resources for free. To

More information

Hello, and welcome to another episode of. Getting the Most Out of IBM U2. This is Kenny Brunel, and

Hello, and welcome to another episode of. Getting the Most Out of IBM U2. This is Kenny Brunel, and Hello, and welcome to another episode of Getting the Most Out of IBM U2. This is Kenny Brunel, and I'm your host for today's episode which introduces wintegrate version 6.1. First of all, I've got a guest

More information

Most of the class will focus on if/else statements and the logical statements ("conditionals") that are used to build them. Then I'll go over a few

Most of the class will focus on if/else statements and the logical statements (conditionals) that are used to build them. Then I'll go over a few With notes! 1 Most of the class will focus on if/else statements and the logical statements ("conditionals") that are used to build them. Then I'll go over a few useful functions (some built into standard

More information

MITOCW watch?v=9h6muyzjms0

MITOCW watch?v=9h6muyzjms0 MITOCW watch?v=9h6muyzjms0 The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To

More information

1 Getting used to Python

1 Getting used to Python 1 Getting used to Python We assume you know how to program in some language, but are new to Python. We'll use Java as an informal running comparative example. Here are what we think are the most important

More information

MITOCW watch?v=flgjisf3l78

MITOCW watch?v=flgjisf3l78 MITOCW watch?v=flgjisf3l78 The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high-quality educational resources for free. To

More information

Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5

Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5 Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5 [talking head] Formal Methods of Software Engineering means the use of mathematics as an aid to writing programs. Before we can

More information

The following content is provided under a Creative Commons license. Your support

The following content is provided under a Creative Commons license. Your support MITOCW Lecture 8 The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To make a donation

More information

Range Minimum Queries Part Two

Range Minimum Queries Part Two Range Minimum Queries Part Two Recap from Last Time The RMQ Problem The Range Minimum Query (RMQ) problem is the following: Given a fixed array A and two indices i j, what is the smallest element out of

More information

Automatic newsgroup TV show downloading By RootyB

Automatic newsgroup TV show downloading By RootyB Downloaded from: justpaste.it/1mx Automatic newsgroup TV show downloading By RootyB I'm doing this in between my actual responsibilities, so it's going to be fairly quick and dirty. It should address just

More information

MITOCW watch?v=4dj1oguwtem

MITOCW watch?v=4dj1oguwtem MITOCW watch?v=4dj1oguwtem PROFESSOR: So it's time to examine uncountable sets. And that's what we're going to do in this segment. So Cantor's question was, are all sets the same size? And he gives a definitive

More information

There are three types of joins in Access such as one-to-one, one-to-many, and many-to-many.

There are three types of joins in Access such as one-to-one, one-to-many, and many-to-many. Relationships There are three types of joins in Access such as one-to-one, one-to-many, and many-to-many. One-to-one A one-to-one relationship has only one matching row in each table. An example would

More information

Troubleshooting Maple Worksheets: Common Problems

Troubleshooting Maple Worksheets: Common Problems Troubleshooting Maple Worksheets: Common Problems So you've seen plenty of worksheets that work just fine, but that doesn't always help you much when your worksheet isn't doing what you want it to. This

More information

CS103 Spring 2018 Mathematical Vocabulary

CS103 Spring 2018 Mathematical Vocabulary CS103 Spring 2018 Mathematical Vocabulary You keep using that word. I do not think it means what you think it means. - Inigo Montoya, from The Princess Bride Consider the humble while loop in most programming

More information

Week 5: Background. A few observations on learning new programming languages. What's wrong with this (actual) protest from 1966?

Week 5: Background. A few observations on learning new programming languages. What's wrong with this (actual) protest from 1966? Week 5: Background A few observations on learning new programming languages What's wrong with this (actual) protest from 1966? Programmer: "Switching to PL/I as our organization's standard programming

More information

The following content is provided under a Creative Commons license. Your support

The following content is provided under a Creative Commons license. Your support MITOCW Lecture 11 The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To make a

More information

P1_L3 Operating Systems Security Page 1

P1_L3 Operating Systems Security Page 1 P1_L3 Operating Systems Security Page 1 that is done by the operating system. systems. The operating system plays a really critical role in protecting resources in a computer system. Resources such as

More information

BEGINNER PHP Table of Contents

BEGINNER PHP Table of Contents Table of Contents 4 5 6 7 8 9 0 Introduction Getting Setup Your first PHP webpage Working with text Talking to the user Comparison & If statements If & Else Cleaning up the game Remembering values Finishing

More information

Lesson 3 Transcript: Part 1 of 2 - Tools & Scripting

Lesson 3 Transcript: Part 1 of 2 - Tools & Scripting Lesson 3 Transcript: Part 1 of 2 - Tools & Scripting Slide 1: Cover Welcome to lesson 3 of the db2 on Campus lecture series. Today we're going to talk about tools and scripting, and this is part 1 of 2

More information

MITOCW MIT6_01SC_rec2_300k.mp4

MITOCW MIT6_01SC_rec2_300k.mp4 MITOCW MIT6_01SC_rec2_300k.mp4 KENDRA PUGH: Hi. I'd like to talk to you today about inheritance as a fundamental concept in object oriented programming, its use in Python, and also tips and tricks for

More information

how its done in about the five most common SQL implementations.

how its done in about the five most common SQL implementations. SQL PDF Database management. It may sound daunting, but it doesn't have to be, even if you've never programmed before. SQL: Visual QuickStart Guide isn't an exhaustive guide to SQL written for aspiring

More information

Slide 1 CS 170 Java Programming 1

Slide 1 CS 170 Java Programming 1 CS 170 Java Programming 1 Objects and Methods Performing Actions and Using Object Methods Slide 1 CS 170 Java Programming 1 Objects and Methods Duration: 00:01:14 Hi Folks. This is the CS 170, Java Programming

More information

A good example of entities and relationships can be seen below.

A good example of entities and relationships can be seen below. Unit 2: Unit 2: Conceptual Design: Data Modeling and the Entity Relationship Model - Discussion 1 Scroll down and click "Respond" to post your reply to the Discussion questions. Please review the Discussion

More information

CPSC 320 Sample Solution, Playing with Graphs!

CPSC 320 Sample Solution, Playing with Graphs! CPSC 320 Sample Solution, Playing with Graphs! September 23, 2017 Today we practice reasoning about graphs by playing with two new terms. These terms/concepts are useful in themselves but not tremendously

More information

Module 6. Campaign Layering

Module 6.  Campaign Layering Module 6 Email Campaign Layering Slide 1 Hello everyone, it is Andy Mackow and in today s training, I am going to teach you a deeper level of writing your email campaign. I and I am calling this Email

More information

Welcome to this IBM Rational podcast, Using the. System Architect Migration Toolkit to Migrate Your DoDAF 1.5

Welcome to this IBM Rational podcast, Using the. System Architect Migration Toolkit to Migrate Your DoDAF 1.5 IBM Podcast [ MUSIC ] GIST: Welcome to this IBM Rational podcast, Using the System Architect Migration Toolkit to Migrate Your DoDAF 1.5 model to DoDAF 2.0. I'm Kimberly Gist with IBM. Many IBM Rational

More information

Note: Please use the actual date you accessed this material in your citation.

Note: Please use the actual date you accessed this material in your citation. MIT OpenCourseWare http://ocw.mit.edu 18.06 Linear Algebra, Spring 2005 Please use the following citation format: Gilbert Strang, 18.06 Linear Algebra, Spring 2005. (Massachusetts Institute of Technology:

More information

(Refer Slide Time: 00:01:30)

(Refer Slide Time: 00:01:30) Digital Circuits and Systems Prof. S. Srinivasan Department of Electrical Engineering Indian Institute of Technology, Madras Lecture - 32 Design using Programmable Logic Devices (Refer Slide Time: 00:01:30)

More information

Azon Master Class. By Ryan Stevenson Guidebook #5 WordPress Usage

Azon Master Class. By Ryan Stevenson   Guidebook #5 WordPress Usage Azon Master Class By Ryan Stevenson https://ryanstevensonplugins.com/ Guidebook #5 WordPress Usage Table of Contents 1. Widget Setup & Usage 2. WordPress Menu System 3. Categories, Posts & Tags 4. WordPress

More information

ER Modeling Data Modeling and the Entity-Relationship (ER) Diagram Pg 1

ER Modeling Data Modeling and the Entity-Relationship (ER) Diagram Pg 1 ER Modeling Data Modeling and the Entity-Relationship (ER) Diagram Pg 1 Data Modeling and the Entity-Relationship (ER) Diagram Ray Lockwood Points: The Entity-Relationship (ER) Diagram is seen by various

More information

Intro. Speed V Growth

Intro. Speed V Growth Intro Good code is two things. It's elegant, and it's fast. In other words, we got a need for speed. We want to find out what's fast, what's slow, and what we can optimize. First, we'll take a tour of

More information

Programming and Data Structure

Programming and Data Structure Programming and Data Structure Dr. P.P.Chakraborty Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture # 09 Problem Decomposition by Recursion - II We will

More information

How To Make 3-50 Times The Profits From Your Traffic

How To Make 3-50 Times The Profits From Your Traffic 1 How To Make 3-50 Times The Profits From Your Traffic by Chris Munch of Munchweb.com Copyright Munchweb.com. All Right Reserved. This work cannot be copied, re-published, or re-distributed. No re-sell

More information

Follow these steps to get started: o Launch MS Access from your start menu. The MS Access startup panel is displayed:

Follow these steps to get started: o Launch MS Access from your start menu. The MS Access startup panel is displayed: Forms-based Database Queries The topic presents a summary of Chapter 3 in the textbook, which covers using Microsoft Access to manage and query an Access database. The screenshots in this topic are from

More information

Q &A on Entity Relationship Diagrams. What is the Point? 1 Q&A

Q &A on Entity Relationship Diagrams. What is the Point? 1 Q&A 1 Q&A Q &A on Entity Relationship Diagrams The objective of this lecture is to show you how to construct an Entity Relationship (ER) Diagram. We demonstrate these concepts through an example. To break

More information

MITOCW watch?v=penh4mv5gag

MITOCW watch?v=penh4mv5gag MITOCW watch?v=penh4mv5gag PROFESSOR: Graph coloring is the abstract version of a problem that arises from a bunch of conflict scheduling situations. So let's look at an example first and then define the

More information

Basic Fiction Formatting for Smashwords in OpenOffice L. Leona Davis. Copyright 2012 L. Leona Davis All Rights Reserved

Basic Fiction Formatting for Smashwords in OpenOffice L. Leona Davis. Copyright 2012 L. Leona Davis All Rights Reserved Basic Fiction Formatting for Smashwords in OpenOffice L. Leona Davis Copyright 2012 L. Leona Davis All Rights Reserved Cover Photo by Dmitry Maslov Cover Design by L. Leona Davis Smashwords Edition June

More information

Consistency The DBMS must ensure the database will always be in a consistent state. Whenever data is modified, the database will change from one

Consistency The DBMS must ensure the database will always be in a consistent state. Whenever data is modified, the database will change from one Data Management We start our studies of Computer Science with the problem of data storage and organization. Nowadays, we are inundated by data from all over. To name a few data sources in our lives, we

More information

The following content is provided under a Creative Commons license. Your support

The following content is provided under a Creative Commons license. Your support MITOCW Lecture 9 The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high-quality educational resources for free. To make a donation

More information

6.001 Notes: Section 15.1

6.001 Notes: Section 15.1 6.001 Notes: Section 15.1 Slide 15.1.1 Our goal over the next few lectures is to build an interpreter, which in a very basic sense is the ultimate in programming, since doing so will allow us to define

More information

Listen to. the podcast. Transcript: podcast is. of syntax. those kinds. it will come. to correct. 1 Page. Chandoo.org

Listen to. the podcast. Transcript: podcast is. of syntax. those kinds. it will come. to correct. 1 Page. Chandoo.org Transcript for Session 037 Listen to the podcast session, seee resources & links: http://chandoo.org/session37/ Transcript: Hi and welcome to http://chandoo.org podcast. This is session number 37. Chandoo.org

More information

Surrogate Keys Ray Lockwood

Surrogate Keys Ray Lockwood Data Modeling and Implementation Surrogate Keys Pg 1 Surrogate Keys Ray Lockwood Points: A Surrogate Key is the primary key and links tables together. A Surrogate Key is usually a system generated integer.

More information

MITOCW watch?v=kz7jjltq9r4

MITOCW watch?v=kz7jjltq9r4 MITOCW watch?v=kz7jjltq9r4 PROFESSOR: We're going to look at the most fundamental of all mathematical data types, namely sets, and let's begin with the definitions. So informally, a set is a collection

More information

UAccess ANALYTICS. Fundamentals of Reporting. updated v.1.00

UAccess ANALYTICS. Fundamentals of Reporting. updated v.1.00 UAccess ANALYTICS Arizona Board of Regents, 2010 THE UNIVERSITY OF ARIZONA updated 07.01.2010 v.1.00 For information and permission to use our PDF manuals, please contact uitsworkshopteam@listserv.com

More information

Slide 1 CS 170 Java Programming 1 Multidimensional Arrays Duration: 00:00:39 Advance mode: Auto

Slide 1 CS 170 Java Programming 1 Multidimensional Arrays Duration: 00:00:39 Advance mode: Auto CS 170 Java Programming 1 Working with Rows and Columns Slide 1 CS 170 Java Programming 1 Duration: 00:00:39 Create a multidimensional array with multiple brackets int[ ] d1 = new int[5]; int[ ][ ] d2;

More information

mk-convert Contents 1 Converting to minikanren, quasimatically. 08 July 2014

mk-convert Contents 1 Converting to minikanren, quasimatically. 08 July 2014 mk-convert 08 July 2014 Contents 1 Converting to minikanren, quasimatically. 1 1.1 Variations on a Scheme..................... 2 1.2 Racket to minikanren, nally.................. 8 1.3 Back to the beginning......................

More information

Earthwork 3D for Dummies Doing a digitized dirt takeoff calculation the swift and easy way

Earthwork 3D for Dummies Doing a digitized dirt takeoff calculation the swift and easy way Introduction Earthwork 3D for Dummies Doing a digitized dirt takeoff calculation the swift and easy way Getting to know you Earthwork has inherited its layout from its ancestors, Sitework 98 and Edge.

More information

Instructor: Craig Duckett. Lecture 14: Tuesday, May 15 th, 2018 Stored Procedures (SQL Server) and MySQL

Instructor: Craig Duckett. Lecture 14: Tuesday, May 15 th, 2018 Stored Procedures (SQL Server) and MySQL Instructor: Craig Duckett Lecture 14: Tuesday, May 15 th, 2018 Stored Procedures (SQL Server) and MySQL 1 Assignment 3 is due LECTURE 20, Tuesday, June 5 th Database Presentation is due LECTURE 20, Tuesday,

More information

MITOCW ocw apr k

MITOCW ocw apr k MITOCW ocw-6.033-32123-06apr2005-220k Good afternoon. So we're going to continue our discussion about atomicity and how to achieve atomicity. And today the focus is going to be on implementing this idea

More information

Introduction to Databases and SQL

Introduction to Databases and SQL Introduction to Databases and SQL Files vs Databases In the last chapter you learned how your PHP scripts can use external files to store and retrieve data. Although files do a great job in many circumstances,

More information

Azon Master Class. By Ryan Stevenson Guidebook #11 Squidoo Marketing

Azon Master Class. By Ryan Stevenson   Guidebook #11 Squidoo Marketing Azon Master Class By Ryan Stevenson https://ryanstevensonplugins.com/ Guidebook #11 Squidoo Marketing Table of Contents 1. Getting Started With Squidoo 2. Lens Research & Targeting 3. Lens Creation Tutorial

More information

Text transcript of show #280. August 18, Microsoft Research: Trinity is a Graph Database and a Distributed Parallel Platform for Graph Data

Text transcript of show #280. August 18, Microsoft Research: Trinity is a Graph Database and a Distributed Parallel Platform for Graph Data Hanselminutes is a weekly audio talk show with noted web developer and technologist Scott Hanselman and hosted by Carl Franklin. Scott discusses utilities and tools, gives practical how-to advice, and

More information

MITOCW watch?v=r6-lqbquci0

MITOCW watch?v=r6-lqbquci0 MITOCW watch?v=r6-lqbquci0 The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To

More information

PROFESSOR: So far in this course we've been talking a lot about data abstraction. And remember the idea is that

PROFESSOR: So far in this course we've been talking a lot about data abstraction. And remember the idea is that MITOCW Lecture 4B [MUSIC-- "JESU, JOY OF MAN'S DESIRING" BY JOHANN SEBASTIAN BACH] PROFESSOR: So far in this course we've been talking a lot about data abstraction. And remember the idea is that we build

More information

Chrome if I want to. What that should do, is have my specifications run against four different instances of Chrome, in parallel.

Chrome if I want to. What that should do, is have my specifications run against four different instances of Chrome, in parallel. Hi. I'm Prateek Baheti. I'm a developer at ThoughtWorks. I'm currently the tech lead on Mingle, which is a project management tool that ThoughtWorks builds. I work in Balor, which is where India's best

More information

Well, Hal just told us how you build robust systems. The key idea was-- I'm sure that many of

Well, Hal just told us how you build robust systems. The key idea was-- I'm sure that many of MITOCW Lecture 3B [MUSIC PLAYING] Well, Hal just told us how you build robust systems. The key idea was-- I'm sure that many of you don't really assimilate that yet-- but the key idea is that in order

More information

Relational Data Model

Relational Data Model Relational Data Model 1. Relational data model Information models try to put the real-world information complexity in a framework that can be easily understood. Data models must capture data structure

More information

CSE 530A. ER Model to Relational Schema. Washington University Fall 2013

CSE 530A. ER Model to Relational Schema. Washington University Fall 2013 CSE 530A ER Model to Relational Schema Washington University Fall 2013 Relational Model A relational database consists of a group of relations (a.k.a., tables) A relation (table) is a set of tuples (rows)

More information

KMyMoney Transaction Matcher

KMyMoney Transaction Matcher KMyMoney Transaction Matcher Ace Jones Use Cases Case #1A: Matching hand-entered transactions manually I enter a transaction by hand, with payee, amount, date & category. I download

More information

CS403- Database Management Systems Solved MCQS From Midterm Papers. CS403- Database Management Systems MIDTERM EXAMINATION - Spring 2010

CS403- Database Management Systems Solved MCQS From Midterm Papers. CS403- Database Management Systems MIDTERM EXAMINATION - Spring 2010 CS403- Database Management Systems Solved MCQS From Midterm Papers April 29,2012 MC100401285 Moaaz.pk@gmail.com Mc100401285@gmail.com PSMD01 CS403- Database Management Systems MIDTERM EXAMINATION - Spring

More information

Week 2: The Clojure Language. Background Basic structure A few of the most useful facilities. A modernized Lisp. An insider's opinion

Week 2: The Clojure Language. Background Basic structure A few of the most useful facilities. A modernized Lisp. An insider's opinion Week 2: The Clojure Language Background Basic structure A few of the most useful facilities A modernized Lisp Review of Lisp's origins and development Why did Lisp need to be modernized? Relationship to

More information

Hi everyone. I hope everyone had a good Fourth of July. Today we're going to be covering graph search. Now, whenever we bring up graph algorithms, we

Hi everyone. I hope everyone had a good Fourth of July. Today we're going to be covering graph search. Now, whenever we bring up graph algorithms, we Hi everyone. I hope everyone had a good Fourth of July. Today we're going to be covering graph search. Now, whenever we bring up graph algorithms, we have to talk about the way in which we represent the

More information

Blitz2D Newbies: Definitive Guide to Types by MutteringGoblin

Blitz2D Newbies: Definitive Guide to Types by MutteringGoblin Blitz2D Newbies: Definitive Guide to Types by MutteringGoblin Types are probably the hardest thing to understand about Blitz Basic. If you're using types for the first time, you've probably got an uneasy

More information

Definition: A data structure is a way of organizing data in a computer so that it can be used efficiently.

Definition: A data structure is a way of organizing data in a computer so that it can be used efficiently. The Science of Computing I Lesson 4: Introduction to Data Structures Living with Cyber Pillar: Data Structures The need for data structures The algorithms we design to solve problems rarely do so without

More information

CS Final Exam Review Suggestions

CS Final Exam Review Suggestions CS 325 - Final Exam Review Suggestions p. 1 last modified: 2017-12-06 CS 325 - Final Exam Review Suggestions Based on suggestions from Prof. Deb Pires from UCLA: Because of the research-supported learning

More information

Chapter. Relational Database Concepts COPYRIGHTED MATERIAL

Chapter. Relational Database Concepts COPYRIGHTED MATERIAL Chapter Relational Database Concepts 1 COPYRIGHTED MATERIAL Every organization has data that needs to be collected, managed, and analyzed. A relational database fulfills these needs. Along with the powerful

More information

Casting in C++ (intermediate level)

Casting in C++ (intermediate level) 1 of 5 10/5/2009 1:14 PM Casting in C++ (intermediate level) Casting isn't usually necessary in student-level C++ code, but understanding why it's needed and the restrictions involved can help widen one's

More information

mid=81#15143

mid=81#15143 Posted by joehillen - 06 Aug 2012 22:10 I'm having a terrible time trying to find the Lightworks source code. I was under the impression that Lightworks was open source. Usually that means that it's possible

More information

The IBM I A Different Roadmap

The IBM I A Different Roadmap The IBM I A Different Roadmap Not long ago I was reading an article about a session Steve Will gave on how to make the IBM i "sexy". Those who know me know that that would immediately start me thinking

More information

MITOCW watch?v=zm5mw5nkzjg

MITOCW watch?v=zm5mw5nkzjg MITOCW watch?v=zm5mw5nkzjg The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To

More information

MITOCW watch?v=zlohv4xq_ti

MITOCW watch?v=zlohv4xq_ti MITOCW watch?v=zlohv4xq_ti The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high-quality educational resources for free. To

More information

Customizing Access Parameter Queries

Customizing Access Parameter Queries [Revised and Updated 15 August 2018] Everyone likes parameter queries! The database developer doesn't have to anticipate the user's every requirement, and the user can vary their enquiries without having

More information