1 All Powder Board and Ski SQL Server Workbook Chapter 2: Database Design Jerry Post Copyright © 2004.

Slides:



Advertisements
Similar presentations
Copyright © 2003 Pearson Education, Inc. Slide 8-1 The Web Wizards Guide to PHP by David Lash.
Advertisements

All Powder Board and Ski
1 All Powder Board and Ski Microsoft Access Workbook Chapter 9: Data Warehouses and Data Mining Jerry Post Copyright © 2007.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 5: Advanced Queries Jerry Post Copyright © 2007.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms and Reports Jerry Post Copyright © 2007.
All Powder Board and Ski Microsoft Access Workbook Chapter 3: Database Tables Jerry Post Copyright © 2007.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 10: Database Administration Jerry Post Copyright © 2007.
Creating Databases and E/R Diagrams with SQL Server Management Studio Svetlin Nakov Telerik Corporation
MS-Access XP Lesson 1. Introduction to MS-Access Database Management System Software (DBMS) Store data in databases Database is a collection of table.
Access - Project 1 l What Is a Database? –A Collection of Data –Organized in a manner to allow: »Access »Retrieval »Use of That Data.
Module 4: Creating Data Types and Tables. Overview Creating Data Types Creating Tables Generating Column Values Generating Scripts.
A Guide to SQL, Seventh Edition. Objectives Understand the concepts and terminology associated with relational databases Create and run SQL commands in.
Database Design Chapter 2. Goal of all Information Systems  To add value –Reduce costs –Increase sales or revenue –Provide a competitive advantage.
Access Lecture 1 Database Overview and Creating Tables Create an Employee Table.
Copyright ©2014 Pearson Education, Inc. Chapter 6 Physical Design Chapter6.1.
Working with Data Types February 7, 2015 John Deardurff Website:
A Guide to SQL, Eighth Edition Chapter Three Creating Tables.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Part 06 – A More Complex Data Model Entity Framework and MVC NTPCUG Tom Perkins.
Irwin/McGraw-Hill Copyright © 2000 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS5th Edition.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 4: Queries Jerry Post Copyright © 2007.
Chapter 7 SQL HUANG XUEHUA. SQL SQL server2005 introduction Install components  management studio.
1 Working with MS SQL Server Textbook Chapter 14.
© 2007 by Prentice Hall3-1 Introduction to Oracle 10g Chapter 3 Creating, Modifying, Renaming, and Deleting Database Tables James Perry and Gerald Post.
1 All Powder Board and Ski Oracle 9i Workbook Chapter 7: Integrity and Transactions Jerry Post Copyright © 2003.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 7: Integrity and Transactions Jerry Post Copyright © 2003.
1.NET Web Forms Business Forms © 2002 by Jerry Post.
SQL Data Definition Language (DDL) Using Microsoft SQL Server 1SDL Data Definition Language (DDL)
1 All Powder Board and Ski Microsoft Access Workbook Chapter 10: Distributed Databases Jerry Post Copyright © 2003.
11 3 / 12 CHAPTER Databases MIS105 Lec15 Irfan Ahmed Ilyas.
M1G Introduction to Database Development 2. Creating a Database.
Module 3: Creating Data Types and Tables. Overview Working with Data Types Working with Tables Generating Column Values Generating Scripts.
1 All Powder Board and Ski Oracle 9i Workbook Chapter 10: Distributed Databases Jerry Post Copyright © 2003.
Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2.
IE 423 – Design of Decision Support Systems Database development – Building Tables
All Powder Board and Ski Microsoft Access Workbook Chapter 3: Database Tables Jerry Post Copyright © 2003.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003.
Data Types Lesson 4. Skills Matrix Table A table stores your data. Tables are relational in that they are organized as rows and columns (a matrix). Each.
1 All Powder Board and Ski Oracle 9i Workbook Chapter 8: Data Warehouses and Data Mining Jerry Post Copyright © 2003.
All Powder Board and Ski Microsoft Access Workbook Chapter 2: Database Design Jerry Post Copyright © 2003.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 8: Data Warehouses and Data Mining Jerry Post Copyright © 2003.
All Powder Board and Ski Oracle 9i Workbook Chapter 3: Database Tables Jerry Post Copyright © 2003.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 9: Database Administration Jerry Post Copyright © 2003.
IMS 4212: Data Modeling—Attributes and Domains 1 Dr. Lawrence West, Management Dept., University of Central Florida Attributes and Domains.
Data Modeling Creating E/R Diagrams SoftUni Team Technical Trainers Software University
Mr C Johnston ICT Teacher
* Database is a group of related objects * Objects can be Tables, Forms, Queries or Reports * All data reside in Tables * A Row in a Table is a record.
Introduction to MySQL Ullman Chapter 4. Introduction MySQL most popular open-source database application Is commonly used with PHP We will learn basics.
Ch 3. Working with Tables and Views. Data type Specify type of data to be entered into a column (text, number, datetime, etc) Unicode (National) Datatypes.
Creating E/R Diagrams with SQL Server Management Studio, Writing SQL Queries D0ncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer.
1 All Powder Board and Ski SQL Server Workbook Chapter 5: Advanced Queries Jerry Post Copyright © 2003.
DATABASE MIS 327 Advanced Database 1. DATABASE 2 Objectives  Why are models important in designing systems?  How do you begin a database project? 
COMPUTER SKILLS MS-ACCESS. Introduction Access is a piece of software known as a database management system. At its most basic level, it can be used to.
What is your Character Data Type? March 5, 2016 John Deardurff Website:
Chapter 6: Forms, Reports and Applications All Powder Board and Ski
Managing Tables, Data Integrity, Constraints by Adrienne Watt
Module 2: Creating Data Types and Tables
Chapter 7: Database Integrity and Transactions
Chapter 2: Database Design All Powder Board and Ski
Data Definition and Data Types
Lesson 7 Managing Data Creating a database with Web Matrix.
Attributes and Domains
All Powder Board and Ski
All Powder Board and Ski
Working with Data Types
Supplement: Using the DBDesign System
CIS16 Application Programming with Visual Basic
PT2520 Unit 5: Physical Design
Presentation transcript:

1 All Powder Board and Ski SQL Server Workbook Chapter 2: Database Design Jerry Post Copyright © 2004

2 DBDesign: An Expert System Benefits Makes it easy to create database diagrams Saves data in central location, so changes can be made from almost any computer Provides immediate detailed feedback on the design Requirements Instructors must ask for a free account Instructors and students need a Java-enabled Web browser

3 SQL Server Data Types (Domains) NameDataBytes Text (characters) fixed variable national/Unicode memo char or nchar varchar nvarchar text or ntext 8000 bytes 2 gigabytes Fixed Variable Numeric Byte (8 bits) Integer (16 bits) Long (32 bits) (64 bits) Fixed precision Float Double Currency Yes/No tinyint smallint int bigint decimal(p,s) real float money bit 0 to ^15 to 2^ ^31 to 2^ ^63 to 2^63 -1 p: , s: 0...p 7 digits 15 digits 38 digits 0, , 8 8 variable Date/Time Interval datetime, smalldatetime1/1/1753 to 12/31/9999 (3.33ms) 7/11/13 Imageimage2 gigabytesVariable See help file.

4 Initial Business Objects Employee EmployeeID TaxpayerID LastName FirstName Address City State ZIP Customer CustomerID LastName FirstName Phone Address City State ZIP Sale SaleID SaleDate CustomerID EmployeeID Rental RentID RentDate CustomerID ExpectedReturn

5 Associations or Relationships Employee EmployeeID TaxpayerID LastName FirstName Address City State ZIP Customer CustomerID LastName FirstName Phone Address City State ZIP Sale SaleID SaleDate CustomerID EmployeeID Rental RentID RentDate CustomerID ExpectedReturn 0…* 1…1

6 Action Browser: New student who has two key numbers.

7 Getting Started Enter the key numbers you received Create a username and password. Enter your correct name, address and StudentID

8 Class Registration Successful account creation Select your university and class Enter the admit code

9 Action File/Open, choose All Powder case Right click/Add Table Right click header/Rename table Drag columns from right onto table Right click name/set data type

10 DBDesign: Example Available columns Menu Class (entity) Corrections Status line

11 Action Add Customer and Sale tables Add GenerateKey to Customer table Rename it to CustomerID Drag new CustomerID from right side into Sale table Drag CustomerID from Customer and drop it on CustomerID in Sale table Fill out relationship box

12 Relationships Drag-and- drop column Select min and max for both sides of the relationship

13 Action Choose Grade/Grade and Mark Double click messages in window Fix errors by removing columns and adding new tables

14 Design Errors Add SKU to the Sale table Connect the Inventory table to the Sale table Double click the diagnostic message Possible errors are highlighted

15 More Errors Try setting SKU as a key It still causes problems because SaleDate does not depend on the SKU

16 Split Many-to-Many Relationship Sale SaleID SaleDate CustomerID EmployeeID Inventory SKU Size QOH Many-to-Many SaleItem SaleID SKU QuantitySold SalePrice 1…1 0…* 1…* 1…1

17 Ski Shop Inventory Photo: Ski shops carry multiple lengths of each ski or board model. Model information refers to the overall type of board or ski. Inventory information refers to an individual ski or board— defined by its length. Model: Rossignol Axium Item: 196 cmItem: 181 cm

18 Action Create the SaleItem table Create the ItemModel table Include the proper columns Set the keys Set the data types Grade/Grade and Mark

19 Models and Items

20 Customer Skill Level CustomerID, LastName, … Style, SkillLevel Business rule: Each customer can have one skill in many styles. Business rule: Each style can apply to more than one customer. Need a table with both attributes as keys. CustomerID, LastName, … Style, SkillLevel But you cannot include LastName, FirstName and so on, because then you would have to re-enter that data for each customer skill.

21 Customer Style Skills Customer CustomerID LastName FirstName Phone Address City State ZIP CustomerSkill CustomerID Style SkillLevel Style StyleDescription SkillLevel SkillDescription