ERD Tutorial: How to Design and Generate SQL Server DB? Written Date : June 19, 2015

Similar documents
How to Generate Redshift Database from ERD? Written Date : April 08, 2016

How to Generating DB Specification from Database> Written Date : January 20, 2016

How to Keep ERD and Data Dictionary Synchronized? Written Date : January 20, 2014

What is Package Diagram? How to Draw Package Diagram? Written Date : July 29, 2014

Composite Pattern Tutorial Written Date : October 7, 2009

How to Draw Wireframe for Android Apps? Written Date : February 3, 2016

How to Use Profile Diagram to Manage Stereotypes? Written Date : March 6, 2016

Prototype Pattern Tutorial Written Date : September 30, 2009

Strategy Pattern Tutorial Written Date : October 27, 2009

Command Pattern Tutorial Written Date : October 14, 2009

How to Draw UML Sequence Diagram? Written Date : March 16, 2016

Creating Entity Relationship Diagram

Interpreter Pattern Tutorial Written Date : October 14, 2009

How to Customize SysML Requirement Types? Written Date : February 4, 2016

SYNTHESYS.NET INTERACTION STUDIO Database Output Actions

Visitor Pattern Tutorial Written Date : October 28, 2009

Singleton Pattern Tutorial Written Date : September 30, 2009

Bridge Pattern Tutorial Written Date : October 8, 2009

Factory Method Pattern Tutorial Written Date : September 28, 2009

Oracle Academy Amazing Books Part 1: Building Tables and Adding Constraints

How to Draw BPMN 2.0 Business Process Diagram? Written Date : March 9, 2016

UML Getting Started - UML Modeling in Eclipse Written Date : March 03, 2016

How to set up an Amazon Work Profile for Windows 8

Communicate Software Design using PostMania Written Date : August 24, 2016

What is Storyboard? How to Develop a Storyboard? Written Date : January 20, 2016

DB Browser UI Specs Anu Page 1 of 15 30/06/2004

BP-VA Quick Start. Last update: 29 th January, Copyright Visual Paradigm International Ltd.

Once you click on the Enterprise Icon found on your desktop you will be asked for your password. This Default Code Is

How to Generate Java from UML Class Diagram in NetBeans? Written Date : February 22, 2010

Department of Computer Science University of Cyprus. EPL342 Databases. Lab 2

Opening Screen When you first enter Slick!, a blank opening screen will appear as shown below.

Introduction to BPMN Part III - Flow and Connecting Objects Written Date : March 07, 2016

What is Data Flow Diagram (DFD)? How to Draw DFD? Written Date : January 27, 2012

Creating databases using SQL Server Management Studio Express

1. AUTO CORRECT. To auto correct a text in MS Word the text manipulation includes following step.

How to Gather Requirements with UeXceler? (YouTube Example) Written Date : January 27, 2016

OSR Administration 3.7 User Guide. Updated:

Importing source database objects from a database

How to make a Work Profile for Windows 10

Hello, and welcome to the Alexicomtech tutorial. I will show you step by step how to set up your interactive pages. Please feel free to ask questions

How to Mail Merge PDF Documents

Microsoft Access 2003 Edition for ECDL Syllabus 4.5 (UK only)

SQL Server. Management Studio. Chapter 3. In This Chapter. Management Studio. c Introduction to SQL Server

What is OneNote? The first time you start OneNote, it asks you to sign in. Sign in with your personal Microsoft account.

SQL Server 2008 Tutorial 3: Database Creation

1-Step Appraisals Personal Property Appraisal Software

Locate your Advanced Tools and Applications

What is TOGAF? How to Perform EA with TOGAF ADM Tool? Written Date : January 20, 2017

The MAXQDA Stats Data Editor

PortfolioCenter Export Wizard in Practice: Evaluating a Security Fit Across Your Client Base

Working with Databases and Java

BCIS 4610 Visible Analyst Tutorial 2010

How to Customize a RACI Chart? Written Date : February 23, 2016

MICROSOFT EXCEL TUTORIAL HANDOUT

Builder Pattern Tutorial Written Date : September 28, 2009

Introduction to ERwin

OneStop Reporting 4.5 OSR Administration User Guide

Create a simple database with MySQL

The tutorial has been broken up into step, these are as follows:

Open Excel by following the directions listed below: Click on Start, select Programs, and the click on Microsoft Excel.

Getting Started Guide. Sage MAS Intelligence 500

DB Export/Import/Generate data tool

StickFont Editor v1.01 User Manual. Copyright 2012 NCPlot Software LLC

Frequency tables Create a new Frequency Table

Microsoft Access XP Edition for ECDL Syllabus 4.5 (UK only)

Welcome to Cole On-line Help system!

.txt - Exporting and Importing. Table of Contents

How to use SQL to create a database

MS Access Let s begin by looking at the toolbar and menu of Access.

Quick & Simple Imaging. User Guide

SOFTWARE SKILLS BUILDERS

Poom Malakul Na Ayudhya

Microsoft Access 2010

Getting Started Guide

MyEclipse ER-Designer Quickstart

Click the buttons in the interactive below to become familiar with the drawing tool's commands.

Simple Invoicing Desktop Database with MS Access 2013/2016. David W. Gerbing School of Business Administration Portland State University

Expense Management Asset Management

Introduction to Microsoft Excel

1 INTRODUCTION TO EASIK 2 TABLE OF CONTENTS

Imagine. Create. Discover. User Manual. TopLine Results Corporation

Cell Basics. Introduction

OpenForms360 Validation User Guide Notable Solutions Inc.

Microsoft Visio Working with Connectors

Connecting SQL Data Sources to Excel Using Windward Studios Report Designer

Mailing Labels from REARS

School of Information and Computer Technology Sirindhorn International Institute of Technology Thammasat University

Database Foundations. 5-1 Mapping Entities and Attributes. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

SalesNet Mailing Labels

Server Manager User and Permissions Setup

APS Installation Documentation

These are the steps you will take to complete the tutorial. They are also the common processes through which you will create your own operations.

CS317 File and Database Systems

User Manual. perfectionlearning.com/technical-support

Candy is Dandy Project (Project #12)

Microsoft Access 2013

Basics. Mouse The mouse normally looks like a little arrow, but it can change depending on what you are doing

Non-linear regression tutorial

DATABASES 1.0 INTRODUCTION 1.1 OBJECTIVES

The Crypt Keeper Cemetery Software Online Version Tutorials To print this information, right-click on the contents and choose the 'Print' option.

Transcription:

ERD : How to Design and Generate SQL Server DB? ERD : How to Design and Generate SQL Server DB? Written Date : June 9, 05 You can design database with ERD, and construct database by generating from the resulting ERD. In this tutorial, you will draw a simple ERD of an online bike shop, define sample data for your database and generate database to Microsoft SQL Server from it. and SQL Server 04 will be used in this tutorial. Create database in SQL Server The first thing we need to do is ready brand new database in SQL Server. To create a new database in SQL Server:. Open the SQL Server Management Studio.. Login to your SQL Server. Page of 4

ERD : How to Design and Generate SQL Server DB?. Right click on Databases root node in Object Explorer, and select New Database. 4. Name the database as BikeShopDB, and press OK to create the database. Once the database was created, we can then prepare our software for model your database. Configure default database for your project supports database modeling for multiple DBMS. Since each database do have their own data type which may not compatible with other database, it is important to specify the SQL Server as our default database before we start modeling. The data type for SQL Server will available in our ER diagram once we specified it as our default database. To configure the default database in :. Go to Tools > DB > Database Configuration. Page of 4

ERD : How to Design and Generate SQL Server DB?. Select MS SQL Server in the database list.. Select 008 or higher in Version field (as we are using SQL Server 04). 4. In this tutorial we will use the jdts driver for establish connection with our database. Press the green arrow button next to Driver file field to let VP download the driver for you. If you wish to use other driver you can then simply select the appropriate driver in the Driver field, and press the... button to locate your driver file from your local file system. 5. Fill in the hostname or IP address of the machine which hosting your SQL Server in the Hostname field. And fill in the post number of your SQL Server instance in the Port number field. After that enter BikeShopDB in the Database name field, as well as your name and password for accessing the database. Page of 4

ERD : How to Design and Generate SQL Server DB? 6. When finish enter the connection details, press Test Connection button to check everything alright. Now we are ready to start model our database in ERD. Model your database with ERD Let's start model our bike store database with ERD.. Go to Diagram > New to open the New Diagram dialog.. Enter erd in the search box to locate the Entity Relationship Diagram. Press Next to proceed.. Name the ERD as BikeShop, and press OK to create the blank ER diagram. Page 4 of 4

ERD : How to Design and Generate SQL Server DB? 4. Select Entity from the diagram toolbar. Then click on the diagram to create an entity. Name it as Item and press Enter to confirm editing. 5. Right click on the Item entity and select New Column from popup menu. 6. Enter +ID : int and press Enter to create a primary key column ID with type as int. 7. By default a new column will be created and in editing mode upon you confirm the previous column. Now enter name : varchar(55) and price : float() for the next columns. 8. Press Esc key on keyboard to stop editing of the Item entity. 9. Every Item may contains various variations, i.e. a bike jersey will have different size and color. Let's create ItemVariant entity from Item entity with one-to-many-relationship. Move the mouse pointer over the Item entity. Press on One-to-Many Relationship -> Entity and drag it out. Page 5 of 4

ERD : How to Design and Generate SQL Server DB? 0. Release the mouse button and name it as ItemVariant.. Right click on ItemVariant entity and select New Column from popup menu, then enter the following columns.. Column Name Type +ID int detail varchar(55) color varchar(0) size varchar(50) qty int Repeat the steps above to create the ERD as below. Page 6 of 4

ERD : How to Design and Generate SQL Server DB?. Finally we have to store the items purchased on each order. We should relate the Order with ItemVariant instead of Item since the ItemVariant is the entity storing the actual item. As each Order could have multiple ItemVariant, and each ItemVariant could be involved in multiple Order, therefore it should be created as many-to-many relationship. Move the mouse pointer over the Order entity. Press on the Many-to-Many Relationship -> Entity and drag it out, then drop it on ItemVariant</. 4. Now a link entity between Order and ItemVariant is being created. Rename the link entity to OrderLine. 5. Right click on OrderLine and select New Column from popup menu, then enter qty : int. Now our ERD is ready and we can start define the sample data for our database. Define sample data Defining sample data for your ERD will helps you have more understanding about how your database works. The sample data will also being generated into database thus saving your time to prepare the sample in order to trial run your database. To define sample data for your ERD: Page 7 of 4

ERD : How to Design and Generate SQL Server DB?. Right click on the blank area of your ERD and select Show Table Record Editor or View Editor.. Select the entity Customer in diagram. Now you will see the Table Record Editor showing the columns of the Customer entity.. Enter the following details of the customer into Table Record Editor. ID (PK) firstname lastnameemail address Phone John Doe john.doe@demovp.com 05, river side 45678 Peter Pan peter.pan@demovp.com 06, cox road 87654 Mary Jane mary.jane@demovp.com 5, wolf hill 58764 Page 8 of 4

ERD : How to Design and Generate SQL Server DB? 4. Let's move on to the Order entity. Since the Order must be ordered by someone, we can pick the Customer record when fill in the sample data for Order. Press the... button in the FK cell in Table Record Editor. 5. This will bring up the sample data we defined for Customer. Choose Peter form the list and FK value for Peter fill in for you in the Order record. 6. Repeat the above steps to define the following sample data. Order ID (PK) datetime CustomerID (FK) 05-06-0 7:0:5 05-06-0 8:0: Brand ID (PK) name R Red Line Category ID (PK) name Components Cloths Item Page 9 of 4

ERD : How to Design and Generate SQL Server DB? ID (PK) name price CategoryID (FK) BrandID (FK) Handle Bar 799 Head Set 999 Jersey 99 4 Shpes 599 ItemVariant ID (PK) detail color size qty ItemID (FK) full carbon black NA 50 NA black NA 40 NA pink 40 4 white M 50 5 white L 50 6 white XL 50 7 white S 00 8 blue M 50 9 blue L 50 0 blue XL 50 blue 5 80 blue XS 0 road black 9 40 4 4 road white 9 0 4 NA Page 0 of 4

ERD : How to Design and Generate SQL Server DB? OrderLine OrderID (PK) ItemVariantID(PK)qty 4 9 Once everything is ready, we can then move on to generate the database. Generate database Now everything is ready, let's generate it into database. To generate database:. Go to Tools > DB > Generate Database.... Select Database only in Generate.. Specify the Output Path if you wish to keep the DDL file for your database. Page of 4

ERD : How to Design and Generate SQL Server DB? 4. In Generate Database field, select Create Database. 5. Select Export to database to let directly execute the DDL script to your database. 6. In Generate Sample Data field, select Yes (With Auto Generated PK). 7. Press OK to proceed. If everything is OK then we will see the progress dialog showing 00% complete. Page of 4

ERD : How to Design and Generate SQL Server DB? Now let's go to SQL Server Management Studio to review our database. Let's try to see what's inside the ItemVariant table. Right click on it and choose Select Top 000 Rows from popup menu. And you can see the sample data are there. Page of 4

ERD : How to Design and Generate SQL Server DB? Related Links What is Entity Relationship Diagram (ERD)? How to Produce Database Specification How to Reverse Database Schema into Entity Relationship Diagram without connecting to Database Provide Default Data for Database Design home page (https://www.visual-paradigm.com/) tutorials (https://www.visual-paradigm.com/tutorials/) Page 4 of 4