well, im really new to mysql, and i have no idea to do what i am intending to, or atleast not the efficient way.
i have to make a database that will hold people's information
within it every person has 3 courses to pass(courses as in educational courses) lets say its stage 1, 2 and 3, they cannot start course 2 without completing course 1
every course has 10 tests, they have the same name (eg. there is a test called example1 in course1 and also a test called example1 in course2, but its more difficult)
there aren't grades, just passed or failed
开发者_C百科and lastly they are permitted into taking each test 3 times, i want to store the date(every try) and also who was the applier of the exam(every try), the names of the "teachers" are on a table
It is not a matter of mysql or php.
You should learn about Database Modelling.
And then use any of these tools (I like DB Designer for modelling)
Then you should learn how to integrate PHP and MySQL
Try Sakila database created by mySql, this is an example database used for training. You'll learn a few tricks from there, quite useful before creating your own database or maybe even before reading some books or the theme.
In additon to patricio's answer (which I consider valuable and good pointers). Take what you have written above and extend it. Find the key works in your description (i expect this will include people, course, test ...). For each key word identify all details you need to hold.
E.g. "I have to make a database that will hold peoples information" And for people I need to know ... maybe first name, last name, data of birth, employee number, etc. What ever details of a person is relevant to you. List them in a spreedsheet or document. Repeat this for each key word.
Then consider items you need to know to run the system, your last bullet point heads in this direction. Identify any new key words from that and then details you need to know about those key words.
Take your list of details and normalise it. As a general rule of thumb aim for 3rd normal form. In most cases it appears to be a workable compromise between higher levels of normalisation and not doing it. Maybe one of those 80/20 rules where by with 20% of the effort it takes to get there (as opposed to normalising to 6th normal form) you get 80% of the benefit of normalising.
Put together a proposal and feel free to come back for us to critique it if you want.
精彩评论