Optimising Marksheet Database
- I am trying to design a database for mark sheet data of a school having different types of exams of different levels or class.
- Is it possible to have single table where I can store data in string (array serialize PHP) and perform a search based on subjects easily (Maximum/Minimum/Average).
The table look something like this with bit variations-
Class 5
XXXXX ------ Math ----- Hindi ----- English
Amit -------- 10 ------- 20 ----------31
Alok -------- 10 ------- 20 ----------31
Class 8
XXXXX ------ Math ----- Hindi ----- English ---- Science
Amit -------- 10 ------- 20 ----------31 ----------20
Alok -------- 10 ------- 20 ----------31 ----------23
Using PHP's array serialize I will have marks data in string as
a:4:{s:4:"math";i:20;s:5:"hindi";i:30;s:7:"english";i:23;s:7:"science";i:10;}
Should I have separate table or can I have the condensed table so that database does not become too heavy with too many rows?
mysql database-design innodb php
bumped to the homepage by Community♦ 28 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 am trying to design a database for mark sheet data of a school having different types of exams of different levels or class.
- Is it possible to have single table where I can store data in string (array serialize PHP) and perform a search based on subjects easily (Maximum/Minimum/Average).
The table look something like this with bit variations-
Class 5
XXXXX ------ Math ----- Hindi ----- English
Amit -------- 10 ------- 20 ----------31
Alok -------- 10 ------- 20 ----------31
Class 8
XXXXX ------ Math ----- Hindi ----- English ---- Science
Amit -------- 10 ------- 20 ----------31 ----------20
Alok -------- 10 ------- 20 ----------31 ----------23
Using PHP's array serialize I will have marks data in string as
a:4:{s:4:"math";i:20;s:5:"hindi";i:30;s:7:"english";i:23;s:7:"science";i:10;}
Should I have separate table or can I have the condensed table so that database does not become too heavy with too many rows?
mysql database-design innodb php
bumped to the homepage by Community♦ 28 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Have you tried JSON structure?
– SQL.RK
Feb 9 '17 at 12:20
I have advantage ofserialize
overJSON
... Although JSON is efficient too.
– Vishal Kumar Sahu
Feb 9 '17 at 15:06
add a comment |
- I am trying to design a database for mark sheet data of a school having different types of exams of different levels or class.
- Is it possible to have single table where I can store data in string (array serialize PHP) and perform a search based on subjects easily (Maximum/Minimum/Average).
The table look something like this with bit variations-
Class 5
XXXXX ------ Math ----- Hindi ----- English
Amit -------- 10 ------- 20 ----------31
Alok -------- 10 ------- 20 ----------31
Class 8
XXXXX ------ Math ----- Hindi ----- English ---- Science
Amit -------- 10 ------- 20 ----------31 ----------20
Alok -------- 10 ------- 20 ----------31 ----------23
Using PHP's array serialize I will have marks data in string as
a:4:{s:4:"math";i:20;s:5:"hindi";i:30;s:7:"english";i:23;s:7:"science";i:10;}
Should I have separate table or can I have the condensed table so that database does not become too heavy with too many rows?
mysql database-design innodb php
- I am trying to design a database for mark sheet data of a school having different types of exams of different levels or class.
- Is it possible to have single table where I can store data in string (array serialize PHP) and perform a search based on subjects easily (Maximum/Minimum/Average).
The table look something like this with bit variations-
Class 5
XXXXX ------ Math ----- Hindi ----- English
Amit -------- 10 ------- 20 ----------31
Alok -------- 10 ------- 20 ----------31
Class 8
XXXXX ------ Math ----- Hindi ----- English ---- Science
Amit -------- 10 ------- 20 ----------31 ----------20
Alok -------- 10 ------- 20 ----------31 ----------23
Using PHP's array serialize I will have marks data in string as
a:4:{s:4:"math";i:20;s:5:"hindi";i:30;s:7:"english";i:23;s:7:"science";i:10;}
Should I have separate table or can I have the condensed table so that database does not become too heavy with too many rows?
mysql database-design innodb php
mysql database-design innodb php
asked Feb 9 '17 at 7:42
Vishal Kumar SahuVishal Kumar Sahu
1062
1062
bumped to the homepage by Community♦ 28 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♦ 28 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Have you tried JSON structure?
– SQL.RK
Feb 9 '17 at 12:20
I have advantage ofserialize
overJSON
... Although JSON is efficient too.
– Vishal Kumar Sahu
Feb 9 '17 at 15:06
add a comment |
Have you tried JSON structure?
– SQL.RK
Feb 9 '17 at 12:20
I have advantage ofserialize
overJSON
... Although JSON is efficient too.
– Vishal Kumar Sahu
Feb 9 '17 at 15:06
Have you tried JSON structure?
– SQL.RK
Feb 9 '17 at 12:20
Have you tried JSON structure?
– SQL.RK
Feb 9 '17 at 12:20
I have advantage of
serialize
over JSON
... Although JSON is efficient too.– Vishal Kumar Sahu
Feb 9 '17 at 15:06
I have advantage of
serialize
over JSON
... Although JSON is efficient too.– Vishal Kumar Sahu
Feb 9 '17 at 15:06
add a comment |
1 Answer
1
active
oldest
votes
You really should not hide the data you want to do arithmetic inside any kind of structure.
Use a table with 4 columns: class, student, subject, score.
Then things like each student's avg score:
SELECT student,
AVG(score)
FROM tbl
GROUP BY student;
You are right. But what if data has variable fields or subjects.? How can I handle that?
– Vishal Kumar Sahu
Feb 18 '17 at 7:47
"Variable fields"? Perhaps we need to see some more data, plus more desired output. The new example(s) should highlight what you are asking.
– Rick James
Feb 18 '17 at 16:14
Variable fields mean, I need data in variable columns...
– Vishal Kumar Sahu
Feb 18 '17 at 22:06
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%2f163693%2foptimising-marksheet-database%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
You really should not hide the data you want to do arithmetic inside any kind of structure.
Use a table with 4 columns: class, student, subject, score.
Then things like each student's avg score:
SELECT student,
AVG(score)
FROM tbl
GROUP BY student;
You are right. But what if data has variable fields or subjects.? How can I handle that?
– Vishal Kumar Sahu
Feb 18 '17 at 7:47
"Variable fields"? Perhaps we need to see some more data, plus more desired output. The new example(s) should highlight what you are asking.
– Rick James
Feb 18 '17 at 16:14
Variable fields mean, I need data in variable columns...
– Vishal Kumar Sahu
Feb 18 '17 at 22:06
add a comment |
You really should not hide the data you want to do arithmetic inside any kind of structure.
Use a table with 4 columns: class, student, subject, score.
Then things like each student's avg score:
SELECT student,
AVG(score)
FROM tbl
GROUP BY student;
You are right. But what if data has variable fields or subjects.? How can I handle that?
– Vishal Kumar Sahu
Feb 18 '17 at 7:47
"Variable fields"? Perhaps we need to see some more data, plus more desired output. The new example(s) should highlight what you are asking.
– Rick James
Feb 18 '17 at 16:14
Variable fields mean, I need data in variable columns...
– Vishal Kumar Sahu
Feb 18 '17 at 22:06
add a comment |
You really should not hide the data you want to do arithmetic inside any kind of structure.
Use a table with 4 columns: class, student, subject, score.
Then things like each student's avg score:
SELECT student,
AVG(score)
FROM tbl
GROUP BY student;
You really should not hide the data you want to do arithmetic inside any kind of structure.
Use a table with 4 columns: class, student, subject, score.
Then things like each student's avg score:
SELECT student,
AVG(score)
FROM tbl
GROUP BY student;
answered Feb 10 '17 at 1:00
Rick JamesRick James
41.5k22258
41.5k22258
You are right. But what if data has variable fields or subjects.? How can I handle that?
– Vishal Kumar Sahu
Feb 18 '17 at 7:47
"Variable fields"? Perhaps we need to see some more data, plus more desired output. The new example(s) should highlight what you are asking.
– Rick James
Feb 18 '17 at 16:14
Variable fields mean, I need data in variable columns...
– Vishal Kumar Sahu
Feb 18 '17 at 22:06
add a comment |
You are right. But what if data has variable fields or subjects.? How can I handle that?
– Vishal Kumar Sahu
Feb 18 '17 at 7:47
"Variable fields"? Perhaps we need to see some more data, plus more desired output. The new example(s) should highlight what you are asking.
– Rick James
Feb 18 '17 at 16:14
Variable fields mean, I need data in variable columns...
– Vishal Kumar Sahu
Feb 18 '17 at 22:06
You are right. But what if data has variable fields or subjects.? How can I handle that?
– Vishal Kumar Sahu
Feb 18 '17 at 7:47
You are right. But what if data has variable fields or subjects.? How can I handle that?
– Vishal Kumar Sahu
Feb 18 '17 at 7:47
"Variable fields"? Perhaps we need to see some more data, plus more desired output. The new example(s) should highlight what you are asking.
– Rick James
Feb 18 '17 at 16:14
"Variable fields"? Perhaps we need to see some more data, plus more desired output. The new example(s) should highlight what you are asking.
– Rick James
Feb 18 '17 at 16:14
Variable fields mean, I need data in variable columns...
– Vishal Kumar Sahu
Feb 18 '17 at 22:06
Variable fields mean, I need data in variable columns...
– Vishal Kumar Sahu
Feb 18 '17 at 22:06
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%2f163693%2foptimising-marksheet-database%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
Have you tried JSON structure?
– SQL.RK
Feb 9 '17 at 12:20
I have advantage of
serialize
overJSON
... Although JSON is efficient too.– Vishal Kumar Sahu
Feb 9 '17 at 15:06