Skip to main content

Entity Relation (E-R) Diagram and a Sequential Diagram Tips (Tools: SQL Management Stuido, Visual Stuido Architect)



E-R Diagram :  Library Check In Check Out 



E-R Diagram notations in SQL Management Studio or Visual Studio Architect

Understanding following table relationships in a database schema diagram created from either SQL Management Studio or Visual Studio Architect:

          Unlike other tools like Visio or Erwin, Microsoft uses 'Yellow Key' icon and a '8' or 'oo' icon that are shown at the both ends of a relationship lines connecting two tables.

  • one to one (1:1)                    : 'Yellow Key icon' in both ends.
  • one to many (1 : 0...*)          :  'Yellow Key icon' in one end and '8 icon' in other end
  • many to many (0...* : 0...*)  : 'Yellow Key icon' in both ends.

Below is an example E-R diagram created for an use case of ' Library Check in and Check out'. This is just an instance of a whole System which is 'Library Management System' - that could include Employee Payroll, Catalog Search, Category,  Inventory, Accounting, Payment Methods, Supply Chain, Purchase Orders - what not !!! Guess you get the picture.

Lets Create an Database to do Library check in and check out.

This below diagram shows both normalized and de-normalized version of  a database schema for Library Check in and Check Out System.




You can go ahead and keep normalizing this above schema by doing the below.
  • Create a Category master table
  • Create a junction table Catalog_Category
  • Reservation Table 
  • Or Reservation can be handled as a transaction by adding a column in 'Reserved_Dt' in 'Loan_Items' Table and using 'Catalog.Available' column as a string type that holds values  like :- 'Yes'  / 'Hold' / etc.
  • and so on depending on your performance (Read and Write) and maintainability needs , Volume of the transactions, size of the project, etc.

Brief details about Tables and possible Message calls (Stored procedures)
Tables:
Members:
Ā·       Members are the Library customers. This table stores Member info, address, address proof, adult or child, etc.
A member creates a Loan Item transaction 
Employees:
Ā·       Store for library staffs. This is included as a staff ID would be good to have if any staff help to check out
Catalog:
Ā·       This is the whole inventory of the Library lending items, categorized, tagged, type assigned.
Ā·       Every item of same Title or ISBN will have its own entry in this table.
Ā·       The ID ā€“ is the Item ID that could be a Bar code printed on each item that can be checked out. 
- 'Available'  - Column can be a 'Varchar' and hold different values like :-  "Yes" , "Hold",
 

Member_Transactions:
Ā·       This is the main loan transaction table.
Ā·       Stores the Member Id who is checking out, the Employee who is assisting (If auto check out ā€“ this will be the kiosk machine number)
Ā·       Maintains the master details of specific check outs, like total amount owed, paid or not.
- This is a One to many relationship between Member and Transactions. 
- Each transaction can have multiple Catalog Items.
- This is also an intersection (Junction) table between Members and Employees.

Loan_Items:
Ā·       Individual Catalog Items checked out are stored in this table with Check out and Check in dates
Ā·       This table is indexed with both TransactionID as wells as Catalog Item ID.
Ā·       This helps fast retrieval of memberā€™s transactions (MemberID + TransactionID) as well as updating individual Catalog Items during check in.

Types_Lookup:
Ā·       A Catalog Item could be different types and  packages like ā€“
Ā·       Names: Books, DVD, CD, Blue Ray, cassettes (!), Reference Only, etc.
Ā·       Material: Paper, CD,  etc.
Ā·       Cover: plastic case , paper box, etc.
Ā·       It could be packed in Double, triple or more.
Ā·       This helps you to scale for the new additions like ā€“ SD Card or Tablets in the future.
Ā·       This table also serves as a look up table while adding inventory and in search filters.

Loan_Rules:
Ā·       This is our little ā€˜Library Items Lending Rulesā€™ definitions that is applied by a rules engine (a ā€˜spCheck_Rulesā€™ stored Procedure)
Ā·       Rules are applied to the types.
Ā·       Example:
Ā·       Rule Name: Fine per day over due,   Lending Duration, Number of Waiver allowed, etc.
Ā·       The Matrix field stores little formula that applies for the rule or value.




Stored Procedures:

spMember_Info:
Ā·       Retrives Member info for the given Member Card Number.
Ā·       Rertun info should include the last transaction (check out) info for the given member.  

spCheck_Out:
Ā·       Here you check out final transaction ā€“ Insert transaction entries in Member_Transactions, Loan_Items,   update_catalog (a  function call), Payment info. (paid or waived)
Ā·       Return a confirmation with complete transaction info. Including items , due date, etc.

spCheck_In:
Ā·       Update_Catalog, Check_Rules, Check_Dues, Update_items in Loan_Items Table.

spItemCheck:
Ā·       Check the status and availability of each item scanned against Catalog table and return ā€“ On Reserve, Available, Due Date, Deny, etc.
Ā·       If the item is available this should Hold the item by setting ā€˜falseā€™ in Available column to avoid false reservation or checkout.

spCheck_Rules:
Ā·       This program can be considered as a ā€˜Rules Engineā€™ for the Library system.
Ā·       This checks and apply rules for each item checked out  like Due Dated, any additional information or items checked in like ā€“ calculating penalty amounts, applying to the item




Sequential Diagram : Library Check In Check Out: 

The purpose of Sequential diagram is to communicate between both developers as well as business analysts.
 
Sequential Diagram shows the message relationships between the system components in a time sequence. ( A Collaboration Diagram shows Object roles to a context and message calls are numbered sequentially)


There are several notations you can pick from the below example sequential diagram.

Life Lines - are the vertical bars with header (in this diagram - Library system, spMember_info, etc)
A life line is could be a Component, Class, Actor or a Device which is included in a particular instance of a Use case.

Synchronous messages (one directional arrows), Asynchronous message (Arrows with return arrows), Self message calls (Arrows drawn within same lifeline and inside same execution time of a message call ) ,Fragments ( like the loop section),  Comments , Execution time (a thick bar shows time of a call start to end) and more. 


 

Comments

  1. Thanks this info was really helpful! I used a website called Lucidchart to create my own er diagram and it was really easy to understand. If you use diagrams often you should check it out!

    ReplyDelete
  2. Thanks for the help! I have also learned How to Draw ERD (Entity Relationship Diagram) using Lucidchart and it is very helpful and easy to use! I would definitely recommend checking it out!

    ReplyDelete
  3. Entity Relation (E-R) Diagram And A Sequential Diagram Tips (Tools: Sql Management Stuido, Visual Stuido Architect) >>>>> Download Now

    >>>>> Download Full

    Entity Relation (E-R) Diagram And A Sequential Diagram Tips (Tools: Sql Management Stuido, Visual Stuido Architect) >>>>> Download LINK

    >>>>> Download Now

    Entity Relation (E-R) Diagram And A Sequential Diagram Tips (Tools: Sql Management Stuido, Visual Stuido Architect) >>>>> Download Full

    >>>>> Download LINK Yd

    ReplyDelete

Post a Comment

Popular posts from this blog

LLM on Mobile Phone : Mini Universal data and assistant running on an android smart phone Galaxy S23

  Imagine a world where everyone has access to a mini #OpenAI's #ChatGPT on their mobile phone, answering any question on any topic, right from their local phone memory. No need for internet. This is the future of #LLMs on mobile devices, and it's happening now. #MLC-AI has created a way to install a 3 billion parameter #RedPajam #LLMModel on a #Galaxy #S23 smartphone. This is a powerful #LLM that can generate text, translate languages, write different kinds of creative content, and answer your questions in an informative way. And it's all available on your phone, without the need for an internet connection. This could have a profound impact on people all over the world. Millions of suburban students who don't have access to the internet could now have access to a universal data source that can answer most of their questions. Refugee camps around the world could also benefit from this technology, giving refugees access to information and resources that they might not ot...

Javascript 3 dimentional matrix html board onclick empty current box

javascript 3 dimentional matrix html board onclick empty current box  Algorithm! Rules: 1. Only immediate Box can be swapped. Should not jump another box 2. Only directions allowed: Left, Right, Up, Down. 3. Should not swap diagonally.   See the Pen 3d matrix map numbers. by PV ( @moorthi07 ) on CodePen .   function hasClass(elem, className) {   return elem.className.split(" ").indexOf(className) > -1; } function addClick() {   var btn = '<button class="btn1">kkkkk</button>';   document.getElementById("container").innerHTML += btn; } // function boxbodyClick(obj) { //   /* console.log(';;;',obj.className) */ //   /* alert(obj) */ // } var arr = [3]; for (var i = 0; i < 3; i++) {   arr[i] = new Array(3); } var emti = 0; var emtj = 0; function btnClick(obj, i, j) {   if (arr[i][j] !== "-") {            if (j + 1 == emtj || j == emtj || j - 1 == emtj)...

Agentic AI growth could make GenAI providers to charge $1000-$2000 per month - #Cathywood , here is how.

      #Cathywood predicts that as the #agenticgenai grows the #GenAI service providers like openai, gemini, Copilot, etc will be able to charge $1000 - $2000 per month to their business customers. And she adds, "this is going to happen". Why this is important: Remember #Cathywood made a monster call in 2018, predicting that Tesla would hit $4,000 in five years. And eventually Tesla hit Wood's price target, with shares closing at $816, or $4,080 on a split adjusted basis (Jan. 2021). How this could happen: #AgenticGenAi means , 1. Integrating a business service with GenAI providers like Gemini/ChatGPT as an agent and make available in the chat interface. 2. Less human interaction and more calls to the GENAI Models. Nothing totally new, its similar to 'Ok google play a song from spotify' 'Alexa, order 8 pack dove on amazon' For example, when booking a flight, instead of navigating a complex travel website, users can simply provide a text prompt...