So it's a pick up where we left off having created or school management projects.
First thing that we want to do is set up our data base so that we can get our models sorted out.
So to set up the database we need to go over to or view the menu and then we look for a school server
object to explore.
So for this exercise we'll be using over.
D.B. if you have Acela Express or a skilled developer installed then you may use that instance but to
keep it simple I just use the one that comes built in with Visual Studio dropped on into my local VB
instance and look at all my databases I've got a few databases from past projects.
But we want to create a new database will be right click databases and click add new database and we
can give it a name we'll call it school management.
Should
be on display D.B. or see me name it the same as mine at least for consistency.
You may change it but so that we have a more seamless flow.
Let's just keep the same naming convention and then click Okay.
This then creates our new database so I can drill down into this database and see on my tables there
would be none except the auto generated system tables which for this exercise aren't really necessary.
So we'll just right click on tables and click add new table
I have included the script files so you may go ahead and copy the script file from the
I have already included the script files that will generate our database to use one of the script files
for the very first one but then I'll create build those manually so I copied the script file from our
learning platform and then you can pace it's in this section that says t a school and you notice that
whatever you put on here gets replicated here.
And if you make a change at the top you're advocate in the script.
So they work quite well in tandem.
Once they're satisfied with the table then your table looks just like mine.
Then you may go ahead and click Update to update the database
and click Update database
ones that hasn't been successful you may repeat that procedure with every other table that this prescribes.
So we created a student table that would create of course to do this one using the designer.
So we have course I.T. Of course the name here is really inconsequential but you want to ensure that
you have a card to name you know what it is later on title
Kurtz and credits would be an integer
whereas title would be an FA char split 50.
Another is for both of them and I will make my primary key and identity column there a number of ways
to do that for me the easiest way is just the right identity.
One
All right so she had no spelling errors then you would have no errors like oh if I just had.
So that is our script and it will just rename our table to course.
Look on course.
Right.
And then once all is well you just click updates once again and update the database.
Once that is successful we should see our horses table listed there and then we have one more table
for which I'll use a script to go.
This is a really big table.
So I just stare at the script and piece there and then that would give us our enrollment table with
our enrollment I.D. which is our primary key or grade course.
So this table is what you call a link or table which is facilitating many many many to many relationship
between all the courses and all of the students that are doing these courses.
This is attracting all of those associations and also the that they would get.
So once you are satisfied with that you may click Update
having successfully created all three tables.
You're not ready for the next step but of course you can just verify by going to a sequel object explore
and just making sure that all three tables are there.
You can view the data by right clicking on the specific table and then clicking into of course we have
not entered any data into anything as yet.
So everything is empty.
Thank you for tuning in and see you next year.