Unit 5. Data Modeling and Database Design

Size: px
Start display at page:

Download "Unit 5. Data Modeling and Database Design"

Transcription

1 Unit 5. Data Modeling and Database Design What This Unit Is About This unit describes the BASICS of Data Modeling. What You Should Be Able to Do After completing this unit, you should be able to: State the purpose of a business model Identify an Entity-Relational Diagram (ERD) model State the purpose of an association table List several DB2 UDB column data types Identify non-standard column and table names Identify the characteristics of a Primary Key and Foreign Key State the purpose of Referential Integrity How You Will Check Your Progress Accountability: Checkpoint questions Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-1

2 5-1. Unit Objectives (CF035005) 5-2 DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

3 5.1 Business Modeling Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-3

4 5-2. Business Modeling (CF035010) A business model is a formal representation of business information with the focus on the business, not how the data is going to be stored or on which platform the applications will run. 5-4 DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

5 5-3. Define the Business Entities (CF035015) A business entity is something that is fundamental to the organization and an individual instance or occurrence of this thing can be uniquely identified. Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-5

6 5-4. Draw An Entity Relationship Diagram (ERD) (CF035020) Draw lines between related entities and notate the relationships. 5-6 DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

7 5-5. Benefits of Business Modeling (CF035025) When everyone agrees that the model represents the way business processes are really performed it ensures that all participants have the same understanding of those processes. Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-7

8 5.2 Data Modeling 5-8 DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

9 5-6. Data Modeling (CF035030) Each business entity will be come a data entity (something about which we store data). Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-9

10 5-7. Identify Primary Keys (CF035035) Each occurrence of an entity must be uniquely identified. In small companies, this may be the first time an employee, customer, product, etc., has been assigned a unique identifier DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

11 5-8. Data Modeling (CF035040) Defining a table's columns, its primary and foreign keys, and identifying and removing redundancies are all part of Data Modeling. Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-11

12 5-9. One Table Per Entity (CF035045) General starting point - one table per entity. One row per occurrence of the entity DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

13 5-10. One Column for Each Data Element (CF035050) Each attribute of an entity will be a column in the entity's table. Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-13

14 5.3 Table and Column Names 5-14 DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

15 5-11. Names - Review (CF035055) Column and table names must conform to the above rules. Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-15

16 5-12. Name Examples (CF035060) When non-standard characters are used in table or column names, within our queries the names must be enclosed in double quotes DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

17 5-13. Table Name Construction (CF035065) Table names consist of two parts separated by a period. Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-17

18 5-14. Table Names - References (CF035070) The owner of a table can use the simple table name within an SQL statement. Other users must use the fully qualified table name DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

19 5-15. Column Names - Construction (CF035075) Column names can be prefixed with their table name. Column names must be qualified when the names appear in more than one of the tables accessed in the query. Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-19

20 5.4 Data Types 5-20 DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

21 5-16. Data Types (CF035080) These are all of the DB2 UDB data type categories. Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-21

22 5-17. Numeric Formats (CF035085) The approximate data types are used when there is a need to store super large or small numbers (the number of grains of sand on all the beaches of the world). Big integer is an eight byte field that holds very large whole numbers DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

23 5-18. Character String Formats (CF035090) LONG VARCHAR data in DB2 UDB for UNIX/Intel is stored in data sets separate from the rest of the table. Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-23

24 5-19. Variable Length Strings (CF035095) First page of data holds 2 2 KB rows. The OS/390 page is an example of how OS/390 holds one row due to the LONG VARCHAR field having a maximum length of 'to the end of the page'. The DB2 UDB for UNIX/Intel page shows how 'long field' data is physically stored in data sets. Within a row are pointers to where the long field data is stored DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

25 5-20. Graphic String Formats (CF035100) Graphic data types are analogous to the CHAR data types except in the graphic data types it takes two bytes to represent each character being stored (the alternate name for these data types is 'double byte character sets' (DBCS)). Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-25

26 5-21. Large Objects (CF035105) BLOBs can store images and sound data. CLOBs can store large amounts of character data. DBCLOBS can store large amounts of double byte character data DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

27 5-22. Create Table (CF035110) These data types are specified just like the other data we've learned about. This is an example of using these data types with DB2 UDB for UNIX, Windows, and OS/2. Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-27

28 5-23. DB2 UDB Relational Extenders (CF035115) The DB2 UDB products provide toolkits, called Extenders, that contain sets of predefined datatypes and functions. Each extender helps you to manage a particular kind of data, such as text,image, audio, or video DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

29 5-24. User-Defined Distinct Types and User-Defined Functions (CF035120) These have been discussed earlier, just repeated here for completeness. Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-29

30 5-25. Date/Time Formats (CF035125) DB2 UDB accepts any of these formats in an SQL statement (character string representation of dates, times, and timestamp) DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

31 5.5 NULLs Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-31

32 5-26. Nulls (CF035130) There are three null characteristics DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

33 5.6 Related Data Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-33

34 5-27. Related Data (CF035135) 5-34 DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

35 5-28. Related Tables (CF035140) Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-35

36 5-29. Which Table Gets the Foreign Key? (CF035145) Which table carries the foreign key is determined from the business model DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

37 5.7 Association Table Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-37

38 5-30. Association Table - Many-To-Many (CF035150) A pair of entities may have a many-to-many relationship. An employee may be assigned to many projects, and a project may have many employees assigned to it. For each pair of many-to-many related tables we create an additional table - called an association table - which will be used to document relationships between the related tables DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

39 5-31. Association Table - Normal DB2 UDB Table (CF035155) Association tables are standard DB2 UDB tables and can carry information pertinent to the relationship. Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-39

40 5.8 Referential Integrity 5-40 DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

41 5-32. The Rules DB2 Enforces to Maintain Referential Integrity (CF035160) Primary key values cannot be null. A foreign key contains a set of values from some table's unique key. Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-41

42 5-33. Adding Primary and Foreign Keys to an Existing Table (CF035165) Referential integrity can be added after the tables have been created, via an ALTER TABLE statement DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

43 5-34. Terms (CF035170) The above are definitions of terms. Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-43

44 5-35. Processing Rules Enforced to Maintain Referential Integrity (CF035175) Defined referential integrity causes DB2 to enforce these rules DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

45 5-36. Primary Key Violation (CF035180) Why did the insert fail? Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-45

46 5-37. Foreign Key Violation (CF035185) Why did the insert fail? 5-46 DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

47 5-38. Delete Rules (CF035190) There are three delete rules to choose from. ON DELETE RESTRICT is the default. Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-47

48 5-39. Delete Rules - ON DELETE CASCADE (CF035195) In this example, the referenced table is the department table. The foreign key EMPNO.DEP was defined with an ON DELETE CASCADE rule. What happens when the BLU DEP row is deleted from the department table with ON DELETE CASCADE as the delete rule? All employees in the BLU DEP are also deleted DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

49 5-40. Delete Rules - ON DELETE SET NULL (CF035200) In this example, the referenced table is the department table. The foreign key EMPNO.DEP was defined with an ON DELETE SET NULL rule. When the BLU DEP row is deleted from the department table, DB2 will set the DEP value for all BLU DEP employees, to NULL. Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-49

50 5-41. Delete Rules - ON DELETE RESTRICT (CF035205) In this example, the referenced table is the department table. The foreign key EMPNO.DEP was defined with an ON DELETE RESTRICT rule. Before DB2 will allow the BLU DEP row to be deleted from the department table, it checks to ensure that there are no employee rows with BLU DEP values. If DB2 finds one employee row with a value of BLU in the DEP column, the delete fails (is restricted) DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

51 5.9 Triggers Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-51

52 5-42. Triggers (CF035210) If your application environment needs to enforce particular business rules, before or after changes to DB2 UDB tables take place, DB2 UDB offers you the ability to automatically activate a user-written program (a trigger) which will perform any action you consider appropriate. These programs can be independent from the applications affecting the contents of the table; when a trigger is run, the application that fired the trigger will wait for its completion, as if the trigger had actually been called by the application itself. Triggers are associated with specific tables and will be activated no matter how the table change took place DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

53 5-43. Triggers: A Simple Example (CF035215) Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-53

54 5-44. Triggers: A Sophisticated Example (CF035220) The picture shows an example of how triggers can be used to integrate a traditional application such as order entry with advanced technologies. This could be a very common case of a company acquiring orders over the phone, validating them and sending a confirmation fax to their customer afterwards. Using triggers, the fax could be automatically sent to the customer as soon as the order is inserted into the database file, without changing the order entry application. The insert trigger is invoked every time an order enters the orders file; the new records are automatically passed to the trigger program as input parameters. The program might produce a predefined document with the new order and customer data, and send a fax to the customer DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

55 5.10 Normalization Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-55

56 5-45. Normalization - First Normal Form (CF035225) Normalization is the process of steps that will identify for elimination redundancies in a database design DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

57 5-46. Normalization - Second Normal Form (CF035230) Second normal form requires a close look at proposed tables that have multi-column primary keys. The objective is to eliminate all columns from a table's design, that are dependent on only part of the primary key. Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-57

58 5-47. Normalization - Third Normal Form (CF035235) Third normal form tells us to look at each proposed table and ask of each column 'is this column's value dependent on the primary key or some other column within the table DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

59 5-48. Normalization Recommendation (CF035240) Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-59

60 5-49. Questions to Answer (CF035245) Answers to these questions help to determine whether data should be denormalized DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

61 5-50. Normalization/Denormalization Example (CF035250) Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-61

62 5-51. Denormalization Example (CF035255) Denormalization could improve the performance of our critical transaction. Transition Statement Let's look at the costs and benefits of denormalization DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

63 5-52. Costs and Benefits of Denormalization (CF035260) The costs are 900 additional pages of storage and additional updates to the second MGRNO column. The benefits are 20,000 avoided joins each day. Transition Statement Let's answer the checkpoint questions. Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-63

64 Checkpoint Exercise Unit 5 Checkpoint 1. What is a business entity? 2. What are the two basic parts to a table name? 3. List some of the DB2 UDB data types DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

65 4. Suppose we are creating two tables. One called ORDER_TAB will contain one row for each order taken by our company. It's primary key will be ORDER_NO. The second table is called ITEM_TAB and will contain one row for each item ordered (within an order a customer can order many items). Into which table should the foreign key be placed? 5. For a foreign key to be defined the column (or columns) it references must have what characteristic? 6. When must an association table be created. 7. From which SQL statements may primary and foreign keys be defined? 8. What is a referential constraint? 9. What is the 'automatic enforcement' of referential constraints called? Copyright IBM Corp. 1997, 2000 Unit 5. Data Modeling 5-65

66 5-53. Unit Summary (CF035265) 5-66 DB2 Family Fundamentals Copyright IBM Corp. 1997, 2000

Working with DB2 UDB objects

Working with DB2 UDB objects Working with DB2 UDB objects http://www7b.software.ibm.com/dmdd/ Table of Contents If you're viewing this document online, you can click any of the topics below to link directly to that section. 1. Introduction...

More information

Fundamentals of Database Design

Fundamentals of Database Design Fundamentals of Database Design Zornitsa Zaharieva CERN Data Management Section - Controls Group Accelerators and Beams Department /AB-CO-DM/ 23-FEB-2005 Contents : Introduction to Databases : Main Database

More information

Introduction This document s purpose is to define Microsoft SQL server database design standards.

Introduction This document s purpose is to define Microsoft SQL server database design standards. Introduction This document s purpose is to define Microsoft SQL server database design standards. The database being developed or changed should be depicted in an ERD (Entity Relationship Diagram). The

More information

Physical Design. Meeting the needs of the users is the gold standard against which we measure our success in creating a database.

Physical Design. Meeting the needs of the users is the gold standard against which we measure our success in creating a database. Physical Design Physical Database Design (Defined): Process of producing a description of the implementation of the database on secondary storage; it describes the base relations, file organizations, and

More information

How To Create A Table In Sql 2.5.2.2 (Ahem)

How To Create A Table In Sql 2.5.2.2 (Ahem) Database Systems Unit 5 Database Implementation: SQL Data Definition Language Learning Goals In this unit you will learn how to transfer a logical data model into a physical database, how to extend or

More information

3.GETTING STARTED WITH ORACLE8i

3.GETTING STARTED WITH ORACLE8i Oracle For Beginners Page : 1 3.GETTING STARTED WITH ORACLE8i Creating a table Datatypes Displaying table definition using DESCRIBE Inserting rows into a table Selecting rows from a table Editing SQL buffer

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

Guide to Upsizing from Access to SQL Server

Guide to Upsizing from Access to SQL Server Guide to Upsizing from Access to SQL Server An introduction to the issues involved in upsizing an application from Microsoft Access to SQL Server January 2003 Aztec Computing 1 Why Should I Consider Upsizing

More information

Using SQL Server Management Studio

Using SQL Server Management Studio Using SQL Server Management Studio Microsoft SQL Server Management Studio 2005 is a graphical tool for database designer or programmer. With SQL Server Management Studio 2005 you can: Create databases

More information

A basic create statement for a simple student table would look like the following.

A basic create statement for a simple student table would look like the following. Creating Tables A basic create statement for a simple student table would look like the following. create table Student (SID varchar(10), FirstName varchar(30), LastName varchar(30), EmailAddress varchar(30));

More information

Once the schema has been designed, it can be implemented in the RDBMS.

Once the schema has been designed, it can be implemented in the RDBMS. 2. Creating a database Designing the database schema... 1 Representing Classes, Attributes and Objects... 2 Data types... 5 Additional constraints... 6 Choosing the right fields... 7 Implementing a table

More information

Unit 3. Retrieving Data from Multiple Tables

Unit 3. Retrieving Data from Multiple Tables Unit 3. Retrieving Data from Multiple Tables What This Unit Is About How to retrieve columns from more than one table or view. What You Should Be Able to Do Retrieve data from more than one table or view.

More information

In This Lecture. SQL Data Definition SQL SQL. Notes. Non-Procedural Programming. Database Systems Lecture 5 Natasha Alechina

In This Lecture. SQL Data Definition SQL SQL. Notes. Non-Procedural Programming. Database Systems Lecture 5 Natasha Alechina This Lecture Database Systems Lecture 5 Natasha Alechina The language, the relational model, and E/R diagrams CREATE TABLE Columns Primary Keys Foreign Keys For more information Connolly and Begg chapter

More information

SQL Server Database Coding Standards and Guidelines

SQL Server Database Coding Standards and Guidelines SQL Server Database Coding Standards and Guidelines http://www.sqlauthority.com Naming Tables: Stored Procs: Triggers: Indexes: Primary Keys: Foreign Keys: Defaults: Columns: General Rules: Rules: Pascal

More information

4 Simple Database Features

4 Simple Database Features 4 Simple Database Features Now we come to the largest use of iseries Navigator for programmers the Databases function. IBM is no longer developing DDS (Data Description Specifications) for database definition,

More information

Lecture 6. SQL, Logical DB Design

Lecture 6. SQL, Logical DB Design Lecture 6 SQL, Logical DB Design Relational Query Languages A major strength of the relational model: supports simple, powerful querying of data. Queries can be written intuitively, and the DBMS is responsible

More information

4 Logical Design : RDM Schema Definition with SQL / DDL

4 Logical Design : RDM Schema Definition with SQL / DDL 4 Logical Design : RDM Schema Definition with SQL / DDL 4.1 SQL history and standards 4.2 SQL/DDL first steps 4.2.1 Basis Schema Definition using SQL / DDL 4.2.2 SQL Data types, domains, user defined types

More information

SQL NULL s, Constraints, Triggers

SQL NULL s, Constraints, Triggers CS145 Lecture Notes #9 SQL NULL s, Constraints, Triggers Example schema: CREATE TABLE Student (SID INTEGER PRIMARY KEY, name CHAR(30), age INTEGER, GPA FLOAT); CREATE TABLE Take (SID INTEGER, CID CHAR(10),

More information

SQL Server. 1. What is RDBMS?

SQL Server. 1. What is RDBMS? SQL Server 1. What is RDBMS? Relational Data Base Management Systems (RDBMS) are database management systems that maintain data records and indices in tables. Relationships may be created and maintained

More information

The Relational Model. Why Study the Relational Model?

The Relational Model. Why Study the Relational Model? The Relational Model Chapter 3 Instructor: Vladimir Zadorozhny vladimir@sis.pitt.edu Information Science Program School of Information Sciences, University of Pittsburgh 1 Why Study the Relational Model?

More information

Embedded SQL programming

Embedded SQL programming Embedded SQL programming http://www-136.ibm.com/developerworks/db2 Table of contents If you're viewing this document online, you can click any of the topics below to link directly to that section. 1. Before

More information

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

The Relational Model. Why Study the Relational Model? Relational Database: Definitions. Chapter 3 The Relational Model Chapter 3 Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Why Study the Relational Model? Most widely used model. Vendors: IBM, Informix, Microsoft, Oracle, Sybase,

More information

SQL Server An Overview

SQL Server An Overview SQL Server An Overview SQL Server Microsoft SQL Server is designed to work effectively in a number of environments: As a two-tier or multi-tier client/server database system As a desktop database system

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

EECS 647: Introduction to Database Systems

EECS 647: Introduction to Database Systems EECS 647: Introduction to Database Systems Instructor: Luke Huan Spring 2013 Administrative Take home background survey is due this coming Friday The grader of this course is Ms. Xiaoli Li and her email

More information

SQL Simple Queries. Chapter 3.1 V3.0. Copyright @ Napier University Dr Gordon Russell

SQL Simple Queries. Chapter 3.1 V3.0. Copyright @ Napier University Dr Gordon Russell SQL Simple Queries Chapter 3.1 V3.0 Copyright @ Napier University Dr Gordon Russell Introduction SQL is the Structured Query Language It is used to interact with the DBMS SQL can Create Schemas in the

More information

SQL Data Definition. Database Systems Lecture 5 Natasha Alechina

SQL Data Definition. Database Systems Lecture 5 Natasha Alechina Database Systems Lecture 5 Natasha Alechina In This Lecture SQL The SQL language SQL, the relational model, and E/R diagrams CREATE TABLE Columns Primary Keys Foreign Keys For more information Connolly

More information

Physical Database Design Process. Physical Database Design Process. Major Inputs to Physical Database. Components of Physical Database Design

Physical Database Design Process. Physical Database Design Process. Major Inputs to Physical Database. Components of Physical Database Design Physical Database Design Process Physical Database Design Process The last stage of the database design process. A process of mapping the logical database structure developed in previous stages into internal

More information

Databasesystemer, forår 2005 IT Universitetet i København. Forelæsning 3: Business rules, constraints & triggers. 3. marts 2005

Databasesystemer, forår 2005 IT Universitetet i København. Forelæsning 3: Business rules, constraints & triggers. 3. marts 2005 Databasesystemer, forår 2005 IT Universitetet i København Forelæsning 3: Business rules, constraints & triggers. 3. marts 2005 Forelæser: Rasmus Pagh Today s lecture Constraints and triggers Uniqueness

More information

Data Modeling. Database Systems: The Complete Book Ch. 4.1-4.5, 7.1-7.4

Data Modeling. Database Systems: The Complete Book Ch. 4.1-4.5, 7.1-7.4 Data Modeling Database Systems: The Complete Book Ch. 4.1-4.5, 7.1-7.4 Data Modeling Schema: The structure of the data Structured Data: Relational, XML-DTD, etc Unstructured Data: CSV, JSON But where does

More information

The Relational Model. Ramakrishnan&Gehrke, Chapter 3 CS4320 1

The Relational Model. Ramakrishnan&Gehrke, Chapter 3 CS4320 1 The Relational Model Ramakrishnan&Gehrke, Chapter 3 CS4320 1 Why Study the Relational Model? Most widely used model. Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc. Legacy systems in older models

More information

IT2305 Database Systems I (Compulsory)

IT2305 Database Systems I (Compulsory) Database Systems I (Compulsory) INTRODUCTION This is one of the 4 modules designed for Semester 2 of Bachelor of Information Technology Degree program. CREDITS: 04 LEARNING OUTCOMES On completion of this

More information

Chapter 6: Physical Database Design and Performance. Database Development Process. Physical Design Process. Physical Database Design

Chapter 6: Physical Database Design and Performance. Database Development Process. Physical Design Process. Physical Database Design Chapter 6: Physical Database Design and Performance Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden Robert C. Nickerson ISYS 464 Spring 2003 Topic 23 Database

More information

CS2Bh: Current Technologies. Introduction to XML and Relational Databases. The Relational Model. The relational model

CS2Bh: Current Technologies. Introduction to XML and Relational Databases. The Relational Model. The relational model CS2Bh: Current Technologies Introduction to XML and Relational Databases Spring 2005 The Relational Model CS2 Spring 2005 (LN6) 1 The relational model Proposed by Codd in 1970. It is the dominant data

More information

Programming with SQL

Programming with SQL Unit 43: Programming with SQL Learning Outcomes A candidate following a programme of learning leading to this unit will be able to: Create queries to retrieve information from relational databases using

More information

There are five fields or columns, with names and types as shown above.

There are five fields or columns, with names and types as shown above. 3 THE RELATIONAL MODEL Exercise 3.1 Define the following terms: relation schema, relational database schema, domain, attribute, attribute domain, relation instance, relation cardinality, andrelation degree.

More information

SQL DATA DEFINITION: KEY CONSTRAINTS. CS121: Introduction to Relational Database Systems Fall 2015 Lecture 7

SQL DATA DEFINITION: KEY CONSTRAINTS. CS121: Introduction to Relational Database Systems Fall 2015 Lecture 7 SQL DATA DEFINITION: KEY CONSTRAINTS CS121: Introduction to Relational Database Systems Fall 2015 Lecture 7 Data Definition 2 Covered most of SQL data manipulation operations Continue exploration of SQL

More information

Relational Database Concepts

Relational Database Concepts Relational Database Concepts IBM Information Management Cloud Computing Center of Competence IBM Canada Labs 1 2011 IBM Corporation Agenda Overview Information and Data Models The relational model Entity-Relationship

More information

5.1 Database Schema. 5.1.1 Schema Generation in SQL

5.1 Database Schema. 5.1.1 Schema Generation in SQL 5.1 Database Schema The database schema is the complete model of the structure of the application domain (here: relational schema): relations names of attributes domains of attributes keys additional constraints

More information

Databases What the Specification Says

Databases What the Specification Says Databases What the Specification Says Describe flat files and relational databases, explaining the differences between them; Design a simple relational database to the third normal form (3NF), using entityrelationship

More information

IT2304: Database Systems 1 (DBS 1)

IT2304: Database Systems 1 (DBS 1) : Database Systems 1 (DBS 1) (Compulsory) 1. OUTLINE OF SYLLABUS Topic Minimum number of hours Introduction to DBMS 07 Relational Data Model 03 Data manipulation using Relational Algebra 06 Data manipulation

More information

Relational model. Relational model - practice. Relational Database Definitions 9/27/11. Relational model. Relational Database: Terminology

Relational model. Relational model - practice. Relational Database Definitions 9/27/11. Relational model. Relational Database: Terminology COS 597A: Principles of Database and Information Systems elational model elational model A formal (mathematical) model to represent objects (data/information), relationships between objects Constraints

More information

Database Design Standards. U.S. Small Business Administration Office of the Chief Information Officer Office of Information Systems Support

Database Design Standards. U.S. Small Business Administration Office of the Chief Information Officer Office of Information Systems Support Database Design Standards U.S. Small Business Administration Office of the Chief Information Officer Office of Information Systems Support TABLE OF CONTENTS CHAPTER PAGE NO 1. Standards and Conventions

More information

Database Migration : An In Depth look!!

Database Migration : An In Depth look!! Database Migration : An In Depth look!! By Anil Mahadev anilm001@gmail.com As most of you are aware of the fact that just like operating System migrations are taking place, databases are no different.

More information

Outline. Data Modeling. Conceptual Design. ER Model Basics: Entities. ER Model Basics: Relationships. Ternary Relationships. Yanlei Diao UMass Amherst

Outline. Data Modeling. Conceptual Design. ER Model Basics: Entities. ER Model Basics: Relationships. Ternary Relationships. Yanlei Diao UMass Amherst Outline Data Modeling Yanlei Diao UMass Amherst v Conceptual Design: ER Model v Relational Model v Logical Design: from ER to Relational Slides Courtesy of R. Ramakrishnan and J. Gehrke 1 2 Conceptual

More information

LOBs were introduced back with DB2 V6, some 13 years ago. (V6 GA 25 June 1999) Prior to the introduction of LOBs, the max row size was 32K and the

LOBs were introduced back with DB2 V6, some 13 years ago. (V6 GA 25 June 1999) Prior to the introduction of LOBs, the max row size was 32K and the First of all thanks to Frank Rhodes and Sandi Smith for providing the material, research and test case results. You have been working with LOBS for a while now, but V10 has added some new functionality.

More information

Managing Objects with Data Dictionary Views. Copyright 2006, Oracle. All rights reserved.

Managing Objects with Data Dictionary Views. Copyright 2006, Oracle. All rights reserved. Managing Objects with Data Dictionary Views Objectives After completing this lesson, you should be able to do the following: Use the data dictionary views to research data on your objects Query various

More information

RNDr. Michal Kopecký, Ph.D. Department of Software Engineering, Faculty of Mathematics and Physics, Charles University in Prague

RNDr. Michal Kopecký, Ph.D. Department of Software Engineering, Faculty of Mathematics and Physics, Charles University in Prague course: Database Applications (NDBI026) WS2015/16 RNDr. Michal Kopecký, Ph.D. Department of Software Engineering, Faculty of Mathematics and Physics, Charles University in Prague student duties final DB

More information

Database Administration with MySQL

Database Administration with MySQL Database Administration with MySQL Suitable For: Database administrators and system administrators who need to manage MySQL based services. Prerequisites: Practical knowledge of SQL Some knowledge of relational

More information

The Entity-Relationship Model

The Entity-Relationship Model The Entity-Relationship Model 221 After completing this chapter, you should be able to explain the three phases of database design, Why are multiple phases useful? evaluate the significance of the Entity-Relationship

More information

Extracting META information from Interbase/Firebird SQL (INFORMATION_SCHEMA)

Extracting META information from Interbase/Firebird SQL (INFORMATION_SCHEMA) 13 November 2007 22:30 Extracting META information from Interbase/Firebird SQL (INFORMATION_SCHEMA) By: http://www.alberton.info/firebird_sql_meta_info.html The SQL 2003 Standard introduced a new schema

More information

CSC 443 Data Base Management Systems. Basic SQL

CSC 443 Data Base Management Systems. Basic SQL CSC 443 Data Base Management Systems Lecture 6 SQL As A Data Definition Language Basic SQL SQL language Considered one of the major reasons for the commercial success of relational databases SQL Structured

More information

Maintaining Stored Procedures in Database Application

Maintaining Stored Procedures in Database Application Maintaining Stored Procedures in Database Application Santosh Kakade 1, Rohan Thakare 2, Bhushan Sapare 3, Dr. B.B. Meshram 4 Computer Department VJTI, Mumbai 1,2,3. Head of Computer Department VJTI, Mumbai

More information

Demystified CONTENTS Acknowledgments xvii Introduction xix CHAPTER 1 Database Fundamentals CHAPTER 2 Exploring Relational Database Components

Demystified CONTENTS Acknowledgments xvii Introduction xix CHAPTER 1 Database Fundamentals CHAPTER 2 Exploring Relational Database Components Acknowledgments xvii Introduction xix CHAPTER 1 Database Fundamentals 1 Properties of a Database 1 The Database Management System (DBMS) 2 Layers of Data Abstraction 3 Physical Data Independence 5 Logical

More information

Schema Evolution in SQL-99 and Commercial (Object-)Relational DBMS

Schema Evolution in SQL-99 and Commercial (Object-)Relational DBMS Schema Evolution in SQL-99 and Commercial (Object-)Relational DBMS Can Türker Swiss Federal Institute of Technology (ETH) Zurich Institute of Information Systems, ETH Zentrum CH 8092 Zurich, Switzerland

More information

Optimum Database Design: Using Normal Forms and Ensuring Data Integrity. by Patrick Crever, Relational Database Programmer, Synergex

Optimum Database Design: Using Normal Forms and Ensuring Data Integrity. by Patrick Crever, Relational Database Programmer, Synergex Optimum Database Design: Using Normal Forms and Ensuring Data Integrity by Patrick Crever, Relational Database Programmer, Synergex Printed: April 2007 The information contained in this document is subject

More information

IENG2004 Industrial Database and Systems Design. Microsoft Access I. What is Microsoft Access? Architecture of Microsoft Access

IENG2004 Industrial Database and Systems Design. Microsoft Access I. What is Microsoft Access? Architecture of Microsoft Access IENG2004 Industrial Database and Systems Design Microsoft Access I Defining databases (Chapters 1 and 2) Alison Balter Mastering Microsoft Access 2000 Development SAMS, 1999 What is Microsoft Access? Microsoft

More information

The Structured Query Language. De facto standard used to interact with relational DB management systems Two major branches

The Structured Query Language. De facto standard used to interact with relational DB management systems Two major branches CSI 2132 Tutorial 6 The Structured Query Language (SQL) The Structured Query Language De facto standard used to interact with relational DB management systems Two major branches DDL (Data Definition Language)

More information

Database Migration from MySQL to RDM Server

Database Migration from MySQL to RDM Server MIGRATION GUIDE Database Migration from MySQL to RDM Server A Birdstep Technology, Inc. Raima Embedded Database Division Migration Guide Published: May, 2009 Author: Daigoro F. Toyama Senior Software Engineer

More information

PL/SQL MOCK TEST PL/SQL MOCK TEST I

PL/SQL MOCK TEST PL/SQL MOCK TEST I http://www.tutorialspoint.com PL/SQL MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to PL/SQL. You can download these sample mock tests at your local

More information

TIM 50 - Business Information Systems

TIM 50 - Business Information Systems TIM 50 - Business Information Systems Lecture 15 UC Santa Cruz March 1, 2015 The Database Approach to Data Management Database: Collection of related files containing records on people, places, or things.

More information

Application Development Guide: Programming Server Applications

Application Development Guide: Programming Server Applications IBM DB2 Universal Database Application Development Guide: Programming Server Applications Version 8 SC09-4827-00 IBM DB2 Universal Database Application Development Guide: Programming Server Applications

More information

AUTHENTICATION... 2 Step 1:Set up your LDAP server... 2 Step 2: Set up your username... 4 WRITEBACK REPORT... 8 Step 1: Table structures...

AUTHENTICATION... 2 Step 1:Set up your LDAP server... 2 Step 2: Set up your username... 4 WRITEBACK REPORT... 8 Step 1: Table structures... AUTHENTICATION... 2 Step 1:Set up your LDAP server... 2 Step 2: Set up your username... 4 WRITEBACK REPORT... 8 Step 1: Table structures... 8 Step 2: Import Tables into BI Admin.... 9 Step 3: Creating

More information

Tutorial on Relational Database Design

Tutorial on Relational Database Design Tutorial on Relational Database Design Introduction Relational database was proposed by Edgar Codd (of IBM Research) around 1969. It has since become the dominant database model for commercial applications

More information

Data Modeling Basics

Data Modeling Basics Information Technology Standard Commonwealth of Pennsylvania Governor's Office of Administration/Office for Information Technology STD Number: STD-INF003B STD Title: Data Modeling Basics Issued by: Deputy

More information

An Oracle White Paper June 2013. Migrating Applications and Databases with Oracle Database 12c

An Oracle White Paper June 2013. Migrating Applications and Databases with Oracle Database 12c An Oracle White Paper June 2013 Migrating Applications and Databases with Oracle Database 12c Disclaimer The following is intended to outline our general product direction. It is intended for information

More information

CSCE 156H/RAIK 184H Assignment 4 - Project Phase III Database Design

CSCE 156H/RAIK 184H Assignment 4 - Project Phase III Database Design CSCE 156H/RAIK 184H Assignment 4 - Project Phase III Database Design Dr. Chris Bourke Spring 2016 1 Introduction In the previous phase of this project, you built an application framework that modeled the

More information

A Rational Software Whitepaper

A Rational Software Whitepaper The UML and Data Modeling A Rational Software Whitepaper Table of Contents Introduction...1 The UML Data Modeling Profile...1 Database...1 Schema...2 Table...2 Key...3 Index...4 Relationship...5 Column...6

More information

5. CHANGING STRUCTURE AND DATA

5. CHANGING STRUCTURE AND DATA Oracle For Beginners Page : 1 5. CHANGING STRUCTURE AND DATA Altering the structure of a table Dropping a table Manipulating data Transaction Locking Read Consistency Summary Exercises Altering the structure

More information

Conventional Files versus the Database. Files versus Database. Pros and Cons of Conventional Files. Pros and Cons of Databases. Fields (continued)

Conventional Files versus the Database. Files versus Database. Pros and Cons of Conventional Files. Pros and Cons of Databases. Fields (continued) Conventional Files versus the Database Files versus Database File a collection of similar records. Files are unrelated to each other except in the code of an application program. Data storage is built

More information

Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification

Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 Outline More Complex SQL Retrieval Queries

More information

SQL Server. 2012 for developers. murach's TRAINING & REFERENCE. Bryan Syverson. Mike Murach & Associates, Inc. Joel Murach

SQL Server. 2012 for developers. murach's TRAINING & REFERENCE. Bryan Syverson. Mike Murach & Associates, Inc. Joel Murach TRAINING & REFERENCE murach's SQL Server 2012 for developers Bryan Syverson Joel Murach Mike Murach & Associates, Inc. 4340 N. Knoll Ave. Fresno, CA 93722 www.murach.com murachbooks@murach.com Expanded

More information

www.dotnetsparkles.wordpress.com

www.dotnetsparkles.wordpress.com Database Design Considerations Designing a database requires an understanding of both the business functions you want to model and the database concepts and features used to represent those business functions.

More information

ERserver. DB2 Universal Database for iseries SQL Programming with Host Languages. iseries. Version 5

ERserver. DB2 Universal Database for iseries SQL Programming with Host Languages. iseries. Version 5 ERserver iseries DB2 Universal Database for iseries SQL Programming with Host Languages Version 5 ERserver iseries DB2 Universal Database for iseries SQL Programming with Host Languages Version 5 Copyright

More information

Unified XML/relational storage March 2005. The IBM approach to unified XML/relational databases

Unified XML/relational storage March 2005. The IBM approach to unified XML/relational databases March 2005 The IBM approach to unified XML/relational databases Page 2 Contents 2 What is native XML storage? 3 What options are available today? 3 Shred 5 CLOB 5 BLOB (pseudo native) 6 True native 7 The

More information

A Brief Introduction to MySQL

A Brief Introduction to MySQL A Brief Introduction to MySQL by Derek Schuurman Introduction to Databases A database is a structured collection of logically related data. One common type of database is the relational database, a term

More information

Advanced SQL. Jim Mason. www.ebt-now.com Web solutions for iseries engineer, build, deploy, support, train 508-728-4353. jemason@ebt-now.

Advanced SQL. Jim Mason. www.ebt-now.com Web solutions for iseries engineer, build, deploy, support, train 508-728-4353. jemason@ebt-now. Advanced SQL Jim Mason jemason@ebt-now.com www.ebt-now.com Web solutions for iseries engineer, build, deploy, support, train 508-728-4353 What We ll Cover SQL and Database environments Managing Database

More information

14 Triggers / Embedded SQL

14 Triggers / Embedded SQL 14 Triggers / Embedded SQL COMS20700 Databases Dr. Essam Ghadafi TRIGGERS A trigger is a procedure that is executed automatically whenever a specific event occurs. You can use triggers to enforce constraints

More information

Choosing a Data Model for Your Database

Choosing a Data Model for Your Database In This Chapter This chapter describes several issues that a database administrator (DBA) must understand to effectively plan for a database. It discusses the following topics: Choosing a data model for

More information

Intermediate SQL C H A P T E R4. Practice Exercises. 4.1 Write the following queries in SQL:

Intermediate SQL C H A P T E R4. Practice Exercises. 4.1 Write the following queries in SQL: C H A P T E R4 Intermediate SQL Practice Exercises 4.1 Write the following queries in SQL: a. Display a list of all instructors, showing their ID, name, and the number of sections that they have taught.

More information

PL/SQL Overview. Basic Structure and Syntax of PL/SQL

PL/SQL Overview. Basic Structure and Syntax of PL/SQL PL/SQL Overview PL/SQL is Procedural Language extension to SQL. It is loosely based on Ada (a variant of Pascal developed for the US Dept of Defense). PL/SQL was first released in ١٩٩٢ as an optional extension

More information

Microsoft Access Basics

Microsoft Access Basics Microsoft Access Basics 2006 ipic Development Group, LLC Authored by James D Ballotti Microsoft, Access, Excel, Word, and Office are registered trademarks of the Microsoft Corporation Version 1 - Revision

More information

Introduction to Microsoft Jet SQL

Introduction to Microsoft Jet SQL Introduction to Microsoft Jet SQL Microsoft Jet SQL is a relational database language based on the SQL 1989 standard of the American Standards Institute (ANSI). Microsoft Jet SQL contains two kinds of

More information

not at all a manual simply a quick how-to-do guide

not at all a manual simply a quick how-to-do guide not at all a manual simply a quick how-to-do guide As a general rule, the GUI implemented by spatialite-gis is closely related to the one implemented by the companion app spatialite-gui So, if you are

More information

Creating Database Tables in Microsoft SQL Server

Creating Database Tables in Microsoft SQL Server Creating Database Tables in Microsoft SQL Server Microsoft SQL Server is a relational database server that stores and retrieves data for multi-user network-based applications. SQL Server databases are

More information

The Relational Data Model: Structure

The Relational Data Model: Structure The Relational Data Model: Structure 1 Overview By far the most likely data model in which you ll implement a database application today. Of historical interest: the relational model is not the first implementation

More information

Handling Exceptions. Copyright 2006, Oracle. All rights reserved. Oracle Database 10g: PL/SQL Fundamentals 8-1

Handling Exceptions. Copyright 2006, Oracle. All rights reserved. Oracle Database 10g: PL/SQL Fundamentals 8-1 Handling Exceptions Copyright 2006, Oracle. All rights reserved. Oracle Database 10g: PL/SQL Fundamentals 8-1 Objectives After completing this lesson, you should be able to do the following: Define PL/SQL

More information

Foreign and Primary Keys in RDM Embedded SQL: Efficiently Implemented Using the Network Model

Foreign and Primary Keys in RDM Embedded SQL: Efficiently Implemented Using the Network Model Foreign and Primary Keys in RDM Embedded SQL: Efficiently Implemented Using the Network Model By Randy Merilatt, Chief Architect - January 2012 This article is relative to the following versions of RDM:

More information

Data Tool Platform SQL Development Tools

Data Tool Platform SQL Development Tools Data Tool Platform SQL Development Tools ekapner Contents Setting SQL Development Preferences...5 Execution Plan View Options Preferences...5 General Preferences...5 Label Decorations Preferences...6

More information

Temporal Features in SQL standard

Temporal Features in SQL standard WG2 N1536 WG3: KOA-046 Temporal Features in SQL standard Krishna Kulkarni, IBM Corporation krishnak@us.ibm.com May 13, 2011 1 Agenda Brief description of the SQL standard List of features in the latest

More information

MS ACCESS DATABASE DATA TYPES

MS ACCESS DATABASE DATA TYPES MS ACCESS DATABASE DATA TYPES Data Type Use For Size Text Memo Number Text or combinations of text and numbers, such as addresses. Also numbers that do not require calculations, such as phone numbers,

More information

Database IST400/600. Jian Qin. A collection of data? A computer system? Everything you collected for your group project?

Database IST400/600. Jian Qin. A collection of data? A computer system? Everything you collected for your group project? Relational Databases IST400/600 Jian Qin Database A collection of data? Everything you collected for your group project? A computer system? File? Spreadsheet? Information system? Date s criteria: Integration

More information

A. TRUE-FALSE: GROUP 2 PRACTICE EXAMPLES FOR THE REVIEW QUIZ:

A. TRUE-FALSE: GROUP 2 PRACTICE EXAMPLES FOR THE REVIEW QUIZ: GROUP 2 PRACTICE EXAMPLES FOR THE REVIEW QUIZ: Review Quiz will contain very similar question as below. Some questions may even be repeated. The order of the questions are random and are not in order of

More information

Oracle(PL/SQL) Training

Oracle(PL/SQL) Training Oracle(PL/SQL) Training 30 Days Course Description: This course is designed for people who have worked with other relational databases and have knowledge of SQL, another course, called Introduction to

More information

Geodatabase Programming with SQL

Geodatabase Programming with SQL DevSummit DC February 11, 2015 Washington, DC Geodatabase Programming with SQL Craig Gillgrass Assumptions Basic knowledge of SQL and relational databases Basic knowledge of the Geodatabase We ll hold

More information

Introduction to SQL and database objects

Introduction to SQL and database objects Introduction to SQL and database objects IBM Information Management Cloud Computing Center of Competence IBM Canada Labs 1 2011 IBM Corporation Agenda Overview Database objects SQL introduction The SELECT

More information

6. SQL/XML. 6.1 Introduction. 6.1 Introduction. 6.1 Introduction. 6.1 Introduction. XML Databases 6. SQL/XML. Creating XML documents from a database

6. SQL/XML. 6.1 Introduction. 6.1 Introduction. 6.1 Introduction. 6.1 Introduction. XML Databases 6. SQL/XML. Creating XML documents from a database XML Databases Silke Eckstein Andreas Kupfer Institut für Informationssysteme Technische Universität http://www.ifis.cs.tu-bs.de in XML XML Databases SilkeEckstein Institut fürinformationssysteme TU 2 Creating

More information

Databases in Engineering / Lab-1 (MS-Access/SQL)

Databases in Engineering / Lab-1 (MS-Access/SQL) COVER PAGE Databases in Engineering / Lab-1 (MS-Access/SQL) ITU - Geomatics 2014 2015 Fall 1 Table of Contents COVER PAGE... 0 1. INTRODUCTION... 3 1.1 Fundamentals... 3 1.2 How To Create a Database File

More information

Driver for JDBC Implementation Guide

Driver for JDBC Implementation Guide www.novell.com/documentation Driver for JDBC Implementation Guide Identity Manager 4.0.2 January 2014 Legal Notices Novell, Inc. makes no representations or warranties with respect to the contents or use

More information