1 00:00:00,600 --> 00:00:05,110 So it's a pick up where we left off having created or school management projects. 2 00:00:05,150 --> 00:00:11,950 First thing that we want to do is set up our data base so that we can get our models sorted out. 3 00:00:12,090 --> 00:00:20,460 So to set up the database we need to go over to or view the menu and then we look for a school server 4 00:00:20,490 --> 00:00:22,070 object to explore. 5 00:00:22,080 --> 00:00:24,520 So for this exercise we'll be using over. 6 00:00:24,530 --> 00:00:32,850 D.B. if you have Acela Express or a skilled developer installed then you may use that instance but to 7 00:00:32,850 --> 00:00:39,990 keep it simple I just use the one that comes built in with Visual Studio dropped on into my local VB 8 00:00:39,990 --> 00:00:46,140 instance and look at all my databases I've got a few databases from past projects. 9 00:00:46,140 --> 00:00:52,710 But we want to create a new database will be right click databases and click add new database and we 10 00:00:52,710 --> 00:00:58,210 can give it a name we'll call it school management. 11 00:00:59,000 --> 00:00:59,370 Should 12 00:01:02,190 --> 00:01:10,530 be on display D.B. or see me name it the same as mine at least for consistency. 13 00:01:10,530 --> 00:01:15,130 You may change it but so that we have a more seamless flow. 14 00:01:15,150 --> 00:01:18,570 Let's just keep the same naming convention and then click Okay. 15 00:01:23,360 --> 00:01:30,470 This then creates our new database so I can drill down into this database and see on my tables there 16 00:01:30,470 --> 00:01:37,820 would be none except the auto generated system tables which for this exercise aren't really necessary. 17 00:01:37,970 --> 00:01:41,210 So we'll just right click on tables and click add new table 18 00:01:45,350 --> 00:01:52,330 I have included the script files so you may go ahead and copy the script file from the 19 00:01:57,360 --> 00:02:03,810 I have already included the script files that will generate our database to use one of the script files 20 00:02:03,810 --> 00:02:13,170 for the very first one but then I'll create build those manually so I copied the script file from our 21 00:02:13,170 --> 00:02:19,080 learning platform and then you can pace it's in this section that says t a school and you notice that 22 00:02:19,080 --> 00:02:21,830 whatever you put on here gets replicated here. 23 00:02:21,840 --> 00:02:25,880 And if you make a change at the top you're advocate in the script. 24 00:02:26,250 --> 00:02:30,840 So they work quite well in tandem. 25 00:02:30,840 --> 00:02:34,640 Once they're satisfied with the table then your table looks just like mine. 26 00:02:34,650 --> 00:02:38,580 Then you may go ahead and click Update to update the database 27 00:02:43,580 --> 00:02:45,610 and click Update database 28 00:02:53,130 --> 00:02:59,280 ones that hasn't been successful you may repeat that procedure with every other table that this prescribes. 29 00:02:59,280 --> 00:03:05,670 So we created a student table that would create of course to do this one using the designer. 30 00:03:06,660 --> 00:03:15,790 So we have course I.T. Of course the name here is really inconsequential but you want to ensure that 31 00:03:15,790 --> 00:03:22,300 you have a card to name you know what it is later on title 32 00:03:25,830 --> 00:03:30,430 Kurtz and credits would be an integer 33 00:03:32,930 --> 00:03:39,740 whereas title would be an FA char split 50. 34 00:03:39,860 --> 00:03:48,320 Another is for both of them and I will make my primary key and identity column there a number of ways 35 00:03:48,320 --> 00:03:54,450 to do that for me the easiest way is just the right identity. 36 00:03:54,920 --> 00:03:55,270 One 37 00:04:11,800 --> 00:04:17,470 All right so she had no spelling errors then you would have no errors like oh if I just had. 38 00:04:18,370 --> 00:04:25,690 So that is our script and it will just rename our table to course. 39 00:04:25,940 --> 00:04:28,090 Look on course. 40 00:04:28,180 --> 00:04:28,710 Right. 41 00:04:28,720 --> 00:04:35,830 And then once all is well you just click updates once again and update the database. 42 00:04:38,770 --> 00:04:49,540 Once that is successful we should see our horses table listed there and then we have one more table 43 00:04:49,800 --> 00:04:51,370 for which I'll use a script to go. 44 00:04:51,370 --> 00:04:52,600 This is a really big table. 45 00:04:55,270 --> 00:05:01,930 So I just stare at the script and piece there and then that would give us our enrollment table with 46 00:05:01,930 --> 00:05:08,300 our enrollment I.D. which is our primary key or grade course. 47 00:05:08,620 --> 00:05:15,280 So this table is what you call a link or table which is facilitating many many many to many relationship 48 00:05:15,280 --> 00:05:19,710 between all the courses and all of the students that are doing these courses. 49 00:05:19,780 --> 00:05:25,500 This is attracting all of those associations and also the that they would get. 50 00:05:26,470 --> 00:05:30,160 So once you are satisfied with that you may click Update 51 00:05:35,180 --> 00:05:38,260 having successfully created all three tables. 52 00:05:38,270 --> 00:05:46,280 You're not ready for the next step but of course you can just verify by going to a sequel object explore 53 00:05:46,520 --> 00:05:49,270 and just making sure that all three tables are there. 54 00:05:49,490 --> 00:05:58,320 You can view the data by right clicking on the specific table and then clicking into of course we have 55 00:05:58,320 --> 00:06:00,930 not entered any data into anything as yet. 56 00:06:01,020 --> 00:06:03,120 So everything is empty. 57 00:06:03,120 --> 00:06:05,780 Thank you for tuning in and see you next year.