CPS352 Database Systems: Design Project

Similar documents
Database Design and the E-R Model

Exercise 1: Relational Model

CMPT 354 Database Systems. Simon Fraser University Summer Instructor: Oliver Schulte

Database Design. Marta Jakubowska-Sobczak IT/ADC based on slides prepared by Paula Figueiredo, IT/DB

Introduction to normalization. Introduction to normalization

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

Lecture 6. SQL, Logical DB Design

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

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

Database Systems. S. Adams. Dilbert. Available: Hans-Petter Halvorsen, M.Sc.

JEFFERSON COLLEGE COURSE SYLLABUS CIS-236 SQL AND DATABASE DESIGN. 3 Credit Hours. Prepared by: Chris DeGeare CIS Instructor. Revised: 3/11/2013

SYLLABUS FOR CS340: INTRODUCTION TO DATABASES

Lab Manual. Database Systems COT-313 & Database Management Systems Lab IT-216

Database Design Final Project

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

Understanding the Database Design Process

Question 1. Relational Data Model [17 marks] Question 2. SQL and Relational Algebra [31 marks]

Database Design--from E-R Diagram to SQL Statement

CHAPTER 5: BUSINESS ANALYTICS

Basic Concepts of Database Systems

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

The Entity-Relationship Model

C HAPTER 4 INTRODUCTION. Relational Databases FILE VS. DATABASES FILE VS. DATABASES

EECS 647: Introduction to Database Systems

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

model license person owns car report-number participated damage-amount E-R diagram for a Car-insurance company.

CHAPTER 4: BUSINESS ANALYTICS

GUJARAT TECHNOLOGICAL UNIVERSITY, AHMEDABAD, GUJARAT. COURSE CURRICULUM COURSE TITLE: DATABASE MANAGEMENT (Code: ) Information Technology

Databases Model the Real World. The Entity- Relationship Model. Conceptual Design. Steps in Database Design. ER Model Basics. ER Model Basics (Contd.

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

We know how to query a database using SQL. A set of tables and their schemas are given Data are properly loaded

Review: Participation Constraints

Normalization. CIS 3730 Designing and Managing Data. J.G. Zheng Fall 2010

ER modelling, Weak Entities, Class Hierarchies, Aggregation

Scheme G. Sample Test Paper-I

Foundations of Information Management

Relational Databases and SQLite

Normalization. Reduces the liklihood of anomolies

The Relational Model. Why Study the Relational Model?

CS 4604: Introduc0on to Database Management Systems. B. Aditya Prakash Lecture #5: En-ty/Rela-onal Models- - - Part 1

CS2Bh: Current Technologies. Introduction to XML and Relational Databases. Introduction to Databases. Why databases? Why not use XML?

Web Application Development Using UML

DATABASE MANAGEMENT SYSTEMS. Question Bank:

RELATIONAL DATABASE DESIGN

CS 649 Database Management Systems. Fall 2011

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

IT2304: Database Systems 1 (DBS 1)

Databases and BigData

Oracle Database: SQL and PL/SQL Fundamentals

Online Course Registration System

Relational Database Basics Review

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

DATABASE DESIGN AND IMPLEMENTATION II SAULT COLLEGE OF APPLIED ARTS AND TECHNOLOGY SAULT STE. MARIE, ONTARIO. Sault College

Course: CSC 222 Database Design and Management I (3 credits Compulsory)

Data Modeling. Database Systems: The Complete Book Ch ,

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

Database Design Process. Databases - Entity-Relationship Modelling. Requirements Analysis. Database Design

SQL NULL s, Constraints, Triggers

DATABASE INTRODUCTION

A Brief Introduction to MySQL

Chapter 1: Introduction. Database Management System (DBMS) University Database Example

Introduction to Database Systems CS4320/CS5320. CS4320/4321: Introduction to Database Systems. CS4320/4321: Introduction to Database Systems

Chapter 13: Query Optimization

Rational Software. Course Registration System Use-Case Model

Conceptual Design Using the Entity-Relationship (ER) Model

IT2305 Database Systems I (Compulsory)

Foundations of Information Management

OCR LEVEL 3 CAMBRIDGE TECHNICAL

Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff

Part III. Self-Study Report Template

Database Design. Goal: specification of database schema Methodology: E-R Model is viewed as a set of

Bridge from Entity Relationship modeling to creating SQL databases, tables, & relations

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

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

Relational Database Management LIS458

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

Instructor: Michael J. May Semester 1 of The course meets 9:00am 11:00am on Sundays. The Targil for the course is 12:00pm 2:00pm on Sundays.

1. SELECT DISTINCT f.fname FROM Faculty f, Class c WHERE f.fid = c.fid AND c.room = LWSN1106

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

DBMS / Business Intelligence, SQL Server

THE OPEN UNIVERSITY OF TANZANIA FACULTY OF SCIENCE TECHNOLOGY AND ENVIRONMENTAL STUDIES BACHELOR OF SIENCE IN DATA MANAGEMENT

E grading Training Manual

INFORMATION TECHNOLOGY EDUCATION PROGRAMMING & ANALYSIS COURSE SYLLABUS. Instructor: Debbie Reid. Course Credits: Office Location:

Introduction to Databases

Database Security. Chapter 21

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

Sample Online Course Evaluation

MODULE FRAMEWORK : Dip: Information Technology Network Integration Specialist (ITNIS) (Articulate to Edexcel: Adv. Dip Network Information Specialist)

1. INTRODUCTION TO RDBMS

Guidelines for Master's Thesis (Research Option for MS in Statistical Science Degree)

Oracle Database 10g Express

Software Engineering I CS524 Professor Dr. Liang Sheldon X. Liang

Database Management. Technology Briefing. Modern organizations are said to be drowning in data but starving for information p.

CMU - SCS / Database Applications Spring 2013, C. Faloutsos Homework 1: E.R. + Formal Q.L. Deadline: 1:30pm on Tuesday, 2/5/2013

Belk College of Business Administration, University of North Carolina at Charlotte. INFO : MANAGEMENT INFORMATION SYSTEMS Spring 2012

The Systems Approach to Problem Solving

Rose Data Modeler (logical)

Transcription:

CPS352 Database Systems: Design Project Purpose: Due: To give you experience with designing and implementing a database to model a real domain Various milestones due as shown in the syllabus Requirements This project is deliberately open-ended. It consists of the following three milestones. 1. Choose a domain that you are familiar with and/or interested in. Identify a set of requirements for a fictitious software system pertinent to this domain. If you wish, you may choose an appropriate subset of a larger domain, but your domain must not be those we are using as examples in class specifically the university (from the Database Systems Concepts book) and the library (from lectures) domains. See the Choosing an Appropriate Domain discussion below for further guidance. 2. Develop an E-R diagram for a database that models your domain. 3. Turn your E-R diagram into a normalized relational database design for the domain that is, a set of tables, each with pertinent attributes, a primary key, and appropriate constraints and foreign keys. Your relational database must be in fourth normal form. Implement your design as follows: a. Create a file of SQL create statements to build your database schema. These statements should not only facilitate the creation of tables, but also creation of named constraints, triggers, and/or views as appropriate. b. Create your database under your username as a schema in the design database on the server. (You won t actually create the database itself, just the tables and other objects within its schema.) c. Populate your database with sample data to facilitate testing of the schema and the various transactions supported by your hypothetical software system. Each table must contain a minimum of five rows. d. Create SQL select, insert, update, and delete statements that correspond to the functionality of your software system s requirements. e. Thoroughly test your SQL statements and constraints using your sample data. Your tests should not only exercise the expected behavior for good data, but they should also ensure that your constraints correctly catch various kinds of invalid insert, update, and delete operations caused by bad data. Note that the comprehensiveness of your tests will be a factor in your grade for this part of the project. Milestones Your project will be submitted in three separate milestones. After turning in a milestone, you have the option to modify your approach and/or design for the remainder of the project as necessary based on feedback you receive. If you choose to do this, you do not need to redo the previous milestone(s) unless you totally change your project domain. Once your final milestone is turned in, your project will be graded based on all three milestones together, but with special emphasis given to the third one. 1

On the due date of each of milestone, you will present your work orally to your classmates. For the first milestone, we will also spend time as a class discussing the next part of the project - e.g. what might be appropriate entities and relationships for modeling your domain. We may also have a similar, but briefer, class discussion when second milestones are presented. To facilitate oral presentation and discussion, you should prepare appropriate material for projection and/or handouts. Specific Milestone Requirements You will need to turn in the following for each milestone: Milestone I Domain and System Requirements A description of the problem domain (written using terminology that a user of the system would use, not technical database terminology). A statement of requirements. This should take the form of an overall use case diagram, with explanation in requirements language as needed. Milestone II - E-R Diagram An E-R diagram for your database, including attributes for entities and relationships. Milestone III - Relational Database Design, Implementation, Sample Data, and Tests A list of the functional and multivalued dependencies for your scheme. A schema diagram for your database, with primary and foreign keys specified appropriately. A file containing working SQL statements to create the objects in your database. A file containing working SQL statements corresponding to each of your requirements. (If your requirements call for more than a dozen or so statements, you can do a subset.) Your SQL statements should require a variety of SQL capabilities, such as various kinds of join, aggregate functions, etc. (This presupposes a good initial domain choice.) Documentation of testing You must exercise each of your SQL statements. Your testing should be related to your original requirements - that is, you should include tests that address each of the original requirements (or a subset if there are many). You must also exercise each of your triggers. You must also exercise each of your constraints, being sure it correctly catches errors while allowing legitimate data. (Note: you do not need to test not null constraints.) You must turn in one or more files containing the results of these tests. Be sure to include (SQL) comments in these files indicating the requirement each test is exercising, and the expected result. (i.e. good data or a specific problem you are catching with bad data). Email your work for each milestone to the professor by its due date listed in the course syllabus. Be sure to bring appropriate print-outs of your work to class on the due date to facilitate class discussion. 2

An Example: Note that this example is much simpler than what you will do for the actual project; it is only meant to illustrate the various milestone requirements. Milestone 1 Suppose you chose a subset of the university organization domain, as used for examples in the Database Systems Concepts book. (As noted above, you can t actually choose this domain.) Section 1.6.2 on pages 16-17 of the book describes this system. In addition, you would need to spell out the requirements, perhaps by using a use case diagram like the one below. (Many possible cases are omitted, including those involved in managing departments, buildings, and classroom space, as well as managing the college catalog and historical information; this diagram is for illustration purposes only.) Since the nature of each requirement is clear from the use case name, no further specification is needed. A set of descriptions like the one in section 1.6.2 in the book plus the use case diagram below is what you might turn in for Milestone 1. Add student Delete student Add Section De le Enroll student Drop student Assign grade Registr ar Delete faculty 3

Milestone II Your design might be based on an E-R diagram like figure 7.15 on page 282 of the Database System Concepts book. A diagram like the one in figure 7.15 in the book is what you should turn in for Milestone II. Milestone III a. The following functional and multivalued dependencies hold on the E-R diagram. (The names of ID attributes have been modified to indicate more explicitly the tables to which they belong.) course_id title, credits, dept_name dept_name building, budget instructor_id name, salary, dept_name student_id name, tot_cred, dept_name, instructor_id (advisor) section_id, semester, year, course_id building, room_number, time_slot_id building, room_number capacity time_slot_id day, start_time, end_time student_id, section_id, semester, years, course_id grade course_id ->> course_id (prereq) instructor_id ->> section_id, semester, year, course_id section_id, semester, year, course_id ->> instructor_id student_id ->> section_id, semester, year, course_id section_id, semester, year, course_id ->> student_id b. A database schema based on these dependencies might look like figure 2.8 on page 47 of the Database System Concepts book. No tables are needed corresponding to the relationships course_dept, inst_dept, stud_dept, sec_class, sec_time_slot in the E-R diagram. These relationships are folded into the course, instructor, student and section tables because each relationship is one-to-many with total participation required. There is no table corresponding to sec_course because section is a weak entity dependent on course, so its primary key is needed in the table for section. c. This database could be created with SQL statements like those in Figure 4.8 on page 132 of the Database System Concepts book (though more are needed to create the complete schema). Notice how appropriate primary key, foreign key and check constraints have been specified. Notice how cascading delete and update can be specified for course. (See page 133.) Triggers might be used as shown in Figures 5.8 (page 182) and 5.9 (page 183). Note that DB2 automatically creates indexes for each primary key, but on other systems it might be necessary to explicitly do so. However, it might be desirable to create an index on name for student if we expect to frequently have to do name lookups. A view could be created to allow each student to look at his/her course enrollments. 4

d. This example does not include test data for all requirements and constraint. The tests below are given to illustrate the point. The following SQL statements test the primary key and foreign key constraints on student (assuming that the CS department was already created). values (12345, 'Anthony Aardvark', 'CS', 0); values (12345, 'Zelda Zebra', 'CS', 0); values (98765, 'No such', 'ZZ', 0); (fails PK) (fails FK) Documentation for this test would consist of a screen shot or "cut-and-paste" command line output showing DB2 accepting the first insert and giving an error message for each of the two invalid inserts, along with suitable comments. The trigger shown in figure 5.9 of the Database Systems Concepts book could be tested with the following SQL statement (assuming the appropriate student and section records already exist): update takes set grade = 'A' where student_id = 12345 and course_id = 'CPS352' and sec_id = 'GS' and semester = 'SP' and year = '2010'; This would result in an increase of 4 in the tot_cred attribute for student 12345. Documentation for this test would consist of a screen shot showing two select statements, with the update statement between them. Something that looks like all of the above is what you should submit for Milestone III. Choosing an Appropriate Domain The domain (or subset of a domain) that you choose for your project should have the following characteristics: 1. An appropriately sized domain will result in a database having about a dozen tables (more or less). 2. The entities comprising your domain should be interrelated. 3. Your schema should include attributes that make it possible to include some transactions that involve aggregate functions. (For example, the schema developed above would allow for queries to calculate the enrollment in each section, the average enrollment in courses for a given department, the total number of courses being taught by each instructor, etc.). Your schema should also make interesting constraints and triggers possible. Important: Keep the requirements of all milestones in mind when selecting your domain. You want a domain that will lend itself to interesting requirements and tests, as well as a suitable E-R diagram, schema, and set of dependencies. 5