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

Size: px
Start display at page:

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

Transcription

1 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 have spreadsheets, s, reports, and invoices and even snail mail. Unless we have our data organized in some fashion, we will drown in our data. Since originally computers were very expensive, the first attempts to organize data were for commercial use. Businesses developed databases to organize their data. Over the past thirty years the models developed to store data have pretty much remained the same, which is remarkable considering how quickly the rest of computer technology has changed. One data model, the relational model, is, by far, the most popular model. We will explore the world of the relational data model. Database Management System and Database Design A database is where data is stored in some organized fashion. Before we examine what a database is, we must first understand where a database resides. Databases are contained and accessed through a Database Management System or a DBMS. The DBMS are the interfaces which we communicate with when accessing a database. Examples of popular DBMS s are Microsoft SQL Server, Oracle, IBM DB2, and MySQL, and Microsoft Access. DBMS Operations Supported A DBMS must provide at a minimum the following operations to a user. These operations are known by the acronym CRUD, which stand for Create, Read, Update, and Delete. That is a user must have the ability to add data, delete data, modify existing data, and to read data. DBMS Requirements In addition to operations are provided to users, a DBMS must provide the following services. These services are known by the acronym ACID, which stand for Atomicity, Consistency, Isolation, and Durability, which we will now explain. Atomicity Database transactions must be all or nothing. That means, for example, If I have a record, and I am updating fields A, B, and C in one operation, then one of two things must occur. Either fields A, B, and C are all updated or none of these are updated. There can never be the case where fields A and B are updated and C was not modified.

2 Consistency The DBMS must ensure the database will always be in a consistent state. Whenever data is modified, the database will change from one consistent state to another consistent state. In the non-database world, an example of non-consistency would be, for example, if I upload the files for my web site, but only some of the files upload. Now when people click on my web site, they get page not found. In a database, an example of a consistent state would mean that the customer in the Order table must also exist in the Customers table. Trying to create an order for a non-existent customer would make the database inconsistent and should fail. A formulation that we may derives from this is, all foreign keys (FK) must exist as primary keys (PK) in their respective tables. Isolation Isolation means that from a User s perspective, he is the only person using the database. All of the User s requests are not affected by the requests of any other User. For example, if both Aron and Beth simultaneously request that fields A, B, and C should be updated with different values, both Aron and Beth can be confident that fields A, B, and C will be updated with the values they requested. There is no guarantee whose updates will be processed last, those of Aron or Beth. But since both requests will complete, only last request will remain in the database. As an example, let s imagine making an order from Amazon.com that updates the Order table and the Product table. Particularly, I want to add an order to the Order table and at the same time decrease the quantity available on the Product table. Let s say there are 3 Oranges available for sale. Jay orders 1 orange and Sara orders 3. Both Jay and Sara attempt to access both tables. Potentially Sara can take all the oranges from the Product table, so zero oranges are available. At the very same time, Jay has created an order in the order table and either decrements the Product table creating a negative quantity or he fails creating an order with zero quantity. Durability This requires that the user is guaranteed that their data will persist. In other words, even though someone will pull the plug on the server the DBMS is running on, no data or very little data will be lost. This may also mean failover support. That is, if the main database server gets attacked by a person wielding a

3 sledge hammer, a backup server will automatically kick in and pick up where the first one left off. Need for Relational Database Design Before explaining the relational model, it is useful to understand the issues facing the database designer. By far, the most important issue facing the database designer is data duplication which can lead to data integrity issues. In general, speed is very critical, especially when dealing with real time processes, however, getting it right trumps getting it quickly. Let s imagine, I am an employer and we have a workbook for my business. My workbook contains three worksheets. One, called Assignments, lists the work assignments of all my employees. A second worksheet, called Personal, lists the addresses and contact information for all employees. A third worksheet, called Performance rates the performance of all employees. A Column common to all Worksheets is Employee Name. What happens if one of my employee s marries and changes their name, and I only change the name on one worksheet? What happens if I am in a rush and only enter employee information on one worksheet and not the others? What is to prevent me from spelling the employee name differently on different worksheets? What if someone is editing the spreadsheet and they have left for the day without closing the workbook? These examples, point to simple ways where data integrity can be lost. In addition, how do I handle historical data? Let s say I want to remember previous assignments, previous performance ratings, previous addresses? How can I implement this with a spreadsheet? The Hierarchal model You may be thinking, let s try the file cabinet solution. We will create a separate file, or in our case, a separate workbook for every employee. This way the employee name will only be in one location, the workbook name. This is actually a database design that was common before the use of the relational model. This was called the hierarchal model. The problem with this model, are fairly obvious. To view an employee s information, I have to open a separate workbook for each employee. How do I view/edit employee information for many employees? For example, to change the

4 responsibilities for all employees who live in a certain area, I have to open each workbook, find the appropriate worksheet and then change the date. If I forget to modify all the workbooks, then I have lost my data integrity. The Data Model Just like it is always better to first create an architectural design before we build a building, the same is true before we create a database. This design is called a data model. A data model is represented using an entity relationship diagram or ERD. An ERD consists of Entities, Relationships, Cardinality, Primary Keys, Attributes, Foreign Keys, and Rules. Entity An entity contains a bunch of related data consisting of many fields of data. The fields in an Entity should all have some relevance to the overall entity. For example, the Student entity may have fields like First Name and Address. It should not have a field called Course Attended as this field doesn t really describe the student. It does describe what the Student has studied and should be in a different entity called Courses Attended. Primary Key Each entity has one or more fields that uniquely identify that identity. These fields are known as the Primary Key (or PK) for that entity. For example, the Student entity may have Student ID as it s PK while the Courses Attended entity will have Course ID and Student ID as its PK. Attributes All fields in an entity are known as attributes of that entity. Relationships Entities almost never exist by themselves. Almost always they have relationships with each other. For example, the Student entity will relate to the Courses Attended entity. One without the other is not very useful. Cardinality and Rules These define exactly what relationship two entities have with each other. For example, if a Student may take many classes at the same semester, there will exist a one to many relationship between the Student entity and the Courses Attended entity. If a Class can be taken by more than one student at a time, there will exist a one to many relationship between the between the Courses Attended entity and the Student entity. Foreign Keys The way that entities point to each other is by placing their Primary Key inside other entities. Keys for entities outside the entity they are located are called foreign keys, since they point to other entities. For

5 example, the Primary Key for Courses Taken will be the combination of the Student ID field and the Class ID field. Student ID and Class ID are themselves primary keys of their respective Student and Class tables. Each Courses Taken entity will therefore point to a specific student and a specific class. Relational Model - The relational model is how a data model translates into a relational database. Entities become tables, Keys and attributes become columns, and cardinalities become data constraints. Below is an example of an Entity Relationship Diagram or ERD. ERD of Class Enrollment

6 The Relational Model A short explanation of the Relational Model. At its basic level, the relational model consists of tables that can relate to each other. A table is a grid consisting of at least one column and zero or more rows. Usually all the data in each column must be of the same type. For example: All data in the Salary column must be of type Money; All data in the Name column is of type String; and all the data in the Date Started column are of type Date. The relational model allows tables to relate or join with each other so that data in different tables can be usable together. For example: I can view John Smith s name from the Employee table, together with his salary from the Salary table, and his job title from Human Resources table at one time without having to access each table looking for his record. The Relational Model addresses data integrity issues using the following rule. Data, whenever possible, should only exist once in the database. Another rule that follows is, whenever data will be repeated we place this data in its own table removing data duplication. You are probably wondering, how John Smith can be in three or more tables without violating the rule that data should only appear once! The answer is that we add a row in the table which will contain his name, e.g. the Employee table, and then I will add another column or columns that will uniquely identify John Smith throughout the database. For Example, in the Employee table, I will create a column called Employee ID of type Number. The Employee ID will be a unique value. Only John Smith with get this ID. In fact, each employee in the Employee table will get their own Employee ID. So, in the Employee table we will have a row with both John Smith and his Employee ID. In all the other tables where we wish to refer to John Smith, we will use John s Employee ID not his name. We mentioned, the relational model allows us, in fact requires us to have many tables. Why do we need all these tables? Why not put all our data in one table? The following example illustrates the need and advantage of having multiple tables. Using our Employee example, let s start with following data as is seen in the table below. We have the following columns: Name, Salary, Salary Start Date, Position, and Position Start Date. When we add a new position, because of the table design we are forced to repeat ALL the date from the previous row even though this data is unchanged. Not only are we wasting space, but, even worse, we are duplicating data (See highlighted data below).

7 One Huge Table Name Salary Salary Start Date Responsibility Resp. Start Date John 100 1/1/2010 Asst. Mgr. 1/1/2015 John 100 1/1/2010 Manager 1/1/2016 Fred 200 1/1/2014 CEO 1/1/2014 Fred 400 1/1/2015 CEO 1/1/2014 So what is the solution? Let s create three tables. An Employee Table, a Salary Table, and a Responsibility table. In addition, we will need a new column called Employee ID. This process, breaking up one table into multiple tables, is called Normalization. Employee Employee ID Name 1 John 2 Fred Salary Employee ID Salary Salary Start Date /1/ /1/ /1/2015

8 Responsibility Employee ID Responsibility Resp. Start Date 1 Asst. Mgr. 1/1/ Manager 1/1/ CEO 1/1/2014 Primary Key Now that we have separated our data into separate tables, how do we get our data back? How do we view all the information that exists about Fred and John? First we need a way to identify which rows belong to Fred and which to John. In general, we need a way to uniquely identify every row in a table. We do this by creating or identifying a column or columns that uniquely identify every row. This column or group of columns is called the Primary Key. Every table requires a primary key. In the tables above, I have shaded the columns that comprise the primary key in orange. Retrieving and Modifying Data from Tables SQL (Structured Query Language) is the language which we speak with relational databases. The basic SQL language has very few words and can quickly be mastered. Below are the SQL statements needed to perform basic CRUD (Create, Read, Update, Delete) operations on the Employee table. Create INSERT INTO Employee ([Employee ID], Name) VALUES (1, John ) Read SELECT Name FROM Employee WHERE Employee ID] = 1 Update UPDATE Employee SET Name = Johnny WHERE Employee ID] = 1

9 Delete DELETE FROM Employee WHERE Employee ID] = 1 What about retrieving data from multiple tables? As we can see from the figure below, by connecting those rows with identical primary keys of each row, we end with the following result. Result of Joining All Three Tables Name Salary Salary Start Date Responsibility Resp. Start Date John 100 1/1/2010 Asst. Mgr. 1/1/2015 John 100 1/1/2010 Manager 1/1/2016 Fred 200 1/1/2014 CEO 1/1/2014 Fred 400 1/1/2015 CEO 1/1/2014

10 Below is an example using SQL in a database type MySql. USE FALL2016; DROP TABLE STUDENTS; CREATE TABLE STUDENTS ( STUDENTID int NOT NUll, FIRSTNAME varchar(50), LASTNAME varchar(50), PRIMARY KEY(STUDENTID)); SELECT * FROM `STUDENTS` WHERE STUDENTID = 1; INSERT INTO STUDENTS SELECT 1, 'Fred', 'Friendly'; INSERT INTO STUDENTS SELECT 2, 'Sara', 'Saranson'; INSERT INTO STUDENTS SELECT 3, 'Boris', 'Borison'; DELETE FROM STUDENTS WHERE STUDENTID = 1; UPDATE STUDENTS SET FIRSTNAME = 'Larry' WHERE STUDENTID = 3; SELECT * FROM STUDENTS;

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

File Processing Approaches

File Processing Approaches Relational Database Basics Review Overview Database approach Database system Relational model File Processing Approaches Based on file systems Data are recorded in various types of files organized in folders

More information

Introduction. Who wants to study databases?

Introduction. Who wants to study databases? Introduction Example databases Overview of concepts Why use database systems Who wants to study databases? What is the use of all the courses I have taken so far? This course shows very concrete how CS

More information

Dr. Lyn Mathis Page 1

Dr. Lyn Mathis Page 1 CSIS 3222, Fall 2008, Chapter 1, 3, 4, 5 (through p. 128) Name (Six Pages) Part I: MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. (3 points each)

More information

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data.

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data. Managing Data Data storage tool must provide the following features: Data definition (data structuring) Data entry (to add new data) Data editing (to change existing data) Querying (a means of extracting

More information

Working with Databases and Java

Working with Databases and Java Working with Databases and Java Pedro Contreras Department of Computer Science Royal Holloway, University of London January 30, 2008 Outline Introduction to relational databases Introduction to Structured

More information

Relational Database Systems Part 01. Karine Reis Ferreira

Relational Database Systems Part 01. Karine Reis Ferreira Relational Database Systems Part 01 Karine Reis Ferreira karine@dpi.inpe.br Aula da disciplina Computação Aplicada I (CAP 241) 2016 Database System Database: is a collection of related data. represents

More information

DATABASES SQL INFOTEK SOLUTIONS TEAM

DATABASES SQL INFOTEK SOLUTIONS TEAM DATABASES SQL INFOTEK SOLUTIONS TEAM TRAINING@INFOTEK-SOLUTIONS.COM Databases 1. Introduction in databases 2. Relational databases (SQL databases) 3. Database management system (DBMS) 4. Database design

More information

King Fahd University of Petroleum and Minerals

King Fahd University of Petroleum and Minerals 1 King Fahd University of Petroleum and Minerals Information and Computer Science Department ICS 334: Database Systems Semester 041 Major Exam 1 18% ID: Name: Section: Grades Section Max Scored A 5 B 25

More information

SECTION 1 DBMS LAB 1.0 INTRODUCTION 1.1 OBJECTIVES 1.2 INTRODUCTION TO MS-ACCESS. Structure Page No.

SECTION 1 DBMS LAB 1.0 INTRODUCTION 1.1 OBJECTIVES 1.2 INTRODUCTION TO MS-ACCESS. Structure Page No. SECTION 1 DBMS LAB DBMS Lab Structure Page No. 1.0 Introduction 05 1.1 Objectives 05 1.2 Introduction to MS-Access 05 1.3 Database Creation 13 1.4 Use of DBMS Tools/ Client-Server Mode 15 1.5 Forms and

More information

Database Programming - Section 10. Instructor Guide

Database Programming - Section 10. Instructor Guide Database Programming - Section 10 Instructor Guide Table of Contents...1 Lesson 1 - Defining NOT NULL and UNIQUE Constraints...1 What Will I Learn?...2 Why Learn It?...3...4 Try It / Solve It...13 Lesson

More information

Database Design. 1-3 History of the Database. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

Database Design. 1-3 History of the Database. Copyright 2015, Oracle and/or its affiliates. All rights reserved. Database Design 1-3 Objectives This lesson covers the following objectives: Describe the evolution of the database and give an example of its role in the business world Name important historical contributions

More information

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

Instructor: Craig Duckett. Lecture 04: Thursday, April 5, Relationships Instructor: Craig Duckett Lecture 04: Thursday, April 5, 2018 Relationships 1 Assignment 1 is due NEXT LECTURE 5, Tuesday, April 10 th in StudentTracker by MIDNIGHT MID-TERM EXAM is LECTURE 10, Tuesday,

More information

John Edgar 2

John Edgar 2 CMPT 354 http://www.cs.sfu.ca/coursecentral/354/johnwill/ John Edgar 2 Assignments 30% Midterm exam in class 20% Final exam 50% John Edgar 3 A database is a collection of information Databases of one

More information

A REVIEW OF BASIC KNOWLEDGE OF DATABASE SYSTEM

A REVIEW OF BASIC KNOWLEDGE OF DATABASE SYSTEM A REVIEW OF BASIC KNOWLEDGE OF DATABASE SYSTEM 1. Relational model I still remember it is my first time to read such an academic article in detail. I have to say that it s really a hard time for me at

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. # 5 Structured Query Language Hello and greetings. In the ongoing

More information

ACS-3902 Fall Ron McFadyen 3D21 Slides are based on chapter 5 (7 th edition) (chapter 3 in 6 th edition)

ACS-3902 Fall Ron McFadyen 3D21 Slides are based on chapter 5 (7 th edition) (chapter 3 in 6 th edition) ACS-3902 Fall 2016 Ron McFadyen 3D21 ron.mcfadyen@acs.uwinnipeg.ca Slides are based on chapter 5 (7 th edition) (chapter 3 in 6 th edition) 1 The Relational Data Model and Relational Database Constraints

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

Database Design. 2-3 Entity Relationship Modeling and ERDs. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

Database Design. 2-3 Entity Relationship Modeling and ERDs. Copyright 2015, Oracle and/or its affiliates. All rights reserved. Database Design 2-3 Objectives This lesson covers the following objectives: Define the meaning of implementation-free as it relates to data models and database design implementation List the four goals

More information

The Relational Model

The Relational Model The Relational Model What is the Relational Model Relations Domain Constraints SQL Integrity Constraints Translating an ER diagram to the Relational Model and SQL Views A relational database consists

More information

DATABASE DEVELOPMENT (H4)

DATABASE DEVELOPMENT (H4) IMIS HIGHER DIPLOMA QUALIFICATIONS DATABASE DEVELOPMENT (H4) Friday 3 rd June 2016 10:00hrs 13:00hrs DURATION: 3 HOURS Candidates should answer ALL the questions in Part A and THREE of the five questions

More information

Data, Information, and Databases

Data, Information, and Databases Data, Information, and Databases BDIS 6.1 Topics Covered Information types: transactional vsanalytical Five characteristics of information quality Database versus a DBMS RDBMS: advantages and terminology

More information

Introduction to MS Access: creating tables, keys, and relationships

Introduction to MS Access: creating tables, keys, and relationships Introduction to MS Access: creating tables, keys, and relationships BSAD 141 Dave Novak Topics Covered Brief introduction to MS Access Name and save a DB file Create tables and keys Create and enforce

More information

Database Systems Relational Model. A.R. Hurson 323 CS Building

Database Systems Relational Model. A.R. Hurson 323 CS Building Relational Model A.R. Hurson 323 CS Building Relational data model Database is represented by a set of tables (relations), in which a row (tuple) represents an entity (object, record) and a column corresponds

More information

Background. vanilladb.org

Background. vanilladb.org Background vanilladb.org Why do you need a database system? 2 To store data, why not just use a file system? 3 Advantages of a Database System It answers queries fast Q1: among a set of blog pages, find

More information

Chapter 5. Database Processing

Chapter 5. Database Processing Chapter 5 Database Processing We Don t Have a Way to Track the Data About the Videos. Falcon Security stores sequentially numbered digital video files in separated directories for each client. Tracking

More information

Database Setup - Local

Database Setup - Local @author R.L. Martinez, Ph.D. Table of Contents Overview... 1 Code Review... 2 Engine Types... 4 Inserting Data... 5 Relation Types... 5 PKs, FK, and Referential Integrity... 7 Entity Relationship Diagrams

More information

CSC 453 Database Technologies. Tanu Malik DePaul University

CSC 453 Database Technologies. Tanu Malik DePaul University CSC 453 Database Technologies Tanu Malik DePaul University A Data Model A notation for describing data or information. Consists of mostly 3 parts: Structure of the data Data structures and relationships

More information

Faculty of Environment & Technology

Faculty of Environment & Technology Faculty of Environment & Technology Academic Year: 2012/13 Module Leader: Module Code: Title of Module: Prakash Chatterjee UFCE8K-15-M Data Management Examination Date: TBA Examination Start time: TBA

More information

Database Fundamentals

Database Fundamentals Database Fundamentals presented to NYPHP May 22, 2007 by Kenneth Downs Secure Data Software, Inc. ken@secdat.com www.secdat.com www.andromeda project.org Pre Relational In the bad old days, every program

More information

Student notes 5.2. The DBMS. Security. Integrity

Student notes 5.2. The DBMS. Security. Integrity Student notes 5.2 The DBMS Modern databases are controlled by a database management system (DBMS). This is software that acts as an intermediary between the data and the applications that the organisation

More information

CSE 530A ACID. Washington University Fall 2013

CSE 530A ACID. Washington University Fall 2013 CSE 530A ACID Washington University Fall 2013 Concurrency Enterprise-scale DBMSs are designed to host multiple databases and handle multiple concurrent connections Transactions are designed to enable Data

More information

The appendix contains information about the Classic Models database. Place your answers on the examination paper and any additional paper used.

The appendix contains information about the Classic Models database. Place your answers on the examination paper and any additional paper used. Name: Student Number: Instructions: Do all 9 questions. There is a total of 87 marks. The appendix contains information about the Classic Models database. Place your answers on the examination paper and

More information

MIS2502: Data Analytics Relational Data Modeling - 1. JaeHwuen Jung

MIS2502: Data Analytics Relational Data Modeling - 1. JaeHwuen Jung MIS2502: Data Analytics Relational Data Modeling - 1 JaeHwuen Jung jaejung@temple.edu http://community.mis.temple.edu/jaejung Where we are Now we re here Data entry Transactional Database Data extraction

More information

Introduction to Databases

Introduction to Databases Introduction to Databases Abou Bakar Kaleem 1 Overview - Database - Relational Databases - Introduction to SQL Introduction to Databases 2 1 Database (1) Database : - is a collection of related data -

More information

CS 405G: Introduction to Database Systems

CS 405G: Introduction to Database Systems CS 405G: Introduction to Database Systems Entity Relationship Model Jinze Liu 9/11/2014 1 CS685 : Special The UNIVERSITY Topics in Data of Mining, KENTUCKY UKY Review A database is a large collection of

More information

Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra

Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra Relational Data Model and Relational Constraints Part 1 A simplified diagram to illustrate the main

More information

MIS2502: Data Analytics Relational Data Modeling. Jing Gong

MIS2502: Data Analytics Relational Data Modeling. Jing Gong MIS2502: Data Analytics Relational Data Modeling Jing Gong gong@temple.edu http://community.mis.temple.edu/gong Where we are Now we re here Data entry Transactional Database Data extraction Analytical

More information

Databases and Database Systems

Databases and Database Systems Page 1 of 6 Databases and Database Systems 9.1 INTRODUCTION: A database can be summarily described as a repository for data. This makes clear that building databases is really a continuation of a human

More information

Institute of Aga. Network Database LECTURER NIYAZ M. SALIH

Institute of Aga. Network Database LECTURER NIYAZ M. SALIH 2017 Institute of Aga Network Database LECTURER NIYAZ M. SALIH Database: A Database is a collection of related data organized in a way that data can be easily accessed, managed and updated. Any piece of

More information

FROM A RELATIONAL TO A MULTI-DIMENSIONAL DATA BASE

FROM A RELATIONAL TO A MULTI-DIMENSIONAL DATA BASE FROM A RELATIONAL TO A MULTI-DIMENSIONAL DATA BASE David C. Hay Essential Strategies, Inc In the buzzword sweepstakes of 1997, the clear winner has to be Data Warehouse. A host of technologies and techniques

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

Database Management Systems,

Database Management Systems, Database Management Systems SQL Query Language (1) 1 Topics Introduction SQL History Domain Definition Elementary Domains User-defined Domains Creating Tables Constraint Definition INSERT Query SELECT

More information

Key Points. COSC 122 Computer Fluency. Databases. What is a database? Databases in the Real-World DBMS. Database System Approach

Key Points. COSC 122 Computer Fluency. Databases. What is a database? Databases in the Real-World DBMS. Database System Approach COSC 122 Computer Fluency Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Key Points 1) allow for easy storage and retrieval of large amounts of information. 2) Relational

More information

Using a DBMS. Shan-Hung Wu & DataLab CS, NTHU

Using a DBMS. Shan-Hung Wu & DataLab CS, NTHU Using a DBMS Shan-Hung Wu & DataLab CS, NTHU DBMS Database A database is a collection of your data stored in a computer A DBMS (DataBase Management System) is a software that manages databases 2 Outline

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

The Hazards of Multi-writing in a Dual-Master Setup

The Hazards of Multi-writing in a Dual-Master Setup The Hazards of Multi-writing in a Dual-Master Setup Jay Janssen MySQL Consulting Lead November 15th, 2012 Explaining the Problem Rules of the Replication Road A given MySQL instance: Can be both a master

More information

Why Relational Databases? Relational databases allow for the storage and analysis of large amounts of data.

Why Relational Databases? Relational databases allow for the storage and analysis of large amounts of data. DATA 301 Introduction to Data Analytics Relational Databases Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca DATA 301: Data Analytics (2) Why Relational Databases? Relational

More information

Relational Model. IT 5101 Introduction to Database Systems. J.G. Zheng Fall 2011

Relational Model. IT 5101 Introduction to Database Systems. J.G. Zheng Fall 2011 Relational Model IT 5101 Introduction to Database Systems J.G. Zheng Fall 2011 Overview What is the relational model? What are the most important practical elements of the relational model? 2 Introduction

More information

MIS2502: Data Analytics Relational Data Modeling. Jing Gong

MIS2502: Data Analytics Relational Data Modeling. Jing Gong MIS2502: Data Analytics Relational Data Modeling Jing Gong gong@temple.edu http://community.mis.temple.edu/gong Where we are Now we re here Data entry Transactional Database Data extraction Analytical

More information

CSE 3241: Database Systems I Databases Introduction (Ch. 1-2) Jeremy Morris

CSE 3241: Database Systems I Databases Introduction (Ch. 1-2) Jeremy Morris CSE 3241: Database Systems I Databases Introduction (Ch. 1-2) Jeremy Morris 1 Outline What is a database? The database approach Advantages Disadvantages Database users Database concepts and System architecture

More information

Databases - Transactions

Databases - Transactions Databases - Transactions Gordon Royle School of Mathematics & Statistics University of Western Australia Gordon Royle (UWA) Transactions 1 / 34 ACID ACID is the one acronym universally associated with

More information

MySQL. A practical introduction to database design

MySQL. A practical introduction to database design MySQL A practical introduction to database design Dr. Chris Tomlinson Bioinformatics Data Science Group, Room 126, Sir Alexander Fleming Building chris.tomlinson@imperial.ac.uk Database Classes 24/09/18

More information

Introduction. Example Databases

Introduction. Example Databases Introduction Example databases Overview of concepts Why use database systems Example Databases University Data: departments, students, exams, rooms,... Usage: creating exam plans, enter exam results, create

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. # 13 Constraints & Triggers Hello and welcome to another session

More information

Test bank for accounting information systems 1st edition by richardson chang and smith

Test bank for accounting information systems 1st edition by richardson chang and smith Test bank for accounting information systems 1st edition by richardson chang and smith Chapter 04 Relational Databases and Enterprise Systems True / False Questions 1. Three types of data models used today

More information

COSC 304 Introduction to Database Systems. Entity-Relationship Modeling

COSC 304 Introduction to Database Systems. Entity-Relationship Modeling COSC 304 Introduction to Database Systems Entity-Relationship Modeling Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Conceptual Database Design Conceptual database design

More information

Session 6: Relational Databases

Session 6: Relational Databases INFM 603: Information Technology and Organizational Context Session 6: Relational Databases Jimmy Lin The ischool University of Maryland Thursday, October 16, 2014 Databases Yesterday Databases Today What

More information

Administration Naive DBMS CMPT 454 Topics. John Edgar 2

Administration Naive DBMS CMPT 454 Topics. John Edgar 2 Administration Naive DBMS CMPT 454 Topics John Edgar 2 http://www.cs.sfu.ca/coursecentral/454/johnwill/ John Edgar 4 Assignments 25% Midterm exam in class 20% Final exam 55% John Edgar 5 A database stores

More information

Referential integrity

Referential integrity Referential integrity Another function of the DBMS is to ensure referential integrity. This refers to the concept that a foreign key in a relation must have a corresponding entry in the table to which

More information

Institute of Aga. Microsoft SQL Server LECTURER NIYAZ M. SALIH

Institute of Aga. Microsoft SQL Server LECTURER NIYAZ M. SALIH Institute of Aga 2018 Microsoft SQL Server LECTURER NIYAZ M. SALIH Database: A Database is a collection of related data organized in a way that data can be easily accessed, managed and updated. Any piece

More information

SQL IN PL/SQL. In this chapter, you will learn about: Making Use of DML in PL/SQL Page 68 Making Use of Savepoint Page 77

SQL IN PL/SQL. In this chapter, you will learn about: Making Use of DML in PL/SQL Page 68 Making Use of Savepoint Page 77 CHAPTER 4 SQL IN PL/SQL CHAPTER OBJECTIVES In this chapter, you will learn about: Making Use of DML in PL/SQL Page 68 Making Use of Savepoint Page 77 This chapter is a collection of some fundamental elements

More information

CSCE Java. Dr. Chris Bourke. Prior to Lab. Peer Programming Pair-Up. Lab 15 - Databases & Java Database Connectivity API

CSCE Java. Dr. Chris Bourke. Prior to Lab. Peer Programming Pair-Up. Lab 15 - Databases & Java Database Connectivity API CSCE 155 - Java Lab 15 - Databases & Java Database Connectivity API Dr. Chris Bourke Prior to Lab Before attending this lab: 1. Read and familiarize yourself with this handout. Some additional resources

More information

Introduction to Database. Dr Simon Jones Thanks to Mariam Mohaideen

Introduction to Database. Dr Simon Jones Thanks to Mariam Mohaideen Introduction to Database Dr Simon Jones simon.jones@nyumc.org Thanks to Mariam Mohaideen Today database theory Key learning outcome - is to understand data normalization Thursday, 19 November Introduction

More information

Rapid Application Development

Rapid Application Development Rapid Application Development Chapter 6: Development Database Application Tools: Microsoft Access Cr: fisher.osu.edu Dr.Orawit Thinnukool College of Arts, Media and Technology, Chiang Mai University Contents

More information

DATABASE MANAGEMENT SYSTEM

DATABASE MANAGEMENT SYSTEM DATABASE MANAGEMENT SYSTEM For COMPUTER SCIENCE DATABASE MANAGEMENT. SYSTEM SYLLABUS ER model. Relational model: relational algebra, tuple calculus, SQL. Integrity constraints, normal forms. File organization,

More information

Chapter 6. Foundations of Business Intelligence: Databases and Information Management VIDEO CASES

Chapter 6. Foundations of Business Intelligence: Databases and Information Management VIDEO CASES Chapter 6 Foundations of Business Intelligence: Databases and Information Management VIDEO CASES Case 1a: City of Dubuque Uses Cloud Computing and Sensors to Build a Smarter, Sustainable City Case 1b:

More information

Excel Tips for Compensation Practitioners Weeks Data Validation and Protection

Excel Tips for Compensation Practitioners Weeks Data Validation and Protection Excel Tips for Compensation Practitioners Weeks 29-38 Data Validation and Protection Week 29 Data Validation and Protection One of the essential roles we need to perform as compensation practitioners is

More information

Outline. Database Management and Tuning. Index Tuning Examples. Exercise 1 Query for Student by Name. Concurrency Tuning. Johann Gamper.

Outline. Database Management and Tuning. Index Tuning Examples. Exercise 1 Query for Student by Name. Concurrency Tuning. Johann Gamper. Outline Database Management and Tuning Johann Gamper 1 Free University of Bozen-Bolzano Faculty of Computer Science IDSE Unit 7 2 3 Conclusion Acknowledgements: The slides are provided by Nikolaus Augsten

More information

Lecture 5 STRUCTURED ANALYSIS. PB007 So(ware Engineering I Faculty of Informa:cs, Masaryk University Fall Bühnová, Sochor, Ráček

Lecture 5 STRUCTURED ANALYSIS. PB007 So(ware Engineering I Faculty of Informa:cs, Masaryk University Fall Bühnová, Sochor, Ráček Lecture 5 STRUCTURED ANALYSIS PB007 So(ware Engineering I Faculty of Informa:cs, Masaryk University Fall 2015 1 Outline ² Yourdon Modern Structured Analysis (YMSA) Context diagram (CD) Data flow diagram

More information

Meaning & Concepts of Databases

Meaning & Concepts of Databases 27 th August 2015 Unit 1 Objective Meaning & Concepts of Databases Learning outcome Students will appreciate conceptual development of Databases Section 1: What is a Database & Applications Section 2:

More information

Access Intermediate

Access Intermediate Access 2010 - Intermediate 103-134 Advanced Queries Quick Links Overview Pages AC116 AC117 Selecting Fields Pages AC118 AC119 AC122 Sorting Results Pages AC125 AC126 Specifying Criteria Pages AC132 AC134

More information

SQL DATA DEFINITION: KEY CONSTRAINTS. CS121: Relational Databases Fall 2017 Lecture 7

SQL DATA DEFINITION: KEY CONSTRAINTS. CS121: Relational Databases Fall 2017 Lecture 7 SQL DATA DEFINITION: KEY CONSTRAINTS CS121: Relational Databases Fall 2017 Lecture 7 Data Definition 2 Covered most of SQL data manipulation operations Continue exploration of SQL data definition features

More information

Relational Model History. COSC 304 Introduction to Database Systems. Relational Model and Algebra. Relational Model Definitions.

Relational Model History. COSC 304 Introduction to Database Systems. Relational Model and Algebra. Relational Model Definitions. COSC 304 Introduction to Database Systems Relational Model and Algebra Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Relational Model History The relational model was

More information

DBM/500 COURSE NOTES

DBM/500 COURSE NOTES WK 1 APPROACHES DBM/500 COURSE NOTES MICROSOFT RELATIONAL ACCESS SYSTEM WK 2 DESIGN TOOLS FOR ANALYSIS ENTITY RELATIONSHIP ERD EXAMPLE WK 3 UNIFIED MODELING LANGUAGE USE CASES APPLICATIONS TOOLS WK 4 NORMALIZATION

More information

Oracle Database 10g Express

Oracle Database 10g Express Oracle Database 10g Express This tutorial prepares the Oracle Database 10g Express Edition Developer to perform common development and administrative tasks of Oracle Database 10g Express Edition. Objectives

More information

CS Reading Packet: "Database Processing and Development"

CS Reading Packet: Database Processing and Development CS 325 - Reading Packet: "Database Processing and Development" p. 1 CS 325 - Reading Packet: "Database Processing and Development" SOURCES: Kroenke, "Database Processing: Fundamentals, Design, and Implementation",

More information

Access Intermediate

Access Intermediate Access 2013 - Intermediate 103-134 Advanced Queries Quick Links Overview Pages AC124 AC125 Selecting Fields Pages AC125 AC128 AC129 AC131 AC238 Sorting Results Pages AC131 AC136 Specifying Criteria Pages

More information

Entity Relationship Diagram (ERD) Dr. Moustafa Elazhary

Entity Relationship Diagram (ERD) Dr. Moustafa Elazhary Entity Relationship Diagram (ERD) Dr. Moustafa Elazhary Data Modeling Data modeling is a very vital as it is like creating a blueprint to build a house before the actual building takes place. It is built

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

Database Programming with SQL

Database Programming with SQL Database Programming with SQL 14-1 Objectives This lesson covers the following objectives: Define the term "constraint" as it relates to data integrity State when it is possible to define a constraint

More information

COSC 122 Computer Fluency. Databases. Dr. Ramon Lawrence University of British Columbia Okanagan

COSC 122 Computer Fluency. Databases. Dr. Ramon Lawrence University of British Columbia Okanagan COSC 122 Computer Fluency Databases Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Key Points 1) Databases allow for easy storage and retrieval of large amounts of information.

More information

SQL Server 2008 Tutorial 3: Database Creation

SQL Server 2008 Tutorial 3: Database Creation SQL Server 2008 Tutorial 3: Database Creation IT 5101 Introduction to Database Systems J.G. Zheng Fall 2011 DDL Action in SQL Server Creating and modifying structures using the graphical interface Table

More information

SQL stands for Structured Query Language. SQL is the lingua franca

SQL stands for Structured Query Language. SQL is the lingua franca Chapter 3: Database for $100, Please In This Chapter Understanding some basic database concepts Taking a quick look at SQL Creating tables Selecting data Joining data Updating and deleting data SQL stands

More information

Standard stuff. Class webpage: cs.rhodes.edu/db Textbook: get it somewhere; used is fine. Prerequisite: CS 241 Coursework:

Standard stuff. Class webpage: cs.rhodes.edu/db Textbook: get it somewhere; used is fine. Prerequisite: CS 241 Coursework: Databases Standard stuff Class webpage: cs.rhodes.edu/db Textbook: get it somewhere; used is fine Stay up with reading! Prerequisite: CS 241 Coursework: Homework, group project, midterm, final Be prepared

More information

Chapter 5. Database Processing

Chapter 5. Database Processing Chapter 5 Database Processing No, Drew, You Don t Know Anything About Creating Queries." AllRoad Parts operational database used to determine which parts to consider for 3D printing. If Addison and Drew

More information

Database Design. Overview

Database Design. Overview Database Design Overview What is database? Why do we bother? Relational database Entity-Relationship Modeling Mapping class diagrams to tables 2 What Is Database? A tool that stores data, and lets you

More information

Information Systems Development COMM005 (CSM03) Autumn Semester 2009

Information Systems Development COMM005 (CSM03) Autumn Semester 2009 Information Systems Development COMM005 (CSM03) Autumn Semester 2009 Dr. Jonathan Y. Clark Email: j.y.clark@surrey.ac.uk Course Website: www.computing.surrey.ac.uk/courses/csm03/isdmain.htm Slide 1 Adapted

More information

To build students capabilities on data modeling

To build students capabilities on data modeling 17 th September 2015 Unit 1 Objective To build students capabilities on data modeling Learning outcome We expect clear understanding of the 3basic model. Type1: Flat model Type 2: Entity-Relationship Model

More information

A practical introduction to database design

A practical introduction to database design A practical introduction to database design Dr. Chris Tomlinson Bioinformatics Data Science Group, Room 126, Sir Alexander Fleming Building chris.tomlinson@imperial.ac.uk Computer Skills Classes 17/01/19

More information

The Relational Model. Why Study the Relational Model? Relational Database: Definitions

The Relational Model. Why Study the Relational Model? Relational Database: Definitions The Relational Model Database Management Systems, R. Ramakrishnan and J. Gehrke 1 Why Study the Relational Model? Most widely used model. Vendors: IBM, Microsoft, Oracle, Sybase, etc. Legacy systems in

More information

01/01/2017. Chapter 5: The Relational Data Model and Relational Database Constraints: Outline. Chapter 5: Relational Database Constraints

01/01/2017. Chapter 5: The Relational Data Model and Relational Database Constraints: Outline. Chapter 5: Relational Database Constraints Chapter 5: The Relational Data Model and Relational Database Constraints: Outline Ramez Elmasri, Shamkant B. Navathe(2017) Fundamentals of Database Systems (7th Edition),pearson, isbn 10: 0-13-397077-9;isbn-13:978-0-13-397077-7.

More information

Microsoft Access Database How to Import/Link Data

Microsoft Access Database How to Import/Link Data Microsoft Access Database How to Import/Link Data Firstly, I would like to thank you for your interest in this Access database ebook guide; a useful reference guide on how to import/link data into an Access

More information

Part 5: Introduction to Logical Design

Part 5: Introduction to Logical Design 5. Introduction to Logical Design 5-1 Part 5: Introduction to Logical Design References: Elmasri/Navathe:Fundamentals of Database Systems, 3rd Edition, 1999. Chapter 3, Data Modeling Using the Entity-Relationship

More information

Database Management Systems

Database Management Systems Database Management Systems Associate Professor Dr. Raed Ibraheem Hamed University of Human Development, College of Science and Technology Computer Science Department 2015 2016 Department of Computer Science

More information

A hypothetical M:M student schedule example

A hypothetical M:M student schedule example A hypothetical : student schedule example We are interested in creating a relationship between two tables: Student and Class Section. We want to be able to be able to have students register for different

More information

Database Management System Prof. D. Janakiram Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No.

Database Management System Prof. D. Janakiram Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No. Database Management System Prof. D. Janakiram Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No. # 20 Concurrency Control Part -1 Foundations for concurrency

More information

Database Technology Introduction. Heiko Paulheim

Database Technology Introduction. Heiko Paulheim Database Technology Introduction Outline The Need for Databases Data Models Relational Databases Database Design Storage Manager Query Processing Transaction Manager Introduction to the Relational Model

More information

COMP 430 Intro. to Database Systems. Encapsulating SQL code

COMP 430 Intro. to Database Systems. Encapsulating SQL code COMP 430 Intro. to Database Systems Encapsulating SQL code Want to bundle SQL into code blocks Like in every other language Encapsulation Abstraction Code reuse Maintenance DB- or application-level? DB:

More information

Full file at

Full file at Modern Database Management, 10e (Hoffer/Ramesh/Topi) Chapter 2 Modeling Data in the Organization 1) Data modeling may be the most important part of the systems development process because: A) data characteristics

More information