designing user friendly relational databases
I want to create a database system that is user friendly with the right relationships. My system should be in such a way that we have a writer's table, orders table, and payments table such that I am capable of knowing which writer did certain orders and shows the amount the writer should be paid for doing an order. The system should also indicate whether the payment has been made for each order done by the writer.
I tried my best and came up with the following tables:
- payments table: pay_id (PK), date, mode of payment, amount, balance, writer_id (fk), order_id (fk);
- writer’s table: id (pk), name, email, phone numbers, disciplines;
- order’s table: order_id (pk), name, order_status (completed, under warranty, completed), writer_id (fk)
Kindly assist me in making the necessary corrections so that all relations can be created and the database becomes human friendly.
database-design
bumped to the homepage by Community♦ 6 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I want to create a database system that is user friendly with the right relationships. My system should be in such a way that we have a writer's table, orders table, and payments table such that I am capable of knowing which writer did certain orders and shows the amount the writer should be paid for doing an order. The system should also indicate whether the payment has been made for each order done by the writer.
I tried my best and came up with the following tables:
- payments table: pay_id (PK), date, mode of payment, amount, balance, writer_id (fk), order_id (fk);
- writer’s table: id (pk), name, email, phone numbers, disciplines;
- order’s table: order_id (pk), name, order_status (completed, under warranty, completed), writer_id (fk)
Kindly assist me in making the necessary corrections so that all relations can be created and the database becomes human friendly.
database-design
bumped to the homepage by Community♦ 6 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I want to create a database system that is user friendly with the right relationships. My system should be in such a way that we have a writer's table, orders table, and payments table such that I am capable of knowing which writer did certain orders and shows the amount the writer should be paid for doing an order. The system should also indicate whether the payment has been made for each order done by the writer.
I tried my best and came up with the following tables:
- payments table: pay_id (PK), date, mode of payment, amount, balance, writer_id (fk), order_id (fk);
- writer’s table: id (pk), name, email, phone numbers, disciplines;
- order’s table: order_id (pk), name, order_status (completed, under warranty, completed), writer_id (fk)
Kindly assist me in making the necessary corrections so that all relations can be created and the database becomes human friendly.
database-design
I want to create a database system that is user friendly with the right relationships. My system should be in such a way that we have a writer's table, orders table, and payments table such that I am capable of knowing which writer did certain orders and shows the amount the writer should be paid for doing an order. The system should also indicate whether the payment has been made for each order done by the writer.
I tried my best and came up with the following tables:
- payments table: pay_id (PK), date, mode of payment, amount, balance, writer_id (fk), order_id (fk);
- writer’s table: id (pk), name, email, phone numbers, disciplines;
- order’s table: order_id (pk), name, order_status (completed, under warranty, completed), writer_id (fk)
Kindly assist me in making the necessary corrections so that all relations can be created and the database becomes human friendly.
database-design
database-design
edited Aug 25 '16 at 17:25
Andriy M
16k63373
16k63373
asked Aug 25 '16 at 17:12
KeyeliKeyeli
12
12
bumped to the homepage by Community♦ 6 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 6 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I have absolutely no idea what a user friendly database could possibly look like. Your apps are like the dashboard and controls of an automobile. This is where you might hear the expression user friendly. The database is like the engine and/or transmission. They have important functions to perform and here is where you would expect to hear expressions like reliable.
Your top concern when designing a database is data integrity. That is what gives it the aspect of reliability. Without that, the most user friendly interface in the world would be useless.
There is, however, one section of a database that we might concern ourselves with user friendliness, if by user we mean app developer. That is the api or the interface to the database. The app developer doesn't really care about relationships and really shouldn't be concerned with the physical layout of the database. Sure, in their code one entity may relate to another, but the physical implementation of that relationship in the code may be (and generally is) very different from the physical implementation of the relationship in the database. No computer language has "foreign key" as one of its features.
What the app developer needs are:
- Reliable data
- Fast retrieval and storage of the data
- Data in a format easiest to handle within their coding framework
The first need is delivered by designing the database with data integrity foremost in mind.
The second need is delivered by a good combination of software (efficient queries and stored procedures) and hardware. Very rarely will efficiency require a change in the design of the data, such as denormalization.
The third need can be delivered by a variety of methods which can vary according to the particulars of DBMS and front-end platform but chief among them are a library of stored procedures (heavily overridden to supply an interface for data in a wide range of forms) and views (exposing the data for direct access also in a wide range of forms).
One rule that seems to apply over all three of these needs is this: do not allow developers direct access to the tables. Find out what data they need and in what form they need it, then supply the stored procedures and/or views that will give it to them. An actual api written in the app language would be a great addition. Then the developer doesn't have to think of the database at all, just the api.
This rule helps in several ways but by far the most important is that you will not need to change the design of the database to satisfy the needs of the application developers. Database designers who find themselves in the situation where a database design change is forced by developer needs almost inevitably do so by sacrificing data integrity. When you find yourself going down that road it is all down hill -- and not in a good way!
With a wall of abstraction between the data and the application, when the database needs to change because of changes to entities or relationships, those changes can be made in a way that maintains the all important reliability and then the stored procedures and views changed to maintain the expected interface with the now-changed data. When the application adds or modifies functionality, this can change what data it needs or the form it needs it in, but this does not require a change in database design to fulfill those changing requirements.
Life is good.
In your particular situation, you have Writers, Orders and Payments. This seems like a fairly straight-forward design which you have made a pretty good start. With just a few tweaks (the Payments table doesn't need a writer field -- that is contained in the Order), you should have it nailed down in short order.
Then answers to such questions as "whether the payment has been made for each order done by the writer" can be supplied by stored procedure or view.
If you get to that point and run into trouble, ask another question.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f147908%2fdesigning-user-friendly-relational-databases%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I have absolutely no idea what a user friendly database could possibly look like. Your apps are like the dashboard and controls of an automobile. This is where you might hear the expression user friendly. The database is like the engine and/or transmission. They have important functions to perform and here is where you would expect to hear expressions like reliable.
Your top concern when designing a database is data integrity. That is what gives it the aspect of reliability. Without that, the most user friendly interface in the world would be useless.
There is, however, one section of a database that we might concern ourselves with user friendliness, if by user we mean app developer. That is the api or the interface to the database. The app developer doesn't really care about relationships and really shouldn't be concerned with the physical layout of the database. Sure, in their code one entity may relate to another, but the physical implementation of that relationship in the code may be (and generally is) very different from the physical implementation of the relationship in the database. No computer language has "foreign key" as one of its features.
What the app developer needs are:
- Reliable data
- Fast retrieval and storage of the data
- Data in a format easiest to handle within their coding framework
The first need is delivered by designing the database with data integrity foremost in mind.
The second need is delivered by a good combination of software (efficient queries and stored procedures) and hardware. Very rarely will efficiency require a change in the design of the data, such as denormalization.
The third need can be delivered by a variety of methods which can vary according to the particulars of DBMS and front-end platform but chief among them are a library of stored procedures (heavily overridden to supply an interface for data in a wide range of forms) and views (exposing the data for direct access also in a wide range of forms).
One rule that seems to apply over all three of these needs is this: do not allow developers direct access to the tables. Find out what data they need and in what form they need it, then supply the stored procedures and/or views that will give it to them. An actual api written in the app language would be a great addition. Then the developer doesn't have to think of the database at all, just the api.
This rule helps in several ways but by far the most important is that you will not need to change the design of the database to satisfy the needs of the application developers. Database designers who find themselves in the situation where a database design change is forced by developer needs almost inevitably do so by sacrificing data integrity. When you find yourself going down that road it is all down hill -- and not in a good way!
With a wall of abstraction between the data and the application, when the database needs to change because of changes to entities or relationships, those changes can be made in a way that maintains the all important reliability and then the stored procedures and views changed to maintain the expected interface with the now-changed data. When the application adds or modifies functionality, this can change what data it needs or the form it needs it in, but this does not require a change in database design to fulfill those changing requirements.
Life is good.
In your particular situation, you have Writers, Orders and Payments. This seems like a fairly straight-forward design which you have made a pretty good start. With just a few tweaks (the Payments table doesn't need a writer field -- that is contained in the Order), you should have it nailed down in short order.
Then answers to such questions as "whether the payment has been made for each order done by the writer" can be supplied by stored procedure or view.
If you get to that point and run into trouble, ask another question.
add a comment |
I have absolutely no idea what a user friendly database could possibly look like. Your apps are like the dashboard and controls of an automobile. This is where you might hear the expression user friendly. The database is like the engine and/or transmission. They have important functions to perform and here is where you would expect to hear expressions like reliable.
Your top concern when designing a database is data integrity. That is what gives it the aspect of reliability. Without that, the most user friendly interface in the world would be useless.
There is, however, one section of a database that we might concern ourselves with user friendliness, if by user we mean app developer. That is the api or the interface to the database. The app developer doesn't really care about relationships and really shouldn't be concerned with the physical layout of the database. Sure, in their code one entity may relate to another, but the physical implementation of that relationship in the code may be (and generally is) very different from the physical implementation of the relationship in the database. No computer language has "foreign key" as one of its features.
What the app developer needs are:
- Reliable data
- Fast retrieval and storage of the data
- Data in a format easiest to handle within their coding framework
The first need is delivered by designing the database with data integrity foremost in mind.
The second need is delivered by a good combination of software (efficient queries and stored procedures) and hardware. Very rarely will efficiency require a change in the design of the data, such as denormalization.
The third need can be delivered by a variety of methods which can vary according to the particulars of DBMS and front-end platform but chief among them are a library of stored procedures (heavily overridden to supply an interface for data in a wide range of forms) and views (exposing the data for direct access also in a wide range of forms).
One rule that seems to apply over all three of these needs is this: do not allow developers direct access to the tables. Find out what data they need and in what form they need it, then supply the stored procedures and/or views that will give it to them. An actual api written in the app language would be a great addition. Then the developer doesn't have to think of the database at all, just the api.
This rule helps in several ways but by far the most important is that you will not need to change the design of the database to satisfy the needs of the application developers. Database designers who find themselves in the situation where a database design change is forced by developer needs almost inevitably do so by sacrificing data integrity. When you find yourself going down that road it is all down hill -- and not in a good way!
With a wall of abstraction between the data and the application, when the database needs to change because of changes to entities or relationships, those changes can be made in a way that maintains the all important reliability and then the stored procedures and views changed to maintain the expected interface with the now-changed data. When the application adds or modifies functionality, this can change what data it needs or the form it needs it in, but this does not require a change in database design to fulfill those changing requirements.
Life is good.
In your particular situation, you have Writers, Orders and Payments. This seems like a fairly straight-forward design which you have made a pretty good start. With just a few tweaks (the Payments table doesn't need a writer field -- that is contained in the Order), you should have it nailed down in short order.
Then answers to such questions as "whether the payment has been made for each order done by the writer" can be supplied by stored procedure or view.
If you get to that point and run into trouble, ask another question.
add a comment |
I have absolutely no idea what a user friendly database could possibly look like. Your apps are like the dashboard and controls of an automobile. This is where you might hear the expression user friendly. The database is like the engine and/or transmission. They have important functions to perform and here is where you would expect to hear expressions like reliable.
Your top concern when designing a database is data integrity. That is what gives it the aspect of reliability. Without that, the most user friendly interface in the world would be useless.
There is, however, one section of a database that we might concern ourselves with user friendliness, if by user we mean app developer. That is the api or the interface to the database. The app developer doesn't really care about relationships and really shouldn't be concerned with the physical layout of the database. Sure, in their code one entity may relate to another, but the physical implementation of that relationship in the code may be (and generally is) very different from the physical implementation of the relationship in the database. No computer language has "foreign key" as one of its features.
What the app developer needs are:
- Reliable data
- Fast retrieval and storage of the data
- Data in a format easiest to handle within their coding framework
The first need is delivered by designing the database with data integrity foremost in mind.
The second need is delivered by a good combination of software (efficient queries and stored procedures) and hardware. Very rarely will efficiency require a change in the design of the data, such as denormalization.
The third need can be delivered by a variety of methods which can vary according to the particulars of DBMS and front-end platform but chief among them are a library of stored procedures (heavily overridden to supply an interface for data in a wide range of forms) and views (exposing the data for direct access also in a wide range of forms).
One rule that seems to apply over all three of these needs is this: do not allow developers direct access to the tables. Find out what data they need and in what form they need it, then supply the stored procedures and/or views that will give it to them. An actual api written in the app language would be a great addition. Then the developer doesn't have to think of the database at all, just the api.
This rule helps in several ways but by far the most important is that you will not need to change the design of the database to satisfy the needs of the application developers. Database designers who find themselves in the situation where a database design change is forced by developer needs almost inevitably do so by sacrificing data integrity. When you find yourself going down that road it is all down hill -- and not in a good way!
With a wall of abstraction between the data and the application, when the database needs to change because of changes to entities or relationships, those changes can be made in a way that maintains the all important reliability and then the stored procedures and views changed to maintain the expected interface with the now-changed data. When the application adds or modifies functionality, this can change what data it needs or the form it needs it in, but this does not require a change in database design to fulfill those changing requirements.
Life is good.
In your particular situation, you have Writers, Orders and Payments. This seems like a fairly straight-forward design which you have made a pretty good start. With just a few tweaks (the Payments table doesn't need a writer field -- that is contained in the Order), you should have it nailed down in short order.
Then answers to such questions as "whether the payment has been made for each order done by the writer" can be supplied by stored procedure or view.
If you get to that point and run into trouble, ask another question.
I have absolutely no idea what a user friendly database could possibly look like. Your apps are like the dashboard and controls of an automobile. This is where you might hear the expression user friendly. The database is like the engine and/or transmission. They have important functions to perform and here is where you would expect to hear expressions like reliable.
Your top concern when designing a database is data integrity. That is what gives it the aspect of reliability. Without that, the most user friendly interface in the world would be useless.
There is, however, one section of a database that we might concern ourselves with user friendliness, if by user we mean app developer. That is the api or the interface to the database. The app developer doesn't really care about relationships and really shouldn't be concerned with the physical layout of the database. Sure, in their code one entity may relate to another, but the physical implementation of that relationship in the code may be (and generally is) very different from the physical implementation of the relationship in the database. No computer language has "foreign key" as one of its features.
What the app developer needs are:
- Reliable data
- Fast retrieval and storage of the data
- Data in a format easiest to handle within their coding framework
The first need is delivered by designing the database with data integrity foremost in mind.
The second need is delivered by a good combination of software (efficient queries and stored procedures) and hardware. Very rarely will efficiency require a change in the design of the data, such as denormalization.
The third need can be delivered by a variety of methods which can vary according to the particulars of DBMS and front-end platform but chief among them are a library of stored procedures (heavily overridden to supply an interface for data in a wide range of forms) and views (exposing the data for direct access also in a wide range of forms).
One rule that seems to apply over all three of these needs is this: do not allow developers direct access to the tables. Find out what data they need and in what form they need it, then supply the stored procedures and/or views that will give it to them. An actual api written in the app language would be a great addition. Then the developer doesn't have to think of the database at all, just the api.
This rule helps in several ways but by far the most important is that you will not need to change the design of the database to satisfy the needs of the application developers. Database designers who find themselves in the situation where a database design change is forced by developer needs almost inevitably do so by sacrificing data integrity. When you find yourself going down that road it is all down hill -- and not in a good way!
With a wall of abstraction between the data and the application, when the database needs to change because of changes to entities or relationships, those changes can be made in a way that maintains the all important reliability and then the stored procedures and views changed to maintain the expected interface with the now-changed data. When the application adds or modifies functionality, this can change what data it needs or the form it needs it in, but this does not require a change in database design to fulfill those changing requirements.
Life is good.
In your particular situation, you have Writers, Orders and Payments. This seems like a fairly straight-forward design which you have made a pretty good start. With just a few tweaks (the Payments table doesn't need a writer field -- that is contained in the Order), you should have it nailed down in short order.
Then answers to such questions as "whether the payment has been made for each order done by the writer" can be supplied by stored procedure or view.
If you get to that point and run into trouble, ask another question.
answered Aug 27 '16 at 1:44
TommCattTommCatt
1,86159
1,86159
add a comment |
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f147908%2fdesigning-user-friendly-relational-databases%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown