Follow Up Customer Database Design - mysql

Please excuse me if this isn't the traditional format of how questions are asked or if it is too broad.
I am currently looking for suggestions on how to design and build a customer database with some very simple fields. I work in the sales department for a company that retails after-market truck accessories both online and over the phone. I have some basic programming skills and a little technical ability, the goal of this project is to create a method of targeting sales leads we would like to follow up with.
We will be collecting information from the salesman individually, I imagined creating a web portal that allowed them to answer the following questions:
Customer Email?
How did they find us?
The website they called in on.
Year of the Vehicle?
Make of the Vehicle?
Was the initial investment < $750.00?
Date of purchase?
I would like to query and target customers based on those questions I have listed above.
Any suggestions or insight would be very much appreciated.
-Luke

You have to face a three-stage process:
First Step: Collect all the information you need to include in your database. You can collect this information from people or documents.
Second Phase: Develops a relational database model that allows you to manage the information according to the first 3 formalization rules. If the database is used by external users, you should designs queries and forms to facilitate their work.
Third Phase: Make your own database. If you do not have a software yet, look for one that supports the relational model. Have you already tried MS access?

Related

eCommerce website - What should I check when inserting data

Hello everyone!
I am working today on a project to make an e-commerce website (Exercise given for my studies).
I am currently controlling the different entries that the administrator can make (Creation of a product, a brand etc)
To make my controls I use express-validator and here are my different tables with their parameters:
Customer:
User name
Email
Password
Product:
Product Name
Description
Price
Image URL
Quantity of product
Brand ID
Brand ID:
Brand Name
Logo URL
And more
I would like to know what is common to verify the validation of the data inserted from an e-commerce site.
For example for the user, I verify that when creating an account, the password, email, name is filled (.notEmpty())
I don't know if my question is appropriate but thank you in advance for any answers!
Have a nice day / evening.
So this answer may sound blatant to you and maybe nothing new. But you should validate everything that is coming from the client-side. You just can see what you're sending in your forms or when making a request. For the general guidelines, you can read: https://owasp.org/www-project-top-ten/
There are a lot of parts like not just security but reliability and such which could look like the same thing but are actually different and really depend on your business requirements and use cases. But I will write my own recommendations of what I observed through many years in web development, keep in mind that my statements are not the only truth or one way to do it or the best practice, so you should take it with a grain of salt, do you your own research and make some informed decisions.
Most basic things would be:
Sanitize and validate the data coming from the client-side.
Set predefined max length of some values if possible.
Check if an entity exists in a database, like username, product, or product quantity and such.
Always use the encryption for the passwords recommended at the current time.
Now more specific business and reliability parts could be (these are just recommendations):
Recommendations:
Username should contain letters and/or numbers only
Username, Email should not be case sensitive.
Disallow creating a customer with a very similar username like: John or J0hn.
Also one suggestion I would give is to look at some open source projects and how such things are done there, such projects are quite large so it will definitely take some of your time, but it may give you a better idea of how most of those e-commerce website work in general.
I really feel like this question and answer would fit better in softwareengineering.stackexchange.com. But anyway just trying to be helpful :)

Database design schema for a simple community website

Where can I find a template for a database design schema. I will be using MySQL. It is a simple website where users, managers, admin can login. Also user can pay a subscription fees and one time fees Using credit card or paypal. I am really confuse how to design the database properly without having major issues later on in the project.This is just a pet project so my resource is none. If you guys could help me out that would be much appreciated.
Thank you
Use followings for reference purpose, and alter them a bit for your need. If you are looking for full functioning data model explicitly for you, then I think, you may not be able to find it.
Sample Databases, use 5th one, I think it suits best for you.
Mysql sample just for reference.

How should I store similar entities - in one table or several?

I am creating a CV website, but in difference to most I am trying to make it with database. I mean that usually such websites are static and all of the information is hard coded in the HTML. Since I am back-end developer I like to make it so everything including buttons and welcome messages are taken from the database. I am trying to store projects that I have worked on. There are several types:
Github Repository - a project that is done purely on github.
Work related - a project I have done on work and there is no github repository of it, only link to view the final result
UpWork or other freelance website - as a freelancer I have projects to fix something on a website and those projects can be viewed only on my profile there and I would like to list them with link to UpWork or wherever there is information on what exactly I was hired to do.
Now my question is - should I have different Entities and therefore different tables for these types of projects or should I have all of the possible properties in one table. For example if it is Github there is repository field and if it is work related then there is company field. If it is freelance it has link to the website I was hired on. Also there are different sub-types - web applications, desktop applications, games and so on.
As you can guess the changes are small (1 or 2 properties). I could very easily leave empty some properties and have another property projectType, but is this the right way? Should I have different tables and entities for them?
To give some info - I can work with both MySQL and NoSQL and I havent decided yet on which one should my website be made on. I am currently thinking about NoSQL. This means I am asking on how to store the projects on MySQL and NoSQL (by NoSQL I mean MongoDB). If it helps the languages I am choosing from are PHP (MySQL) and JavaScript (NoSQL)
I know that usually questions without code are downvoted, but this is more of a logic based problem as I know how to do it, but I don't know the best practices for my situation. This being said here is a small code for you -
console.log('Thank you in advance')
MongoDB lends itself very well to this exact situation.
You can create a collection where documents leave out certain fields if they are not needed for that type. The querying parameters of MongoDB allow you to check $exists on fields if you need to, and documents are stored efficiently, only taking up memory where a field is needed.
You can even setup a sparse index which is not required for every document. As long as your core document structure is the same, it is a good idea to keep them in one collection, and vary them based on their type.

Build a social network & organization database

I'm doing a PhD in political science and plan to collect datas on several organizations and do some social network analysis.
I'm new to database building and management, and I'd like to know what tool (LibreOffice Base, MySql, etc.) would be the best for me.
In this database, I would have a list of organizations (approximately 200) with various attributes and files attached, a list of individuals working in/with one or several of these organizations, a list of coalitions linking different organizations, a list of events where some organizations/individuals are, etc.
I'm starting from scrap, what do you think would be the best way to build this database ? I tried with LibreOffice Base and started to create different tables (organizations, individuals, etc.) but I'm not sure it will fit my needs.
Thanks in advance !
I think you should look at a graph database engine like Neo4J for this use case.
With a graph DB, one could store entities (such as organizations in your case) and relationships between them in the form of nodes and edges. By having your data stored this way, you can easily interrogate your data for insights that might not be easily done using standard relational data systems.
Free ebook describing the need for graph storage and the common problems solved by such a datastore
Say, that you wish to store information about organizations, individuals working for those organizations, their job roles etc. You can do this by creating Nodes and relationships like the following:
(Person:"Joe Bloggs")-[:WORKS_AT]->(Organization: Google)
(Person:"Joe Bloggs")-[:WORKS_AS]->(JobRole: "Software Developer")
The above describes a person called Joe Bloggs that works for Google as a software developer. You can use Ciper query language (official language used for querying Neo4j) to get all software developers working for google.

Persistence Layer In SaaS Application

I have planned a SaaS Application for which we have selected Java for building the back end ,not yet selected which frameworks to utilize and I have opted to use either Ember JS with Bootstrap or Foundation with Bootstrap or Angular JS with Bootstrap for building the front end of the application.
I am confused with the persistence layer that either I should go for traditional Relational databases or should I go for 'Nosql Database' .
The idea is simple and straight ,offering Highly Configurable School Management System in SaaS model.The module at first I will be working on is Time and Attendance tracking of School/Universities/Colleges/Coaching Centers etc.As you can see that the policy of attendance (late,absent,present) varies from school to school ,university to university ,within university department to department ,within department teacher to teacher ,and coaching to coaching etc .And our application is not going to be deployed to their respective servers and will be hosted at cloud so one application running Accommodating dynamic policies running in isolation from the other.
My data is expected to grow with the period of time ,at fast pace since every school/coaching/institute will contain data of the following and following entities will be using the Application,Parent ,Student,Teachers,Principles,person who wants to take admission,Peons,etc
I have read answers to questions posted for the same kind of query and I found that people have used relational databases for this kind of application but they have built it 5-10 years back when there was no concept of Nosql databases ,All we knew was relational,object oriented databases so it would not be wrong to say that they opt the stack that was available at that time
I think that you should go for relational databases and I don't see any need of using Nosql databases ,the schema you will be having is static I am sure and you will be needed to maintain complex relationships as well.
Have a look at 'Multi tenant Architecture' ,and I would suggest you to use one database per client against one db per all clients.
Lets see what others would recommend you.