Computer Science 101 : Database Management Systems Academic & Interview Prep Course | Vignesh Sekar | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Computer Science 101 : Database Management Systems Academic & Interview Prep Course

teacher avatar Vignesh Sekar

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

13 Lessons (19m)
    • 1. About the course

      4:37
    • 2. Introduction

      10:18
    • 3. Data model and its types

      3:54
    • 4. Entity, Relationship and Attribute Explained

      11:16
    • 5. Database Designer's perspective

      4:13
    • 6. ER Model and Relational Model - Advantages and Disadvantages

      2:00
    • 7. Basic Idea of Attributes of relationship

      1:57
    • 8. Simple vs Composite Attributes, Single valued vs Multi-valued Attributes

      11:17
    • 9. Stored vs Derived Attributes

      4:13
    • 10. Complex Attributes

      2:23
    • 11. Degree of a relationship and Cardinality Ratio

      11:15
    • 12. Cardinality Ratio Explained with example

      5:53
    • 13. Types of Participation - Total vs Partial Participation

      9:12
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

98

Students

--

Projects

About This Class

Welcome to the course Database Management system from scratch !!!

Mastering the concepts of Database Management System is very important to get started with Computer Science because Database Management System is the program which is responsible for the ease with which we are able to fetch the data from the database and that is the backbone of internet today. The concepts which we are going to study is going to give a very good understanding of Database Management System and by the end of it you will be able to answer any interview question on Database Management System.

Without using Database Management Systems ,it is extremely difficult to communicate with the data in the server. Every server today has Database Management System installed in it. Through this course you will not only master the basics of Database Management Systems but also get ready for venturing into advanced concepts of Database Management Systems.

In this course ,every concept of Database Management System is taught in an easy-to-understand manner such that anybody without any prerequisites will be able to master the concepts of Database Management System in the easiest way.

Come and join me, I assure you that you will have the best learning experience of not just Database Management Systems but also the core of Computer Science in a different dimension.

Meet Your Teacher

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. About the course : and welcome everybody possible. Thank you so much for taking into my course on database management system. I'm Big Nation, and I will be the instructor for you throughout this course before seeing about the course . It's understand how important database management systems is. If you are a computer science student, then learning database management system is very, very helpful. First point is your God willing tohave in your academy course, which means this is the most important or not the most important subjects of computer sense . The second point is, if you go there, any product based company interviews like Google, Microsoft, Amazon there is a very high chance that you can get questions on database management system , so learning database management system is very helpful. If you're a computer science student, know how to learn the subject. Since the subject is important, it is very important for you to learn the subject from scratch. There are a lot of ways to bring. The first point, you might say, is really Xbox kind of Expo occurred, and by some researchers it is a good matter to read. Read the export. It is great, actually, but the problem here is the size of textbooks are very large these days. If you take any standard out there who has written this book on the subject, the size of the book will be more than 1000 pages. So leading page by page off the complete book is almost impossible, right? It is going to take a lot of time if you if you try to learn the subject by leading when the few points, which means we're reading only few pages off the textbook. It is a difficult for you to understand the complete subject. So there is a problem here, right? One thing is that you cannot read the complete text book because it is going to take a lot of time. Also, you cannot read only a few pages of the textbook because it is difficult for him. Contestant The subject. So that is the main motivation for me to create the course on database management system. No, there are a lot off course is about database management systems, right? If you take the Internet that a lot of forces support database management system know what's so special about this course, the first important point is this course assumes that you don't know anything. The whole database management system, everything will be thought from scratch. I assume that you don't know anything about computer sense anything about database management system. And I'm going to start from scratch, so there will not be any problem for you at all. Even if you're not a computer science major, you will still be able to understand the subject very clearly. So there will not be any such problem that you are not able to understand the subject. The second point is this course is highly impractical, which means I'm not going to take any slaves. I'm going to teach everything through the way book. So one thing is there you feel interested along the subject. Also, you don't feel like we're watching an online lecture. Rather, you feel like you are learning in a classroom, so this course is highly attractive. The point is, they are not going to deal just with theory. I'm even going to solve a lot off problems. I'm going to discuss a lot of problems throughout this coast. What's the reason behind it? If you learn one theory, that is a very high chance there. You can forget the concept in a few days, So that's the reason I'm taking a lot of problems. Solving lot off problems really strengthens your concept. It's such a better you will not be able to forget the subject in a quick, which means you'll be able to remember the subject for a long time. So that's the foundation of solid problems in parallel learning. Theory on that is what has been done toward this course of the last, but the most important. A quantitative discourses, the given a support I'm going to provide you toward this course. You see, every people cannot invest on every concept I'm going to teach. You might not be able to understand a few concepts, and that is natural with any online course you take or any in in person training you. So what I'm going to do is, if you're not able to understand in a particular concept, you can always email me between. You can always send a message through the unity messaging system are through the Q and A support. See, there are two ways of contacting the instructor. One thing is that you can contact me through the private messaging system, are you can contact me, throw the Q and therefore, any questions you asked any don't you forced will be immediately result, which means within a few hours you'll be able talk. You will be able to clear the air. So that is the biggest con trait of this course, having all said after enrolling for the coast. If you're not happy with the cost, you can always ask for a refund. But you may prevent you. We don't asking a question, but I'm very, very confident that you will be able to understand everything I teach you will have a great learning experience throughout this coast. So come and join me. I assure you were very good learning experience. You'll be able to understand the subject very well, Thank you. 2. Introduction: find before seeing that once concepts of database management system, Let's first understand some basic concepts. The first thing you need to understand this what do you mean by data? Any fact that can be recorded are stored is what we mean by data. There are various forms off data, right? It can be either. An audio file can be in video for X document. Image files are all these things we say the rest data, right? Because all these things can be stored are recorded. No. One question you might ask is where are we going to store the data, right? Any fact that can be recorded and stored is what we mean by Gator. And we have a lot of forms off data. No one, cause, you might ask is there are going to actually store the data. Most of the cases we'll be storing the data in the hard disk of a computer in the heart. Discuss some computer. Forget about these things. Silver plant and all this. Anything is fine engaged. If we store a collection off data in the hardest of some computer, then we can say this hardest acid database right, because it is having a collection of data, right? For example, I can I can store on the mark. I can stole the months off all the students off the newest E in the hardest off some computer. And I can say that this is the database of funding offer University, right? Is the database of university. So that is what we mean by database. Database is nothing but a collection off data. Now. What do we mean by database management system? Not understand that. Let's first understand how our internet actually works. Right, Howard, Internet actually works. See, the most important thing in the Internet is nothing whatsoever. And click right. We have claim on. So what do you mean, a claim? Yet a computer See both their computers. You need understand that first, either It is a client machine at a server machine. Both our computers. One we all onboard the computers will have devices like CPU ram an artist, right? Even the client will also have CPU. Ramen. Hardest. See, Glenn does nothing but the missions be using over the in our homes. Right. For example, laptop species, laptops, mobile, establish all these things begin. Say that it's claimed the reason we said these missions has claimed is because we're actually we're actually having the Klan program running on those missions, right? For example, the best example Off plane program. Our software is nothing but Google Group broza rate any brozi use for example, Google Chrome Safari, Firefox. All these are programs are Softwares, which are actually helping us in contact in the silver. I am requesting the silver for their pages. Right. So these things that the computer which has claimed program or software installing it, is what we mean by Clank, right? See, there are 22 things. My plan. We can mean two things. Either we can mean the Machinist claim because it is clams. After running in it are We can also say the program, which is this program, is the software like Google Chrome Firefox, but is helping us in contacting the server. We can say that this plane, right? Either we can use that we can say this program is playing are we can say this complete machinist claim, right? This is what the terminology which is being used these days right by claimed we can either mean the program are we can mean the mission. Same is the case, even for Soviet, right? Even for server, we say this machine as sober because it is having summer program insulting it. Right? What do you mean by summer program? It is again a software program which is, actually which is actually selling millions off plants all over the world. Right? Which is selling millions of claims. For example, Facebook's over Facebook. So what is a computer? It will help. It will have the racist like CPU ram and hard disk in all these things, right. What? What will happen here is that it was some program which will be installed in this computer . In this computer, some program will be instruct several program. See why installed We mean the data. The program will you presently in both heart this can tramp, right? So what brought out? Not this program will be in starting this computer. The main purpose of this program is nothing but selling millions of claims. For example, in Katie, let's assume this is my computer. Right? Are Assume this is some guy. Yes. Computer, right? No. Once this year, once this guy A opens a browser on types good at Facebook, dot com. This request will be sent to this Facebook server. Right. This records will be sent to the Facebook. So now the in Facebook's over Facebook's The solar program will understand that. Okay, this guy has asked for the script page. I might have to give the repairs to the property guy right now. What this program will have this program will have lines in orderto this program will have lines which will be helpful in responding to your particular claim. Right there. Millions off claim on different people will be asking for different data. Somebody will be asking for Facebook home base rate. Some people will be asking for some some folders in Facebook website. Right? So different people will be asking for different webpages. And it's up to the server program to give the property data to the appropriate plant. Right that this one will be presented them several program. Okay, let me take the website, which I'm having, right. Let let us assume there. I'm having a website and I have and I have visited that I'm going to host my website, which means I'm going to store all the files off my website in a particular server. Right? For that, I might have to pay some money, Right? For example, we have go to GoDaddy. Hosting are in motion hosting. We have side groom coasting, right? All these are services. All these are companies which are providing hosting services to clients. Now, let us assume I have decided that I'm going toe. I'm going to host all my files, all made websites and audio and video files in a particular server. Right on. That doesn't seem this over his presidency. San Francisco. Right? It is President San Francisco. Now what I'll be doing Yes, I will be storing the program are the reset that is back and program a silver program. What this program will do is they never Some guy, some person, some person tries to visit my website. This program will respond appropriately, right? According to the records made with the client, this program will do the appropriate with page to the client. Right? That is what server mission will do now. This program is actually used for responding. Fine, but all my data files, like, for example, I have uploaded GPS off file, right? I upload a video file or defending all these things. All these things will be present in the hard disk of this over X over computer. Right. This computer will have all the data. Fits all the data files off. Maybe upset now, in case if a particular person prays to ask for a video fail, for example, It is asking this video introduction to database management system, right? In case if some claim this risking requesting for this video what should actually happen is the property media has to be faced. This video has to be faced on that should be given to the solar program. Now, what this hour program will do is this program will give it to the black great. It will respond to the plant by giving the video for now, who will fix this video file? That is the question. Great for that. We use this program called US Database Management System. Right. This is also a program of software which is used toe either construct Manny Plate already. The data in the database, right. See this? This is this computer is having a hard this and it has on the data collection off data. So we say this heart discuss a Gator is now in order to either fits the data from the database. Are you having to do some modifications into the database? For example, Let us assume in my website you have created a profile, right? You have created a profile with the user name. Say, Sam. Right? But there is a famous, um, no. In case, if you're changing this name Sam to wrong, what will happen? This modification has to happen right now even for doing this. Modifications. Modification is what we mean by manipulation, Right? Even to do this manic elation, this this database management system program will be really helpful. Right? So either you are praying to fetch the data from the database. Are you a praying to do some modification to the state? Agrees are you are trying to add some data. The state I place between tryingto construct the database. This database management program is actually going toe going to be helpful. This is the main object, the off database management system. It is a programmer. Software which is used to construct Manu played on great new the data in the database. Right. Fine. So you should be very clear about what is And what is the difference between silver and data is management system. Solar program is actually used to respond to the client. Giving the proper webpage know this program cannot actually fit to the data in the database . For that, the use of separate program our software. We say the best database management system wanted Lewis. It will fetch the property data on giving the silver program so that this program will give the operator of the plant. That is what we mean by responding, right. The claim this requesting on the server is actually responding. This is how the Internet is actually working on. This is where we're going to use this database management system. Fine. No, let's see what this in my database systems. See, we say any fact that can be recorded that story is what we mean by data on the program. It is actually used to take three. The data from the database is what may be a database management system. Now, this data, along with the database management system court are together called US database systems. Right they want we mean by database system is the database management system core, which is nothing but the program along with the data which we have stored in the heart best . We collectively say this is a database systems. 3. Data model and its types: Let's see what is meant by data model. Data model is used to represent the structure of data in the database. You know what is meant by database, right? It is nothing but a collection of data. Now, we have a collection of data, fine. Now, how this data is actually structured, right? That is what is neat, that is what we mean by data model. There are two ways of structuring the data in the database. And they are nothing but e or modern and relational model. These are the two important models we are going to see in this course, right? See, this is what we mean by ER model, right? This is what we mean by year model, whereas this is what we mean by relational model. This is what we mean by relational model. What do we mean by relation is relation is also called as table, right? Relation is also called a stable. Similarly a role is also called as an icon. See our table is having lot of ROS rate each row. I can say that as a record. Similarly, it column is also called lest field. For example, Employee ID column can also be said as employee ID field. Similarly name field h field six feet. This table has, this table has four columns, right, for columns or four fields to what is, what is actually represented in this diagram. This diagram is actually representing how our data is actually present, right? What we're actually doing with the data. Here we have represented on the structure of our database in the form of tables. A table is also called this relation. And so we are saying this modulus, the relational model, right? We are representing our data in our database in the form of tables. That's what we mean by relational model. Rather than using tables in gaze it be simply used diagram like this, which means c. Each of this symbol actually has some separate meaning, right? We'll see that later. Just no, I'm giving an overview. What do we mean by this diagram? You'll see that later. One important point in it understand here is this method. And this method are meaning the same thing, right? Which means I can convert this form to this form as well as I can convert this form to this form. Most important point we need to understand here is this form has lot of details, right? We are actually describing each and every employee, right. A 100 hundred, one hundred two, and his name is around males ages 23. All these things. But here we are not giving all the details. We are just giving some basic idea, right? It is not having all the details, right? What is the name of employee? What does age? All these things we are not actually representing wildly. Here we, here we have represented only the basic details. Now, both has their own advantages. One thing is, this is actually used to give lots of details, right? It is giving extra information. But what this is actually, what is, what is the advantage of this model is this model is actually easy to understand for a knave percent, this model is actually u, is actually simple to understand for Navy uses, right? Once he sees this, he can understand that. Okay. An employee has Employee ID name agent six. Similarly, a department has a department as employee id department radiant department name, and how they are related, say all these things. We will see that in detail, right? Don't get confused right now. We are going to see wobbly. What do we mean by this diagram on this table? All these things. One thing I want you to understand is what they may be data model, widely-used ER model. Here model is actually used in order to represent what we are doing in the database in the form of diagram, right? What is the structure of our database in the form of diagram? That is the basic idea you need to understand. Once we see both these models, you'll be able to understand this lines very clearly, right? What you can do is you can write down these words in your notebook so that it will be helpful once we see all these things. 4. Entity, Relationship and Attribute Explained: Finally, let's see what does when my year model. In order to understand your model, you need to first understand what do we actually mean by an entity, right? C, entity relationship model. Here model means entity relationship model into d means objects which we see in our real world. That's what we mean by entity. In our database, we use lot of objects. And those objects we say there must entities. For example, see this, see this example. It will be more clear. Employee works for department. Employee works for department. Now how, how will we create a database for this? We will create a day take. We'll have you elaborate table for all the employees, right? We'll have all the will have employee table. And we will also have a department table. We will also have department table. And employee will have lot of columns like Employee ID, then employee age, then what is his six? All these things we will be having in the employee table, right? Similarly, we will also have department will have department will, will have department id, will have department name. Find all these things we will be having in the department table right now. These things like employee, department, we save it must entities, they are nothing but objects. For example, employee works for department. Here the objects are nothing but employee and department, right? And those we seem say The must entities, similarly, store and enrolled sparkles here student and cause. Both these things are objects, right? So we say the most entities. Similarly, Teton peaches, student here in detail, and students, both these are objects and all these ailments, entities, right? And one, and the second thing is relationship. Relationship is nothing but association between entities, which means what is the relationship? Important point is this is a relationship, it is not Relation. Don't get confused here. We have already seen relation means table, right? We already seen relation when stable, don't get confused. Both are completely different. There is no correlation here, right? Finally, a relationship is nothing but it is used to actually eat, is actually used to tell the relationship between two entities. For example, employee is an entity, department is an entity works for, is the relationship between both employee and department? It is the relationship between both the entities. Right? So we say the MST relationship works for is a relationship over here. Similarly, student enrolls four coast here in roles for is the relationship between the entities, student and course. Similarly, Hs here, each row here, etas is the relationship between entities Peter and student, teacher and Schroeder entities and teaches us the relationship between both these entities, right? See these things we actually represent in the form of diagram. This is actually relational model. We are going to see a more relational model a bit later. I'm not going to discuss about this. Just for your understanding, I have to take on this. But actually come into year diagram B represent all these things in the form of diagram. How we will actually represent this employee works for department is employee is an object, right? All the objects on all the entities will be represented using this diagram. Right here, using the square diagram. So we will write employing over here. This is going to indicate all the employees. Fine. And department is also an object, ranked department is also an object. So again, we will write a square, will rho square, and then we'll write department in say this. Why am I drawing a square? Because all the entities will be represented using the square in ER diagram, right? This is the terminal judges followed all over the world for ER diagrams. Now in order to represent but what is the relationship between both employee and department? The relationship between both department, employee department is nothing but works for, right? For that, we will use this diamond symbol in order to represent the relationship between two objects. We will use the diagonal dire diamond symbol rate. We can write walkscore over here. Now what we should be doing is we should be connecting both of them. What it actually means is employees, an object is an entity. Similarly, department is an entity or an object. Now the relationship between both these into these as nothing but works one, which means employee works for department, right? Employee works for department. Here student is an object, causes an object, right? So both has to be repressed. Both has to be written in the file inside the square. Fine. Student. Similarly course. Now what is the relationship between both the objects? It is nothing but enrolls quarks, Turiel interests for a course. So we will write, we'll use the diamond symbol and then inside we will write us enrolls four. So in those four is the relationship between both the, both the, both the entity, student and course, right? So such a mailing and also create a ER diagram for this teacher teaches for a student. Here teacher is an object, student is an object. So both has to be returned in the inside the square. And this teaches is, should be represented by a diamond symbol and both these objects should be joined using this relationship. Finally, so this is the basic, basic idea of ER model, right? Er model is actually used in order to rename data to represent the structure of our database in the form of a diagram like this, right? We also do have some other thing. Let's see what is meant by attribute. Attribute is nothing but it is used to, it is used to represent the properties of entities. Attributes are used in order to represent the properties of entities. See what is meant by entity. We have already seen what is meant by a treaty, right? All the objects here, Employee and Department are the objects, right? Employing our department or the objects. Now all know both these objects will have their own properties. See this, here. We have created the table writes the relational model. We're going to see it a bit later. I have just taken it now, understand this Fourier employee table. For employee table, we have created. The employee table is an object. So here we written inside the box. Similarly, here the name of the table is a department, and department table is an object. So we have department is an object. So we have written inside a box. So one thing you can understand from this is able names will always be objects, Right? Able names will always be objects. In relational model, we have two models. One thing is ER model under the relational model. Relational model. Able names will represent the objects, whereas in year diagram we will represent the same table name inside the square y. Because this table names will always represent the objects. And we know that in year diagram we should always represent objects in say, the square, right? Both these things will have relationship. So I have written it as works for now. How do I have, I have represented this works for relation in this table. We will see that a bit later. Again, no light, no in case if you see this, it'll be very confusing. We will see how we will link both these tables, right? Fine. But here coming to here, we will link both this objects using the relationship and relationship will be represented using that time and symbol. Fine, now, see this. An employee, an employee object has three properties, right? And employee has Employee ID, an employee has an age, as well as an employee when belonged to S6, right? All these things are actually representing the properties of the object employee. What we will do is we will draw a circuit are oval shape. Here we have three attributes, right? Or three properties of the employee entity, employee object. So we will write as the employee employee ID, EID, and age. And six, right. Similarly, department table has department id and department name to properties like now this entity will also have properties. These properties are nothing but the column, the columns, column names which are in the table. This column names are nothing but department id and department name, right? So both these, I'm going to write it here. Department id, department id and department name. Alright, so this is our year diagram. This is our year diagram, which is actually going to represent the database. Now what is database actually having? This is actually holding the details of employee and his department, the department he belongs to, right? Finally, now we are representing this database in two forms. One thing is using diagram, another way is using table, right? Don't get confused about tables. We are going to see relational model very well. Ok, we are, it is very, very important. We will see once I, once year diagram is complete, we will start with the relational model. We will also see how to convert an ER diagram into relational model, as well as we will see how to convert an, a converted relational model into your diagram. So here model will have three important points. They are nothing but entity, relationship and I attributes all the objects which we use in our database. We say the entities and we represent using this square dx bar diagram. All the introductory you'll represent using square. Similarly, there will be a relationship between two or more entities, right? Here, we have a relationship between two entities. We can also represent a relationship between three and reduce. We'll see that later. Now what you don't understand this, this relationship is actually going to indicate the association between entities, right? It is indicating associate, association between entities. Similarly, attributes are nothing but properties of entities in an entity will definitely how property, for example, an employee has properties like employees, employee ID, employee age, employee Six, employee name or whatever you want, you can include it, right? Similarly, a department has its own properties like department id, department name, all these things. And we represent this properties in the form of circles. And we say the mass attributes, right? We say with attributes in case if you want to represent attributes in table will represent using columns, right? So coming to relational model, let's have an overview voted will seem detail later. What I want is actually happening is all the entities we're actually representing using table name, right? Employee, department, these are table names. Table names are actually indicating the entities. Similarly, a table will have lot of column names and column names are actually representing attributes, attributes or properties of entities, right? All the column names are actually representing the attributes. Similarly, how will represent the relationship in table? We'll see that later, right? For that, we might have to link both the tables. We will see that a bit later. 5. Database Designer's perspective: So let's see. This student enrolls for cause he'll student and course or objects or entities. So we have represented using squares fine. And the relationship between both these entities is nothing but N girls far-right student enrolls for course. So we have represented this using the diamond symbol. Fine. Now how would we represent the attributes C coming to attributes? What attribute student has depends on the implementation, right? It really depends on the database designer C. In case if I'm designing a database for college, it's up to me to decide what are the properties a student should have, right? I can have student name, right? I can have student name. I can have is age. I can have is six. I can have I can have his address. I can have is four numbers. All of these things, it really depends on the database designer engaged if I feel that in case environment designer who is designing a database for a college, for a school. In case if I decide that I don't need this age field, I can remove it. Right? In case if incase, if I decide like that I can remove this. It really depends on the implementation, right? One thing you need to understand is these names are just random, right? It really depended changes depending on the implementation. Here we are actually representing the database of us students. We're actually representing the database of a student. What we are doing today is we are going to indicate all the personal details of a student, like student name, age, and sex. Also, we are going to indicate the courses which are available and what which caused the student actually intervals. That is what we are going to indicate using this relationship, right? We are indicating all the student details. We're also indicating all the course details, which means what are the courses, what is the idea of the coast? All these things. And we're going to, we're going to include a relationship between both objects which is nothing but enrolls for. So this is an ER diagram which is actually indicating the database of students. Database suffers website like Udemy, Udemy Lao, its own database side. It can it can have a database. We'll have a database similar to this. It will have all the students, it will have all the courses which are available. Also, it will establish a relationship between both the entities, right? It is nothing but enrolls for student enrolls per a coarse, fine, same thing. You know that we can also, we can also draw in the form of table, right? How we'll convert this to table? It is simple, student is an entity. We know that entity in table will be table name, right? So students similarly causes an entity. So it should be at another table name. Since we have two entities or here, here we will have two tables, exactly right? These are the ten, these are the table names of both the tables, fine. Now first eternal will have three properties like three attributes or properties. They are pseudonym. Agent six here will indicate it in terms of column names, right? It is nothing but student name, age, and sex, right? Similarly, we can convert this into table, which is nothing bird course id and caused him. So this is the relational model of our database, which means we are representing the database in the form of tables. And this is the ER, model of a database. So you understood it right? Similarly, we can also convert this into ER diagram. How we will create, will create a square for teacher. Similarly will create a score for students. We will establish a relation between both this NTDs using their teachers relation. We can also have properties for a teacher, like each name, each are IID, each phone number, all these details. Similarly, we can have attributes for the student table, right? Our student entity. What are the, what are the properties? It is nothing but student name. Student age, shouldn't six, then what else? We can have whatever properties we want, right? It really depends on implementation. So this is how we can represent that structure for database in the form of diagram, right? Finally. 6. ER Model and Relational Model - Advantages and Disadvantages: See the difference between ER model and relational model is very simple, right? Coming to year model, we have only few, few details, right? Few details of her database. We are not going to have what is the name of a student? What does he see h, All these things we are not going to have, but coming to relational model will have all the details, right? For example, it is SAM, Bob, ages 50, ages 256 is made. It is mail, whatever it is, you can fill it out. So that is the advantage with a relational model. It will have lot of details. But the advantage of the year model is it is very easy to understand for name persons. For example, assume that I am a developer who is developed row is designing a database for a, for a college. Alright, I'm going to design a database for a college. Now in, if, in case if I go to the college correspondent or principle and get the details about the database, I can use this model rather than this model, right? Why? Because this will have thousands of records are ten, hundreds of thousands of rows. Rows or records both are same. It will help thousands of rows. I don't want to take all the tables and show you to the appropriate nave person, which is nothing but the school correspondent, right? But coming to this, it will be very easy to understand rather than taking this complete table nail person, what I can do is I can take this model and tell them that this is how the all your database will look like. Which means you will have an Student table, but you'll have 3s, three columns like Schroeder name, age and sex. Similarly, you will have a Course table and cos table will have course id in course name. And both these tables will be related using entrails file, right? I can simply take this diagram and explain it to a nail percent very easily rather than using a table, right? Find no how this erosion the has a relationship is achieved in the table. Again, we will see that a bit later. 7. Basic Idea of Attributes of relationship: Now let's see this. Attributes means properties, often entity or relationship. C, We have seen attributes as properties of entities, right? We have seen pro, attributes as properties of entities. We have not seen, what do we really mean by properties of a relationship, right? We can even have properties of relationship, which means we can have attributes even for relationship. For example, employee works for department, we can have an attribute like shifted timing. The shift timing, which means C and employees working for a department, let us assume the name of the employee's salary. Right. And he's working for a department, say let us assume a combs. He's working in our constant apartment. Now, we can have some relay. We can have some attribute for both for this relationship saying that we can have the shift timing for this employee. For example, Sam works for accounts department from nine AM to six PM, right? Nine AM to six PM. Similarly, we can have an employee say Bob, he's working in say, management department. Management department. And he's timing is from seven PM. His multimeter from 07:00 PM to 2m. So the shoot timing is an attribute of this relationship. Works for write, an employee works for department. Employee can have attributes like this. Department can have attributes like this. Similarly, even of a relationship works for care also have attributes something like shift timing. Any Wait, let's see about this a bit later, which means, let's see about the attributes of relationship a bit later. As of now, we are going to focus on attributes of entities, right? 8. Simple vs Composite Attributes, Single valued vs Multi-valued Attributes: Finally, let's see the classification of attributes C. This, we can classify attributes, attributes into two types. Namely simple attributes are complex, composite attributes, right? Simple attributes and composite attributes. Now what do we really mean by this is the what, what do you mean by attributes? Attributes are nothing but properties of an entity, right? For example, if your employee is an entity and he can have attributes, lake names, right? These are the possible attributes of an entity in employee and gt, fine. Now what do you mean by simple attributes is it cannot be divided further. Let us come in composite attributes. They can't be divided further. What do we mean by this is c here. It is a simple attribute because our database designer, which means the person who is designing of a database, has programmed in such a way that this name attribute, this name attribute can have, this name attribute cannot be divided further, right? Whereas incase, if I, if I can divide this attribute into two types, for example, in case if the designer has designed in such a way that name can be further divided us first name, middle name, and last name. What has actually happened here is this attribute name. This attribute name has been divided into 3333 subnets, right? This attribute name has been divided into three sub names. So from this we can say that this is a composite attribute because this attribute can be divided further, right? So it really depends on implementation. The name attribute can be either implemented as a simple attribute as well as it can be implemented as a composite attribute in case if a, if a year is nice things like first name, middle name, and last name, then I can say that this name, this name attribute is a simple attribute because it is not, it cannot be degraded. Whereas in case if a delayed his name as firstName, middle name, and last name, then I can say that it is a composite attribute because of an attribute can be divided further, right? Finally, know how are we going to represent this in ER diagram. C here. Since name is here, since name is a simple attribute we have represented in year model like this, right? Whereas in case if the name attribute is implemented as a composite attribute by the database designer. Now what are you going to do? Farber, we have separate representation. For example, in case it this name attribute can be divided further as first name, middle name, and last name. How we will represent in year diagram is very simple. See this, this name can be further classified as firstName. And with just a, I am writing in short as your fan, right? It means firstname. Also, it can be classified as middle name and last name, right? So this is the rate to represent composite attributes in ER diagram, right? See, employee is an entity, name is an attribute of this entity, and this name can be implemented as a composite attribute. And soil can be divided further into three sub names, right? And this is how I will be representing the composite attribute. Right, fine. So an attribute name can be either implemented as a simple attribute as well as it can be implemented as a composite attribute. It really depends on the database designer, right? He can prefer either of those. It really depends on how he wants the database to look like. Great. Final know another classification and single-valued attributes and multivalued attributes. What it means is one lean, one value of aggregate is possible for an entity. In case, if that is the case, then we can say that it is a single-valued attributes, right? Whereas in case if more than one value of attribute is possible for an entity, then we can say that it deserved multi-valued adequacy. What do you really mean by this is, see this. Let us assume we are having Age attribute for this employee table, right? Which means they have an age attribute for this employee entity. Now, this person can have only one leach, right? He cannot have more than one H, right? Whereas if you take phone number, a person can have more than one phone number, right? So phone number attribute for an employee entity will always be implemented as a multi-valued editor would see obviously, we can still implement this phone number field as a single-valued attributes saying that a person can have only one phone number which kiki can enter in a database, right? For example, in case if I'm designing a database for a bank, what I can say is, yes, a user or a customer can have only one phone number. He cannot have more than one phone number. But this is really meaningless, right? Nobody will do that. What people want is they want to get as what, what people want is they want to get as many details as possible from the customer, right? It is, it is meaningless. So what we generally do is though phone number can be implemented as a single-valued attribute. In most of the implementations we will be implementing for number as a multi-valued attribute series. Here, let us assume an employer, employee. We also have something called us for number, right? We also have something called US phone number. Now this phone number I attribute can have more than one value right? Now how can we enter two phone numbers in this? For example, let us assume the name of the employees, Bob and his agency, that D5 and D6 is male. Now how can we have two phone numbers? Let us assume this phone number field has been implemented as a multi-valued attribute, right? Which means we can, he can have more unemployed, can have more than one phone number. Now how we will write this? We will write the first phone number. Let us assume it is something like 2-6, W3, I3, followed by, we will replace a comma over here. And then we look to the second phone number, 5-6, 3.1.2, right? I'm just taking some random number, right? It doesn't really make any sense. What I want to tell you is in case if an if one number is implemented as a multi-valued attribute, which means this phone number can have more than one value of attribute for a particular entity, right? This phone number attribute is having more than one value of attribute for this Bob entity, right? So this is clearly a multi-valued attribute where as incase, if I implement this phone number as saying that And this phone number attribute can have only one value for this, for this employee, for this name entity, then I can say that it is a single-valued attribute, right? It really depends on how the designer has implemented the database, whether he's allowing more than one value of attributes for an employee, for an entity, RVs allowing organ hard, he's allowing only one value of attribute for this entity, right? Depending on that, we can classify attributes as single-valued attributes and multivalued attributes. The best example for a single-valued attribute is age attribute C. Yeah, person cannot have two ages, right? Yep. You cannot say that a person is 35 years old and a 45 years old. That is meaningless, right? A person can have only one value of h. So we say that it is a single-valued attribute. Now you might ask me, can we implement this age attribute as multivariate attribute? Definitely we can implement it, right? It really depends on the database designer, but still it is meaningless. And in most of the cases are in all, almost all the cases we will be implementing Age attribute as a single-valued attribute. The reason being a person cannot have more than one niche. But as phone number field will mostly be implemented as a multi-valued attributes because a person can have more than one phone number. So you don't get confused between both these things. Simple and a composite attribute is different from single-celled categorization, multi-valued attributes, what is Simple Agreement and composite attributes incase, if this attribute can be further divided, for example, first name, middle name, and last name, then I can say that does composite attribute in case if the attribute cannot be divided further, then I can say that it is a simple attribute. Whereas in case if an attribute can have more than one value for a particular entity, for example, this phone number attribute can have more than one value for this particular entity name, then I can say that it is a multi-valued attribute incase, if an attribute cannot have more than one value for a particular entity, then we can say that it is a single-valued attribute. Both are completely different. Now one question you might ask is canon, canon attribute B, both assessing simple attribute and single-valued attribute, it is definitely possible rate also, and I attribute can be simple attribute and multivalued attribute. An attribute can be composite attribute and single vendor to all these, all these things are possible. All these combinations are possible. One such example is, can I delete an example for simple attribute as well as it is a single-valued attribute. Yes. For example, young age at age, age attribute is definitely a single-valued attribute as well as a simple attribute, right? Why? Because we can have one new one-year age via a person cannot have more than one neat. So definitely it is a single-valued attribute. Also, it is a simple aggregate. You cannot divide this age attribute into 222 sub names, right? It is not possible. So the mostly, we will be mostly having Yager attribute as a simple attribute as well as a single-valued attribute C, Obviously we can have an attribute which is, which is a single-valued attribute as well as a composite attribute. One simple example for this is let us assume then name attribute itself may attribute is a composite attribute because it can be divided further as firstName, lastName. Also, we can implement this name attribute as a single-valued attribute. What they mean by it is your person can have only one name, right? See obviously will be having something called S LES name, right? In case if I implement the name as c, one thing you need to understand from this is this name attribute can be implemented as a composite attribute and multivalued attributes, which means I can say that I will be having firstname, middle lemon, lastName, which means our main can be dividend as firstName and limit lastname. As well as I can also say that a person can have more than one name, right? For example, he can write as Bob gammas, and these are the two names for a single person, right? It is still possible. Also I can implement this name attribute as composite attribute and single-valued attribute. How? One thing is this name can be further dividends, firstname, middle name, and last name. So definitely it is a composite attribute. Also, I can implement this name as single ready writer to how I can say that in the database, the database designer can say that a person can have interval only one name in the database. You cannot have more than one name, right? So far they want to tell you is an attribute can be combination of all these things, right? It really depends on the implementation. Fine. 9. Stored vs Derived Attributes: Let's see this. Any attribute can be classified as either store the attribute are derived attribute. Now what do we mean by this is, see this. We have an employee entity. We have an employee entity. And it has three attributes named, name, data, year of birth, where you will be means year of birth. For example, the year in which a particular entity is born at. For example, Bob is Bob. Bob is born at the year 1992, Perez, Alice is born in the year 2 thousand, right? Fine. Also employees having an attribute named as age, right? Employees having attributes like name, year of birth, and age. This is relational model representation and this is ER model representation. Finally, now here, one thing you can observe is this age can be calculated using this year afterwards, right? How you edge is nothing but the current year. For example, in case if the year is 2018 right now, from this current year in care CP subract the year of whether it is not date of birth. Year of birth. In case if I subtract this current year, we're in gears. If I subtract this year of birth from current year, then I will be getting the age of a particular entity, right? For example, see this. I can calculate the age of Bob by subtracting 2008, by subtracting 1992 from 2080, right? In case if you assume that this year is 2080, right? Similarly, we can calculate the age of Alice by subtracting 2 thousand from 2018, right? This is how we can calculate all these values of all the entities, right? So from this we can say that this h is a derived attribute, which is a data. You sum this TO that reviewed year of birth, right? See, we are storing the values of year off, but right, it is up to us. We need to enter the values of all the employees, all the employees year of books. But this gauge, this coming into this year eight, we'd need not store these values. Rather, our database developers should have written the program or code in such a way that in case if you have entered this year up Birth of a program or code, this line of code will actually degrade the value of h from this year off. But for all the entities, right? For all these entities, that all the values of h will be derived from this toe that attribute year up, but using the formula, right, which will be present in our code, finite. So this is the difference between stored that attributed derived attribute. We can store the values of this attribute as we can derive the values of this attribute from some stored attribute, right? Even this name, this is told that attribute, right? Bob, Alice, and Sam. All these are, we're actually storing these values, whereas this is a derived attribute because it is derived from Iraq but finite. So one thing you need to understand is and I attribute, and I attribute can be a simple library view as well as it can be a single-valued attribute, as well as it can be a stored attribute. So aggregate can be composites, single-valued, and derailed art can be composite, multivaried and store any combination is still possible, right? That's what I want you to understand. What's one simple example I can tell you is, for example, see this, this age I attribute is definitely a simple attribute, right? Why? Because this attribute is not divided into two parts, right? It is not having any sub names. For example, first-stage, last H, that thing is percent like that. So it is definitely a simple attribute. Also, this age is actually also a single-valued attribute, right? Why? Because we can have only one each for a particular person. A person cannot hire, an employee cannot have more than one reach rate. So definitely it is a single-valued attribute. Also. Also, it is a multi attribute, right? Because we're actually delaying this values from year of birth. So here our attribute e h is a simple attribute, as well as it is a single-valued attribute as well as implicit data attribute, right? In such a way, and I attribute can belong to any of these three, right? Agree, every combination is possible. Fine. 10. Complex Attributes: Let's see this complex attribute and I attribute, which is both composite and multi value, is what we mean by complex attribute c. We have seen already, what do you mean by composite attribute, right? What do we make composite attribute in case if we can debate that attribute into sub names, we can say that that attribute is composite attribute. Whereas in case if an attribute or an attribute can have more than one value foreign entity, we can say that attribute as multivalued attribute right? Now even case if an attribute is both composite and multi value, then we can say such an attribute as that complex attribute. All right, anyway, let's see this example. Let us assume our employee is an entity. It has three attributes, name, name, age, and address. Right? Now this address, address attribute can be implemented as the car complex attribute, right? Which means this address attribute can be implemented as both composite and multi-valued. How? For example, in case if the database designer as a decided that and an employee, an employee can have more than one address, right? That is definitely possible. Why? Because a person can have more than one home, right? A person can now two homes in two different addresses. In that case, this address attribute will become a multi-valued attribute, right? It is a multi-valued attribute. Also, this address attribute can be composted attribute Fen Si, this address attribute can be classified as though number, street number, and PIN code, right? It can be classified as door number, street number, and PIN code, right? Pin code. So this attribute can be further divided into sub names, right? So definitely this address attribute is a composite attribute in case if the address attribute is implemented in this way, right? So since this address attribute is implemented as composite and multi value, we can also say this address attribute as complex attribute, right? So an attribute which is both composite and multivalued is what we mean by complex attribute. Again, whether we want implement an Andrew attribute as complex attribute or not, really depends on the database designer. Frame. 11. Degree of a relationship and Cardinality Ratio: Fine. Now let see relationship in detail, right? So far we have seen what is meant by relationship. Anyway, let us see some properties of this so that you'll be able to understand it better. A relationship is nothing but association between entities, right? We have already seen it, for example, works for is a relationship which is between two entities named Employee and Department. Alright, we have already seen this. Now, what do we mean by degree of a relationship is number of entities participating in a relationship is what we mean by degree of a relationship. For example, this, the degree of this workspace relationship is nothing but two because two-way entities are participating in this relation, right? So degree of relationship coming to this ER, model for this works, for relation is nothing but two, right? Fine. Now we have one more thing called us, cardinality ratio, right? Cardinality ratio. It is, it is actually a cardinality ratio is defined between entities of their relationship. For example, see this here works for our relationship, has to ADD is named Employee and Department. We can calculate the cardinality ratio between these two entities, right? Our cardinality ratio for this relationship works, but right now let's compute how, let's see how we can do this for a, in order to understand that, you need to understand this requirement analysis c, Let us assume I'm a person who is trying to design a database for a school right now what I have done is I have been to the correspondent of a school and I have asked for antivirus for how the database should look like, right? And they're giving me some instruction saying that our school database should look like this. So you please design it accordingly, right? That is what they have told it to me. For that, they will do some conditions, right? This database should look like this, and that is what I have written. And I'm saying this as requirement analysis. We are actually analyzing the requirements software database, right? That is what we mean by requirement analysis. What they have told days, which means the school the school correspondence have told is an employee. Let us assume it is it is a database for a company, right? I'm going to the owners of the company and I'm asking for how the database should look like. And they are saying that an employee can work for at most one department. You take care of this condition, right? See this, we have employee and department and they are saying that an employee can work at most one department, right? Final, let's see how to compute the cardinality ratio for this works for relationship which says hacker occurring between two NTDs named Employee and Department. See computing the, computing the cardinal de ratio is very simple. Write the simple thing. What you can do is here the employee is an entity, right? Employee is an entity. So it will have lot of rose, Right? If you, if you consider the relational model, it will have lot of ROS, the name of the table will be employee and it will have lot of rows. Yes, obviously it will have lot of columns. That's not important here, but definitely we will be having lot of rows. What does it mean? There will be lot of, lot of employees who would be working in this company, right? So what I'm going to do is I'm going to take all of them in a particular set, right? See, you know, what does when based sets in mathematics, right? For example, in case if I do yj equal to one to three, it means that a is a set which is having three elements named 123, right? The same is what I'm going to do here. I'm going to make all the rows of this table in a set, right? Anyway, you will see a loop this relations are, and what does the code is? The connectivity between Discrete Mathematics and database. You'd see a bit later. But what I want you to understand this, I want to see all the rows of this table. Single elements of a set, right? Employee is a set. Employees a set which is having, which is having 123455 rows, right? Which mean it is as good as say, see here, Yj is a set which has three elements. Similarly, him saying that employees a table or a set which has five rows are five elements, right? Finite. So what I have done is I have written all these five elements, say, say a, b, c, d, and e, right? What I'm doing is I'm naming this, this employees here, this employee's B, this implies c, this implies d, a, this implies e, right? See this table is having, let us assume this is employee name. Right? Now what I have done is I have written all the employees. Also, what I'm going to do is I'm going to see department is an entity, right? So we will also have a table for department. And let us assume department is having say three there are three departments in the company. Right? And then naming the mess D1, D2, and D3. Right? So again, this, since this is also a set, again, this department is also your set which will have three elements, right? So I'm going to write this as d1, d2, D3, right? C also you can have five departments, no issues. It'll be, you'll not be confusing, right? Since we have taken phi u implies or here, I'm taking five departments over here, right? So it is D1, D2, D3, D4, and D5. Such as for understanding and taking these names, right? What the simple thing, what you can do is you can take names of all the employees, say Bob, Alice, Sam, and does and all of these names you can take, right? Similarly for department, you can take Management Department, our accounts department, our finance department. You can take all these names, right? Just for simplicity and digging, ABCD and D1, D2, D3, D4, and D5. Now what condition they have seen? See this? An employee can vote for at most one department. What it means is you can work for either D1, D2, D3 are default r d phi. But he cannot work for two department. This is not allowed, right? So yay cannot work for more than one department. So the maximum number of departments and employee can work for is one, right? The maximum number of departments and employee can work for is one. And so I'm going to write a one over here, right? Which means an employee can have at most one department. Write, an employee can have at most one department in a similarity, I want you to understand how many employees cannot department have? Right? How many employees can a department have? I might have to write it over here. C, they have not given any constraint on how many, how many implies a department can have, right? Which means I can assume that I can have 0 d, 0 employees. A department can have 0 employee, one employee to employee. I will we can have any number of employees as possible. That is what will be my assumption. Why? Because they have not given any condition that a department can have at most one employee to employee or anything like that. Right. But they have clearly mentioned that an employee can work for at most one department. So I have taken that an employee can have at most one department. So I have written a one over here, but we don't have any constraint on how many employees should a department have, right? So you can have any number of implies a department can have any number of employees. For example, D2. D2 can be connected. For example, d1 can be connected like this, which means a's and employees working for department d1 also bes an employee who is working for department B1, right? That is still possible. So obviously what is happening here is D1 is an entity which is having two elements, right? Which means a department can have more than one employee, right? It department can have more than one employee. So I'm going to write this as Yen. What do you mean by n? You did it need not be and you can take yum ba or whatever you want. What I really want to tell you here is I can have a department can have more than one employee, right? I get Department can have Yen employees. So the cardinality ratio of employee and department is Yan S21. Alright, that is what is the cardinality ratio? So this is how we should be calculating the cardinality ratio. It is simple ratio of maximum number of relationships and entity can participate in. For example, coming to apply in NumPy or an employee. An employee can have at most one department. So I have written one over here where as yet department can have any number of employees. So I have written general here. So cardinality ratio of Employee and Department is n is to one. Write finite C. We can also say this as cardinality ratio of department and employees. One is 2n, right? Which means cardinality ratio of Employee and Department. This one is two, is one is to one, whereas Cardinal de ratio of department and the employee is one miscreant. Okay, don't get confused here. So what do you mean by cardinality o to compute the cardinality ratio, it is very simple. Let us assume we have two entities named Employee and Department. First thing what I will do is I will assume that all the employees as a sick right? Employee is a set which has all the employee names as it's the element, right? Employee is a set which will have all the rows as its elements. Also will assume that department is a set which has all its departments are all its rows of this table as elements of this set right now. And then I will assume that, and then I will analyze that how many departments and employee can have, right? How about this? The maximum number of departments and employee can have. Here it is one. An employee can have at most one department. So I have written here. Then I will analyze how many employees can help can work for a department at max, right? How many employees can work for a department at maximum? And it is clearly and because no condition has been given over here. So this is how I have calibrated this. And I can tell that the cardinality ratio of employee and department is yen is two. What are I can also say that the cardinality ratios, department and employees one is 2n, right? Fine. So this is what we mean by cardinality ratios. The degree of a relationship here is two, because works for only two entities participating in the relation. Fine. Relationship C, they don't get confused between the relation and relationship, right? Both are completely different. This is completely different from this relationship. By relationship, I mean this one, right? By relation, we simply say egoless relation in database, right? We say a table as a relation, w confused here we're speaking a good relationship, right? For simplicity, just not to confuse this relation with relationships and using able instead of relation, right? Either I use the term Terry per table, our relation both are same, right? Fine. 12. Cardinality Ratio Explained with example: Let's see this example. Here. Student and course or two entities and enroll spar is a relationship between both these entities, right? Which means we are having set off all the students, right? Also we are having set up all the courses. You can even assume the Udemy website, right? In Udemy website we have a lot of students are now also, we have a lot of courses. Right now what I'm going to do is for the student, I will definitely have a table, right? I would definitely have a table pair. I will be having all the student names, right? I'd be having student number 123. All the names also will be having all the courses rate. Again, it will have, I will have a table in which I'll be having all the course names written one by one, right? All of them will be present in a single row. So what I have already told is we need to think of a table as a set rate, which means in case if I have five rows in a table, then a sec, we'll have five elements, right? So I have created a set for the student table as well as I am created this, created the CIT correspond this course table, right? So what I want you to think is all the rows I want you to do as, I want you to assume Laker, the element of a sit, write the name of the table is the name of the set and the SEC will heavy elements and these elements, I'm assuming then as the rows of a table, right? Finally, now that they are given the requirement analysis, right? This is not a requirement analysis. Find they have given the requirement analysis and they're told that student can enroll for any number of courses and a course I can have any number of students, right? That's what they're told. This is the condition they have given to their database designer? No. How can we compute the cardinality ratio c? We know the degree of a degree of relationship is to write because to NTDs are participating in this intervals for relation, relationship. So degree of this relationship is true. Now what about the cardinality ratio? It is very simple. How many causes a student can have at maximum, right? How many courses is Turin can have at maximum? It can have any number of courses radios, or it can have any number of courses. Let us assume that the number of courses I can I have is nothing but yeah, right? Which means that our total of young courses are, I can also say that this set has yummy elements, right? Or I can also assume that this course table has exactly yummy gross, right? In that case, here, we will get the Yammer, right, because a student can have at most young courses, right? Your student can have at maximum mafia AM courses. That is, how many students can be present in a single course are a cause can have how many students? Again, it can have any number of students, right? That is what they have given a course can have any number of students. Now, I'm assuming that there are a total of n students and there are a total of ten students, which means yen elements are present in this set. Students set R Yen rose are present in the student table, right? Why? Because in very low, I'm assuming that as an element of a set, right? Fine. So there are a total of young students. So yet cause can be ended by at maximum of yen students write a cause can be enrolled at maximum of n students. Why? Because if there are total of yen students, let us assume if you are to be as widely and students, then obviously yet cores can be enrolled way a maximum of yen students, right? It cannot have more than that. So see, we are seeing the maximum number, which means his student can have at maximum courses, whereas the course can be enrolled by at max end students, right? Where we are assuming that there are a total of young girl says, and there are a total of yens tourists. So from this we can see, say that cardinality ratio is nothing but cardinal racial student and COGS is nothing but n is two young, right? Cardinality ratios, student and goals is nothing but n is two. You see this? Yum, yum, we have just assumed iterate c in case if you take boldness yen it, it is giving a different meaning. Why saying that the number of students and the number of courses is equal, right? But that is not the case. They have not given the requirement analysis phase or anything, right? The number of courses should be equal to the number of students. Helps me. We'll assume that there are a total of young girl says, whereas there are a total of n students write, bold should be different in case if I do both, when case for Q, same name to both, which means engaged. If we assume that there are young students and M courses, it is as same as saying that number of students is equal to the number of courses, right? But that is not the case. Nothing has been given like this. Just to differentiate both, which means just to differentiate the number of students or number of courses. I have taken different names, different numbers, right? Which means I have assumed that there are a total of ten students and there are a total of ym courses and gardener durational student and causes nothing but yeah. And Mr. Young, as per this requirement analysis, right? In case they have given differently, this will change, right? In case they have given bed and he has student can enroll for at max one cause what'll happen? I will put a one over here, right? In that case, the cardinality ratios, student and goals is nothing but the admins to one, right? So it really varies depending on the requirement analysis. Fine, so this is all we need to compute, the cardinality ratio. It is very simple. How many courses a student can have. You put it here, right? Then assume, analyze homely extraordinary students. They cause can have, then place it over here. And gardener, the ratio is nothing but this is two, this plus 200 is two calls. Fine. 13. Types of Participation - Total vs Partial Participation: Let's see this participation, our existence. It is based on minimum number of relationships and entity can participate in. Now what do you mean by this is, let us assume we have an employee entity and a department entity, and they both participate in a relationship called us work spot, right? See, one more important point is the employee will have its own attributes like Employee ID, employee name, age, and all these things. I am not showing it here. And department will have its own attributes like department id, department number, and all these things, right, again, I'm not showing it here. Now what I have done is I have written all the employees enough in the form of a sit. Right. We have already seen what what do we have? We have already seen that every employee, every row of the table will denote a set, an element in this set, right? See for example, this is the name of them, able, namely employee, right? And name of this table is nothing but Department, right? Name of this table is department. And we have already seen that every row, every row will denote any element in this set. We are assuming that this employee is a set and it has these many elements, right? Every row is an element. So employees, so instead of reading the complete row I have just written would lead this attribute rate, Sam, bach, Alice, Jakob, SAM, Bob, Alice and Jakob. In case if you want, you can write the complete row, right? But that is confusing, so I am not writing it here. Finally. And similarly for department, it has three rows named icons, finance and management. Again, I'm assuming that every row is an element in the set and then naming the setters department, because the name of the table is department, fine. And it has three elements named icons, finance and management, right? I constant on some management C. Now one important point I want you to assume here is once we look into this table, once we look into this table, we will be able to clearly say that which employee belongs to which department, right? Cr SF. No, we don't have any information. Right. This is a separate table and this is separate treble, but still on seeing something which we have not seen. We will see that later on seeing something, you should be able to say that, OK, Sam belongs to R cons department. Bob belongs to finance department. Our bow belongs to a cons department. Alice belongs to management department, our finance department, or a constant button, it can be anything, right? But one thing is for sure, you will be able to say clearly which department and employee should belongs to. C, one more important point is an employee might not even belong to a department, right? That is still possible that c v will be doing something called this linking of both these tables. We will see that later in case if I say that now, it will confuse you a lot. So I'm not saying it now. As of now, you think that there is some wade through which you will be able to understand that which department and employee belongs to. Finally, now it is very clear for us that which department and employee belongs to right? Now, what you should be seeing is the incase. If incase, if every department has at least one employee working, working for them, then we can say that this department is participating in total participation of this entity department to this relationship works but is totally right in case if every department has at least one employee working for it, for example, icons to Batman as Sam, finance department has Bob and Alice, Management Department has Jakob, right in case. That is the case. Then all these three departments has at least one employee working for it, right? So we can clearly say that the participation of this entity and department in this relation works for is total, right? So that the total participation will always be indicated using double lines, right? In case if a z, let us assume nothing is given, like nothing is given over here. They have given this diagram, right? Employee works for department and they are told they have denoted this has double n, this has single leg. What it means is you every department should have at least one employee working for him because it is being indicated by w line. It means that the participation of this entity department and this relationship works for is taught at r. I can also say that every department should have at least one employee working for him. See, let us assume a goals department doesn't have even a single employee working for him, right? Let us assume SAM, Bob salmon Baba working for a finance department, Allison Jacobin infant management department, or how will you come to know that? I already told it right. We will see that later. How will we will come to know which employee belongs to which department? That is fine. But as of now, assume that engages salmon baba, baba working for finance and Alice and jacket, but working for management, then it is very clear that we don't have even a single employee working for accounts, right? According to the accounts department doesn't have even a single employee working for him. So from so in case, if this is the case, then we cannot denote this by double lengths. Why? Because it is not total participation, right? We also say that as partial participation in case if every department has at least one employee working for him, then we say that this department entity is in total participation, works for yells, Which means we incase if you are able to find one department which doesn't have even a single employee working for him, then we can say that the participation of this department entity on this bookstore relationship is just part shared. It is not taught at right, that is important. So here they have indicated using double lengths, it means that it is very clear that the participation of this entity in this relationship is totally fine. But here you can observe that it did their denoted this as single leg. Right? Now what do we mean by this is it is not mandatory that every employee should work for a department, right? Which means the participation of this entity employee on this relationship works part is just partial. It is not taught at right. Let us assume Sam Sam is working for a cons department, right? Sandra's working for our country department. Bob is looking for finance department, Alice is working for management department, and Jakob is not working for any department. Let us assume that Jakob has been hired just now and he has not been yet as any department, right? He has not come under any department. If that is the case, this employee Jakob, doesn't have even a single department, right? Which means this employ Jakob is not working for a single department. From this, we can clearly say that the participation of this entity employee and this relationship works for is part shell and it is not taught at right. Why? Because every employee is not having any department frame for you employ Jakob, does it have even a single a single department? Right? So from this we can say that this is partial, partial participation. This is total participation, right? Finally, let's see this. Total participation versus partial participation. If every entity participates in the relationship at least once, which means if every entity participates, every entity participates in the relationship, at least ones, then we can say that the participation of that entity in that relationship is taught at right? It is total. Yes. The participation of that entity in that relationship is part shit. Since here it is not total. We say that the participation of this entity on this relationship is patchy finite order, but dissipation is denoted by double lens. Total participation is denoted by double lines, better as partial participation is denoted by single leg, right? Actually participation is denoted by a single length. This is very important to understand and keep 1 in my eyes off. No, we have not seen. How will we be able to find out and understand which employee works but which department, right? By using the stables on seeing this payables, somehow, we're going to be able to find out which department does an employee works for R, which, which, which employees are under the parameter a particular department, right, for example. But Sam books for a concert, finance and management are engaged. If it doesn't belong to any department, we'll be able to spot that out using something. We will see that later, right? Which can be done by linking both the tables. You will see how to link both the tables later. Fine.