To draw ER diagram of manufacurer sells products? - erd

I am learning the data model and came accross this situation where a relationship SELLS between manufacturer and Products entities. I don't know how to represent the bolded statements in the question below:
" Manufacturers are identified by their name; they have an address and a phone number. Each
manufacturer usually sells several products, with distinct names. However, two products from two
manufacturers might have the same name. "
Is it possible to make it visible in the diagram? If yes, how ?

Related

AQL and Graph Traversal: Product recommendation example

I have been learning Arangodb and graph traversal using AQL, and I have looked at some of the examples that can be found online like flight paths, actors and movies, but I have trouble wrapping my head around writing what I initially thought would be a simple product recommendation experiment where a customer is recommended products he/she has not bought based on other customers' (who have made similar purchases) purchases.
This is what I managed to achieved to so far, retrieving products that other customers' who have purchased the same product as the current customer
FOR products IN 1..1 OUTBOUND 'customers/118685' bought
FILTER products._id LIKE "products/%"
FOR other_buyers IN 1..1 INBOUND products bought
FILTER other_buyers._id != 'customers/118685'
FOR other_buyers_products IN 1..1 OUTBOUND other_buyers bought
return other_buyers_products
Also, I haven't reached the stage where the recommendation would could be refined to customers who have made more similar purchases (i.e. based on higher count) with the current customer. Appreciate advice or helpful examples.
this is a very open question. a more precise question would result in more and better answers... but i will give it a try.
you can express your current query in a more condense way:
FOR product IN 3..3 ANY 'customers/1' purchases
RETURN DISTINCT product
counting occurrences of a product can be added easely with COLLECT:
FOR product IN 3..3 ANY 'customers/1' purchases
COLLECT pid = product._id WITH COUNT INTO count
RETURN { pid, count }
this is still a very naive approach. you will end up with recommendations like "you once bought banana, you should by toilet paper", because everybody bought those things eventually. you can improve your results by not just saving what product a customer bought, but also when. Then you will be able to find out what products are bought together often, f.e. a flashlight and batteries.
look around on the internet for further inspiration, f.e. here.

modeling scenario with mostly semi-additive facts

Im learning dimensional modeling and Im trying to create a model. I was thinking about a social media platform which rates hotels. The platform has following data:
hotel information: name and address
a user can rate hotels (1-5 points)
a user can write comments
platform stores the date of the comments
hotel can answer via comment and it stores the date of it
the platform stores the total number of each rating level (i.e.: all rates with 1 point, all rates with 2 point etc.)
platform stores information of the user: sex, name, total number of votes he/she made and address
First, I tried to define which information belongs to a dimension or fact table
(here I also checked which one is additive/semi additive/non-additive)
I realized my example is kind of difficult, because it’s hard to decide if it belongs to a fact table or dimension.
I would like to hear some advice. Would someone agree with my model?
This is how I would model it:
Hotel information -> hotel dimension
User rating -> additive fact – because I can aggregate them with all dimensions
User comment -> semi additive? – because I can aggregate them with the date dimension (I don’t know if my argument is correct, but I know I would have new comments every day, which is for me a reason to store it in a fact table
Answer as comment -> same handling like with the user comments
Date of comment-> dimension
Total Number of all votes (1/2/3/4/5) -> semi-additive facts – makes no sense to aggregate them, since its already total but I would get the average
User information sex and name, address -> user-dimension
User Information: total number of votes -> could be dimension or fact. It depends how often it changes. If it changes often, I store it in a fact. If its not that often, then dimension
I still have question, hope someone can help me:
My Question: should I create two date dimensions, or can I store both information in one date dimension?
2nd Question: each user and hotel just have one address. Are there arguments, to separate the address dimension in a own hierarchy? Can I create a 1:1 relationship to a user dimension and address dimension?
For your model, it looks well considered, but here are some thoughts:
User comment (and answers to comments): they are an event to be captured (with new ones each day, as you mention) so are factual, with dimensionality of the commenter, type of comment, date, and the measure is at least a 'count' which is additive. But you don't want to store big text in a fact so you would put that in a dimension by itself which is 1:1 with the fact, for situations where you need to query on the comment itself.
Total Number of all votes (1/2/3/4/5) are, as you say, already aggregates, mostly for performance. Totals should be easy from the raw data itself so maybe not worthwhile to store them at all. You might also consider updating the hotel dimension with columns (hotel A has 5 '1' votes and 4 '2' votes) that you'd update as you go on, for easy filtering and categorisation.
User Information: total number of votes: it is factual information about a user (dimension) and it depends on whether you always just want to 'find it out' about a person or whether you are likely to use it to filter other information (i.e. show me all reviews for users who have made 10-20 votes). In that case you might store the total in the user dimension (and/or a banding, like 'number of reviews range' with 10-20, 20-30). You can update dimensions often if you need to, but you're right, it could still just live as a fact only.
As for date dimensions, if the 'grain' is 'day' then you only need one dimension, that you refer to from multiple facts.
As for addresses, you're right that there are arguments on both sides! Many people separate addresses into their own dimension, referred to from the other dimensions that use them. Kimball suggests you can do that behind the scenes if necessary, but prefers for each dimension to have its own set of address columns(but modelled as consistently as possible).

SSAS facts sharing the same dimension

I'm building a cube with 2 fact tables that share some dimensions.
In the example below, I have Fact_Employee, Fact_Manager, Dim_Date, Dim_Country, Dim_Employee and Dim_Manager, with the respective links.
In SSAS I've created one Dim_Country. In the Cube "Dimension Usage" I am creating 2 dimensions (Man_Country and Emp_Country) and linking to the respective measure groups.
My Fact_Employee has the key for the Dim_Manager, so I can relate them.
My problem here is, when in the pivot table I drag the Man_Country, Emp_Country, Emp_Amount and Man_Amount, this doesn't work because I'm getting the list of all Manager Countries not related to the Manager Number and then the Employee Countries are correctly linked to the Employee Number, but are duplicate.
The below image shows the result Pivot table and what I am trying to get.
What do I need to change in the data source view or cube dimension usage to have the correct results.
The users should be able to filter the pivot by, for example, Manager Country to see all the employee Countries and Numbers and the amounts (for Managers and Employees).
Many thanks in advance for any help.
Regards,
PC
If you have country dimension then you should use this dimension for both measure groups, just remember to configure dimension usage for this dimension vs both measure groups.
There are special cases where you would want to separate those dimensions, f.eks:if you want them to act separately - let say you have a fact table with parcels and you need to have both DimFromCountry and DimToCountry. In this case you would want to use role playing dimension - it is same dimension then, but connected differently.

Need help todesign ER Diagram

How can i design this ER Diagram
The Ministry of Transportation (MOT) supplies department keeps track of all the items (furniture and equipment such as a chair or printer) in the Ministry offices. There are several MOT buildings and each one is given a different name to identify it. Each item is assigned a unique ID when it is purchased. This ID is used to keep track of the item, which is assigned to a room within a building. Each room within a building is assigned to a department, and each department has a single employee as its manager.
i am trying several time but can't understand what to do.If anyone can simplified then it can be much easier for me.

wcf+desktop app or website?

I am developing a school management system and I am struggling whether I should develop for [desktop app + wcf] or web app(website). Which one is going to be the best for the given scenario?
The main goals for the “Integrated Web-Based School Management and Quality Audits Software Project for Secondary Schools are outlined below. In addition, specific objectives within each of the goals have been provided.
Goal 1: To facilitate automated data entries in secondary schools
Objective 1:1- To provide internet facilities and computer systems for secondary schools to further facilitate entries of student information into an integrated school management system.
Objective 1:2- To provide teachers with the possibility to enter continuous assessment data into the computer systems for each student.
Objective 1:3- To provide teachers with the possibility to enter end of term results for each student.
Objective 1:4:- To provide teachers with the possibility to enter students’ conduct at end of term for each student
Objective 1:5:- To provide the administration office with the possibility to register new students into the system
Objective 1:6:- To provide finance/fees office with the possibility to enter fees information for each student
Objective 1:7:- To provide parents with the possibility to access their children’s information online and provide feedback when needed or requested to do so
Goal 2:- To generate a portfolio of student information in respect of each student. A unique student identification will be used to access each student’s portfolio. The following are the main components of the portfolio.
Objective 2:1:- One of the components of the students’ portfolio page will be the Result Slip of the immediate last examination term. This will display all subjects taken by the student, continuous assessment results, examination results, grades and positions obtained in each subject, overall student position, student’s conduct and recommendation information. This report will automatically be gathered from the various inputs made from the individual teachers and staff
Objective 2:2:- Up to date historical record of Fees Information. This is vital information that will be available on each student portal. All fees due and all payments made that are entered by the fees/finance staff will be gathered by this component of the portfolio. Parents will be able to see this as well and provide feedback on any observed discrepancies.
Objective 2:3:- Attendance and Conduct report. This component of the portfolio is intended to give an account of the student’s attendance records and information on conduct as provided by the school authorities. If the information demands parent’s attention and feedback, this will be indicated here, and parents will be able to enter relevant feedback as requested.
Objective 2:4:- Completed and Pending Assignments Module. This component of the student’s portfolio will list all assignments completed by the student in the current term and will list uncompleted ones as well.
Goal 3:- To generate aggregated data for the management of the school. This will enable the school management have a high-level overview of student population, performance statistics for all the modules in the various classes, aggregated data on fees paid and fees pending, etc. There will hyperlinks or select options from which authorized staff will click or select from, in order to reach the requested aggregated data. Main components of the management page are listed below,
Objective 3:1:- One of the components of the staff portfolio page will be the Population Statistics. This will indicate total number of students, which is expandable to also list number of males and number of females. This can further be expanded to list female and male students in the various classes
Objective 3:2:- Performance Overview is another component of the staff portfolio. This will provide a high level overview of students’ performance. Per each class and for each subject, this module will list the number of Grade A students, Grade B students and so on and so forth. This links can be further expanded to view the number of males and females who obtained the various grades in the various classes. This module will also compare grades obtained in one subject with another to give an overview of modules that students do very well with those that they do not, to help management take quick action to rectify any anomalies
Objective 3:3:- Fees Overview is another component of the staff portfolio. This will provide fees information in the form of total fees paid within a specific period (Selectable from term, year, previous year(s), all years until current term, etc.). This information can be further expanded to show fees owed per class, payments overdue and allow the fees office to generate generic reminder messages in the form of email or text messages to parents of students who are overdue.
Reading through those requirements, it sounds like this is more than one application.
Undoubtedly you need some sort of web application (probably ASP.NET in some form?) to allow the parents of students to asses their children's records.
However for security purposes this same application should probably not be used for teachers and administrative staff to edit these records. Those functions should be on a protected LAN, and require more application security for viewing or editing any potentially sensitive data (especially financial records).
I don't see where WCF would fit into this, unless you need to provide some web service support to some other system? Or perhaps proving some "application server" on a protected LAN that can use WCF to serve data to 2 separate applications for outside / public access (from separate web servers in a DMZ) and one for internal users.
There isn't really 1 answer to this question.
You said "I am struggling whether I should develop for [desktop app + wcf] or web app(website)", but it sounds like you need to develop the [desktop app + wcf] anyway because the school administration is already using some sort of desktop application to update the data. You also need a web application for the parents to view their children's record. If you can, I strongly suggest you skip the wcf and just do a web application. At my current job, there's something similar to what rally25rs describe, and it is a pain in the ass to maintain the desktop application, the asp.net website and the wcf service business logic. But it sounds like you have no choice, so good luck!

Resources