Gen AI Powered SQL For Busines Analytics 2026 | Learn SQL With Gen AI | SQL Tutorial | Simplilearn
Chapters8
Outlines how plain english questions map to SQL queries and data retrieval, setting the course focus on business analytics.
A practical, hands-on course showing how gen AI can accelerate SQL for business analytics, from database basics to advanced queries and real-world decision making.
Summary
Simplilearn’s Gen AI Powered SQL for Business Analytics 2026, led by a seasoned instructor, turns SQL into a business-friendly superpower. The course starts by reframing SQL as a tool for rapid data access and insight, not just syntax, with Gen AI helping you translate plain-English questions into exact queries. You’ll learn database fundamentals (DBMS, relational databases, keys, and ER models) and then move into core SQL tasks: creating databases and tables, inserting data, and writing useful queries. Practical techniques cover string and data functions, pattern matching, grouping, aggregates, having clauses, and window functions, all tied to real-world analytics use cases. The curriculum also emphasizes how Generative AI can assist business analysts in writing SQL, understanding logic, and working more efficiently with data. Beyond SQL, the course spotlights BI tools (Power BI, Excel) and aligns with IIAB BABOK V3 standards for certifications like CBA/CCBA, including 10+ industry projects and 40+ practical activities. Interwoven throughout are engaging examples, quizzes, and live sessions designed to build both confidence and practical skill in data-driven decision making. If you’re a business analyst aiming to leverage AI-powered SQL for faster, smarter insights, this course is structured to take you from fundamentals to real-world execution.
Key Takeaways
- Gen AI can convert natural-language business questions into precise SQL queries, speeding up data retrieval and insight generation.
- Atomicity, consistency, isolation, and durability (ACID) underpin OLTP use cases like banking and e-commerce transactions, ensuring reliable data operations.
- Relational databases use tables linked by keys (primary/foreign) to model real-world processes like customers, orders, and products.
- NoSQL databases offer schema flexibility for evolving data, but this course focuses on the relational model (MySQL/MySQL Workbench) as the core skill.
- Quicks wins with SQL include: creating databases/tables, inserting data with and without column lists, and basic SELECT queries with filters, sorts, and limits.
- Advanced SQL topics covered include window functions, HAVING clauses, aggregates, pattern matching, and set operations (IN, BETWEEN, LIKE).
- The curriculum ties SQL mastery to business analytics workflows and certifications (CBA/CCBA), with real-world projects and live expert guidance.
Who Is This For?
Essential viewing for business analysts and data professionals who want to harness gen AI to write SQL faster, perform deeper analyses, and prepare for certifications like CBA/CCBA. Great for anyone moving from Excel/Power BI to SQL-backed analytics.
Notable Quotes
"What if you could look at a business problem, ask a question in plain English, and quickly turn it into SQL query that gives you the exact data you need?"
—Opening the course framing the power of combining SQL with generative AI.
"Atomicity says it ensures that transactions are executed in all or nothing manner."
—Explaining ACID properties in the context of day-to-day OLTP.
"SQL is a language and DBMS is the librarian that speaks SQL; to talk to the DBMS you need SQL."
—Foundational explanation of SQL, DBMS, and how they interact.
"Either the whole transaction should get processed successfully or there should be nothing."
—Clarifying the practical importance of atomicity with a banking example.
"Generative AI can assist business analysts in writing SQL, understanding logic, and working more efficiently with data."
—Summarizing the AI-assisted purpose of the course.
Questions This Video Answers
- How can Gen AI speed up turning plain-English business questions into SQL queries?
- What are ACID properties and why do they matter for everyday databases and analytics?
- Which SQL topics are essential for a business analyst starting with SQL in 2026?
- How do relational databases compare to NoSQL for business analytics use cases?
- What certifications (CBA/CCBA) align with SQL skills for business analysts and how many projects are included?
Gen AISQL TutorialBusiness AnalyticsRelational DatabaseOLTPACIDDBMSMySQLER DiagramSQL Functions','Window Functions','Pattern Matching','Group By','Having Clause','Power BI','Excel','CBA','CCBA
Full Transcript
What if you could look at a business problem, ask a question in plain English, and quickly turn it into SQL query that gives you the exact data you need? That is the real power of combining SQL with generative AI. Hey everyone, welcome to this course on Genai powered SQL for business analyst. Today, businesses run on data. Every sales report, customer trend, marketing campaign, financial dashboard, operational decision depends on one thing. The ability to access the right data at the right time. And that is where SQL becomes one of the most valuable skills for a business analyst.
But many professionals struggle with SQL because writing queries can feel technical, confusing or timeconuming. Now that is exactly why this course is so useful. It is designed to help you understand SQL from a business analyst perspective while also showing you how generative AI can make the process faster, easy, and smarter for you. This course you will be learning how databases are structured, tables connect with each other, how to write SQL queries for your business use cases, and how to use important concepts like filtering, grouping, join, string functions, data functions, and window functions. So this is not just about learning commands.
It is also about learning how to ask better business questions, retrieve meaningful data and turn that data into insights that support smarter decision. So let's look at the agenda now. First we'll understand the basics of databases, DBMS, relational databases and why these concepts matter for business analyst. Next we will explore database design concept like entities, attributes, relationship, primary keys, foreign keys and many more. After that, we'll also move into the core SQL commands like creating databases and tables, inserting data, writing queries to retrieve useful information. After that, we'll look at practical SQL techniques like string functions, data functions, pattern matching, grouping and many more.
Then we will explore more advanced concepts like aggregate function, having clauses and window functions to solve real world analytical problems. And finally, we will see how generative AI can assist business analysts in writing SQL, understanding logic, and working more efficiently with data. Also, if you are interested in boosting your career in business analysis, do not forget to check out our AI powered business analyst course. This course is perfect for professionals who are looking to enhance their skills with the latest tools like PowerBI, Excel, SQL, all while gaining hands-on experience with real world projects. You will be learning how to leverage generative AI for smarter, faster decision making.
Now our program is IIAB Babok V3 aligned and it will help you prepare for certifications like CBA, CCBA where you will engage with 10 plus industry projects, 40 plus practical activities and benefit from live online sessions led by experts. Plus with Simply's job assist program, you'll get the support you need to know to land in next big role. So before we get started, here's a quick quiz question for you. What is the main benefit of using SQL for business analysts? It help design mobile apps. It helps store, retrieve and analyze business data. It helps edit videos faster or it helps create logos.
Let me know your answers in the comment section below. So data is nothing but a raw unprocessed fact. So data can be anything. So let's say if I tell you about my profile. Yeah. where I've worked uh what I have done in last 15 years in my professional life about my personal things. So that is again data. So data is what? Data is raw and unprocessed fact that on their own may not have much of the meaning. So basically data is as I told you. So if I give you one file with a lot of student details for example this is what this is data.
So this is unprocessed. This is raw. So it doesn't have much value. Yeah, it doesn't have much value. So what we do is we process the data. Now this is usually done by the data engineers. So the data is processed and organized in a way that it becomes information. So data is in a very raw form with not much of value with not much of meaning and the data is converted the pro it is processed to make it information. So information is basically the processed one. So moving ahead now see you've got a lot of data just like let's say if I talk about okay so I'll give you one example one analogy so let's say that you've got a lot of clothes yeah you've got a lot of clothes now ignore my drawing yeah you've got a lot of clothes whatever it is yeah you've got a lot of clothes so now you've got clothes that's fine But where are you going to store your clothes?
Definitely we store our clothes somewhere, right? So we store the clothes in the cabinets in Almir whatever you say. Yeah. So we store the clothes in the cabinets in Almiras. So here also when you have a lot of data data needs to be stored somewhere especially the processed data. So that needs to be stored somewhere. So just like you are storing the clothes in Almiras in your wardrobes in the same way the data is stored in the database. So database is nothing but it is a structure which can store the data and definitely store the data digitally or electronically because see when I talk about the wardrobes you have the wardrobes at your home.
So uh you you get to see the physical wardrobe but here in the computer world everything is digital right. So database is think of it as a folder. So on your machines so on your machines why do you create a folder so that you can save your data in it you can save your files in it. So here also we create the database in order to store the data in order to store the data. Now when you have a database why it is uh always better to have a database. So if I ask you again just tell me one thing.
Let's say that you've got a big wardrobe with a lot of clothes in it. Yep. So don't you think so that if you have got a clothes if you have got a wardrobe first of all uh you're getting a better storage organized storage. Maybe I'm going to keep all my jackets over here. I'm going to keep all my shirts over here and so on and so forth. So, I get to organize my clothes because I'm having a wardrobe, right? Also, I can easily access it. See, if I'm just dumping my clo clothes on the floor, if tomorrow I want a particular dress, yep, it will be very difficult for me to find it, right?
But if I'm using a wardrobe and definitely if the wardrobe is organized then I can easily find the clothes. Yeah. So it is very easy. It will be very easy for me to access. Right. Uh also now that is not related to the clothes but yeah in case of database we have one more thing maybe I'll talk about that. So talking about the database which is nothing but the storage of data. It is organized storage. So I just explain you with the help of wardrobe analogy right. So you have everything uh with the help of wardrobe all your clothes are organized.
Yeah. Here also you've got database. So with the help of database we are getting the organized storage. Then efficient access. So as I told you in case of wardrobe also if your clothes are properly organized it will be very easy for you to access your clothes. So in case of database also it will be very easy for you to access the data because right now see the data can be in uh you know in mega GBs like it can be really huge. It can be really huge. So it is very important that there should be some way to store it so that we can also have efficient access secure scal scalability.
So what do you understand by scalability? Scalability is about increasing the data and data is definitely increasing day by day. Now if you talk about Amazon think about the data that how fast it must be increasing. every day there must be a lot of transaction being made. I'm talking about the Amazon website and if I specifically talk about only India Amazon website or only US Amazon website every day you can imagine the kind of transaction that Amazon might be getting and the kind of data that might that Amazon might be producing. So we need a system which is scalable.
Scalable means that it should be able to handle. So database is a system which can handle the growing data. Yeah. And it's definitely secure. It provides us the security also. So you may not want all your data to be accessible to everyone, right? So with the help of database, we can also secure our data. Just like in your wardrobes, you can always lock your wardrobes, right? You can lock and unlock your wardrobes. In the same way database data can also be logged and unlocked from uh different different users that you have screen you'll get to know that u how your co-articipants are for example I actively work with SQL so we have got only two who are actively working on SQL no experience with SQL we have almost 53 so we are going to learn from very very basic and you can see that we are doing that we are starting from what is data so that's one of the very basic basic thing okay I have got some knowledge but don't use it regularly so we have got 16 folks okay here is about the uh experience so you can just quickly have a look so we'll make sure that we cover everything from scratch but guys one thing if you're learning the language for the very first time then you also have to make sure that you practice after the class so only class learning would not be sufficed because see if you don't practice practice after the class.
When you come for the next class, you're going to forget most of the things what have been taught in the previous class. So, please make sure that apart from being consistent in joining the classes, you're also consistent in going through the material and doing some self-study. So, that is very very important. Okay, I'll just scroll it down. So here are the folks of different from different different domains you can see. So we have got a lot from finance domain and the goal for most of you guys is uh to the career growth help in the career growth.
So again there's one analogy in order to understand what database is. So just like you've got a lot of books. Yeah. So we've got a lot of books. So the books are stored where? Now this is the picture of what books are stored where? Think of books as the data. And where do we store books? In the library. Yes. Yeah. So this is what library. You must have seen that when you go to any of the library usually the books are arranged in a certain manner. For example, here you'll have all the science books. Here you'll have let's say all the maths books, all the fractions.
So in this way and then there might be some alphabet alphabetical arrangement. If you go to any good library, you'll see such arrangements. So why do we have such arrangements? What do you think? Why? What is the reason behind such arrangements? So library stores the book books easy retrieval. Yes, easy accessibility. Yes, imagine that they are not storing the books in this way and then you'll end up maybe spending your whole day or two in order to find one single book maybe more than that depends on the size of the library. So database also works on the same concept guys.
It's just that instead of books we are now storing the data and instead of library we are having the database. The database stores the data. Library stores book. Now just like how the library is properly just give me a second. Yeah. So just like how the libraries are properly organized so that we can easily access the data and it's not only about access the data I mean I mean to say the books it's all also about let's say there's new edition yeah I've got a new addition there's a new fiction book so I know that I just have to add it over here so it helps me to modify also properly right I I'll quickly able to modify make the modifications so it's not that I'm very random with it but Yeah, it's mainly for the quick access.
Now, we're going to learn about these properties of database. So, this is very important interview question also. So, we have got asset properties. We call it as asset. So, we'll go one by one. So, this slide may take little bit of time. So, please be patient. So, I'll try to make it easy. I'll try to make it interesting. Yeah. All of these properties. But you should definitely know about these properties. These are the heart of the database. So when I say autom atomic city any idea what atomicity could be? So I do not want you guys to read the slides.
I want you guys to answer with whatever comes to your from basic minimums. Okay fine. So we'll talk about atomicity. So I'll give you an example and we'll understand it with the example and it's very important. So before I talk about atomicity maybe let me tell you the use case of database. So just like database we have got we have got more entities in order to store the data. Now you have to hear me out right? In order to store the data we have got more entities. Database is not the only place where the data is stored.
We have got a lot more other things. So you might have heard about apart from database you might have heard about data warehouse. You might have even heard about data lake. So we are not going to get into that. That's definitely not our area to get into. But what I mean to say is that we have got multiple things in order to store the data. So why what is the use case of database? The question is let's say I've got some data. So why would I choose database rather than data warehouse or data lake. So we are going to look into the use case of database.
Yeah we are not going to look into the use case of data warehouse or data lake. We are going to sorry look into the use case of database. So any idea any use case of database you can think of see everything is used for storing the data. So why database? So I'll tell you why database. So database or not why I'm just telling you use case of it and then you'll understand why. So we'll go step by step. So if I talk about use case of so let's say that I access any of the bank website and when I say website I'm talking about my account.
So I just want to see that what is the balance current balance of my account what are the transactions that I made in last 7 days and so on and so forth. So to save this data now see my current balance then everything related to me um my profile then my transactions whatever you see so everything goes into the databases so most of the companies they use databases for such things so databases are used for day-to-day transaction so whenever there is any day-to-day transactions data Yeah, whenever there's a day-to-day transaction data, it goes into the databases.
And the reason is that it provides asset. Yeah, it provides asset guarantees. I'm going to talk about what asset is. But why day-to-day transaction data goes uh why day why do we go with day-to-day transaction? because because it provides a database provides with the asset guarantees. If I give you the other example, if I talk about let's say Amazon so again day-to-day transaction right you're making a payment you're ordering something making the payment so mostly the company might be using the database in order to handle all of these things. So if you go to the Amazon you see a lot of products so let me go to the Amazon and I'll just show that to you.
So if I go to Amazon. Yeah. So all of these phones etc. So these are this this is what these are data. Images the description the price all of these things are data. So this might be coming from the database. Yeah. This might be coming from the database. So the database might be storing all of these things. So for day-to-day transaction we use we use database. Why for day-to-day transaction? Because database provides us with the asset properties. So we'll talk about atomicity and you'll get to know that why asset is so important. So atomicity says it ensures that transactions are executed in all or nothing manner.
So what does that mean? So it simply means that let's say let's say this is you and this is your friend. Yeah. Now what you're doing is let's say you have got hear me out. Yeah. You've got 50,000 as your account balance. I'm talking about INR anything anyways. Yeah. And now your friend needs 10,000 rupees. So you say fine, I'm going to give you 10,000 rupees. So what you do is you go ahead and you make a transaction. Now this is something that we do in our day-to-day life making the transactions via bank. So you'll understand that how things works.
So here I go ahead and I make 10,000 rupees transaction. So what will happen is the 10,000 will get deducted in your account from your account and it will get credited in your friend's account. So this is the expected behavior when everything goes well. But let's say that you made the transaction. This might have happened a lot of time with you all that you make the transaction the money got debited. Yeah. And hear me out. Yeah. The money got debited from your account but your friend did not get the credit might have happened, right? So what will happen in your account?
You see 40,000. But in your friend's account still it is still reflecting zero. So this is a very bad thing. Right? If I talk about banks, this is something that we definitely do not want because if things are happening like this then we end up calling these people all the customer care and you know breaking our head that we I transferred did not work whatever it is it's definitely not some not something that we would appreciate right so what happened usually in in your day-to-day life you might have seen that if the money is debited from your account and there was some problem while you were making the transaction it gots recredited.
You get the message that you have got your money back. So behind the scene what happen is because there's a database that is working. Database says that either all or none. Yeah, it says that either all or none or nothing. So what does that mean? It means that either the whole transaction should get processed successfully. So what I when I say whole transaction should get processed su successfully it means your account is getting debited and your friend's account is getting credited. This is the one full transaction but if there's a problem in between yeah if there's an error in between there's some problem in between then the whole transaction should be rolled back.
So either it should be the full transaction or there should be nothing. And that's why when there's a error while you're making some transfer and if there's some error you you'll get uh you'll get your credit back you'll get your money back automatically and this is because of the database property that is atomicity. So this is a property of the database that either the whole transaction is successful but if there's a problem in between then it will make sure everything is rolled back. So your deducted amount the amount which was deducted is rolled back and it is again credited.
So this is what autoomicity is. Now this is so important property. If I talk about banks and if I talk about any other website also Amazon also you make an order. Yeah. Either the order should be made or shouldn't be made. There should be nothing half in between. Right? So autoomicity is very very important. Am I clear with the auto atomicity? Can I quickly get the confirmation? Perfect. Now we're going to talk about consistency. So everybody knows the meaning of Yep. So here it is written but still I write it. So again I'll explain you with the help of an example.
So let's say that you've got an account. Yeah, you've got an account with a bank and you've got 15,000 rupees. Now in your bank and you might have seen that you a lot of banks does have such rules. So let's say that your bank has a rule that you should maintain minimum balance of 10,000. So this is a rule, right? minimum balance of 10,000. That's a rule. Now, what you do is you make a transaction. You make a transaction of 10,000 rupees in your friend's account. So, how much how much amount is left in your account?
How much amount is left? You've got 15,000 and you make a transaction of 10,000. So, how much amount will be left? 5,000. Right? But what the rule says? The rule says that minimum value should be 10,000. So here consistency says rules are not broken. So in very simple words, the rule says that you have to maintain 10,000 rupees in your account. If you try to if you try to transfer 10,000 rupees because you've just got 15,000, it will give you error. it will not allow you to do it. You might have seen on on GP, Google pay that there's a limit of 1 lak rupees for every day.
So if you try to transfer more than one lakh rupees though you might be having even 1 CR in your account but if you try to transfer more than 1 lak rupees in from your Google pay it gives you error it says big no that you're not allowed. So that are what that that is what that is rule. So databases says oh you got some rules I'll make sure that the rules are being followed the rules are not broken. So am I clear with consistency so isolation as the name says it ensures the transaction do not affect each other.
So again I'm I'm going to explain it to you with the example. So let's say that you and your sibling or your spouse or your parents you both are using the same account. So it happens right we share the accounts with our loved ones dear ones. So let's say let's suppose that the account balance is 10,000. Now what is done is let's say you we make a first transaction that is we are taking 5,000 rupees out of the bank. So let's say we are taking 5,000 from the ATM. So the new balance would be what?
The new balance will be again 5,000. Now let's say that there's a second transaction. And when I say transaction it can be anything. It's not only about credit and debiting. So the second transaction says that you know it sees it wants to see the data. Yeah. It want to see like how how much is the account balance. So let's say that you are taking the money out from the ATM and at the same time your parents are checking the balance. Yeah. So they are checking the balance. So they end up they may end up seeing they may end up seeing maybe 5,000 or maybe 10,000.
So let's suppose they end up seeing 5,000. Yeah. So your mom is checking and she sees that there is 5,000 rupees. But what happened when you were so you initiated the transaction and ATM uh took its sweet time and then it failed. Yeah, there was a failure. So what will happen? What will happen? Or maybe you're not taking it from the ATM. You're just doing the online transaction. So you have initiated 5,000 rupees transaction but in between it got failed. So what will happen? It will roll back and you'll again have the 10,000 in your in your account.
But your mom is seeing 5,000. So that's a problem you're getting. That's a problem. Actually, you don't have 5,000 because your your your transaction failed. So it so everything will roll back and you you actually you have 10,000 rupees only you don't have 5,000 you're getting so you don't have 5,000 you have 10,000 but your mom is seeing 5,000 so that's that's a problem that's a problem. So isolation says isolation says that we are going to we are going to do the things in isolation. Yeah. So it means it means that T2 yeah in the transaction two either it will see the old data 10,000 or it will not see anything.
Sometimes the screen takes its sweet time in in order to get refresh or in order to show you the numbers right. So it will not show you the data half incomplete data. Yeah, half done data. It will not show 5,000 at least. So it either it will show 10 10,000 or it will wait for some time for uh for the transaction to get processed that T1 transaction to get processed successfully and then it will show 5,000 but nothing in between here it was showing in between see you were making the transaction and it is showing 5,000 to your mom but what happened the transaction got failed but your mom sees 5,000 so that's a wrong thing that we are showing right so this is not even before this is not even after this is something in between So isolations make sure that everything happens all the transaction they happens in the isolation.
So they are not affecting each other. So it means that if you're looking into the balance either you're going to see 10,000 or it will take some time and will show you 5,000 once the transaction T1 is successful. So this is what isolation means. Yeah. Means transaction two will not see the uncommitted deduction. As simple as that. So am I clear with isolation? Simple. Everything is something that we get to see in our day-to-day life. Yes, Rajpar. What you're saying is right. Now what is durability? This is a very simple one. So what is the meaning of durable?
Durable simply means that the data is permanent. So it simply means that once the transaction is successful, see 5,000 deducted from your account and credited in your friend's account. Yeah. This yeah this should be durable or the data should be permanent as simple as that. So if there's a power failure even if the system crashes the data will be still saved. So once so it simply means once committed it stays forever and this makes sure that there's no data loss. So I'll just quickly recap. Atomicity says no partial updates either should be full or should be none.
Consist consistency says no rules breaking. Isolation says no transaction confusion. and durability says no data loss. So this makes database very very special and that is a why we use it for day-to-day transaction. So there's a word word for day-to-day transaction that is OLTP. So you should definitely know about this thing. It's nothing but online transactional processing. So maybe I'll not write the whole thing. transactional processing. So this simply means day-to-day transaction Amazon your banks. So these are what day-to-day transactions. So all the companies for their OLTP they use databases. So databases are very important.
Okay, whipl I think I've already summarized, right? So what you have to say is for atomicity. So they usually ask like what is atomicity? So you can explain the whole thing that either the transaction should be full transaction or it should be no transaction. So there there should be no partial transaction. Consistency you can give the example that we have got the rule. So we have to make sure that data follows the rule. I give you the example of Google pay also So Rajpal let's keep it for the end of the session. Yeah data warehouse we'll cover what is in our curriculum and I'll explain you.
So data warehouse also I'll explain it's a very interesting concept but just keep it for the end of the end of the session. So I'll explain sidesh what you're saying is absolutely I'll quickly explain isolation once again. So isolation simply says think of it maybe I'll give you one maybe one more example. So let's say that you make a transaction you have got 10,000 rupees. Yep. uh you make the transaction of 5,000 at the same time. So I'm explaining you with the same example. At the same time, your spouse looks into the account balance and sees 5,000 rupees.
Now you made the transaction but what happened? Something happened and your transaction got failed and everything got rolled back. So basically you have got 10,000 But your spouse saw 5,000. So your spouse was able to see incomplete data. So either your when you're checking the account, it should be either 10,000 before the transaction or should be 5,000 after the transaction. So it should not be in between. Yeah. When you're making the transaction, understand the transaction is still not completed. Just like let's say you're taking the exam and when you're taking the exam so you're preparing for the exam maybe.
Yep. And you're telling your mom that oh I'm going to top the class. So it's like too soon to say right? So you have to take the exam first and then you can say that okay you have topped the class. But here also it's the same thing that the transaction is ongoing and when the transaction is ongoing this state shouldn't be shown to the user. because the transaction is ongoing. So if the transaction fails then if you are showing 5,000 see if you're showing 5,000 then it's a bad data right you're showing the bad data actually the the amount is still 10,000 because the transactions failed but you're showing five 5,000 so that's a bad data so either you have to either you should show 10,000 or you should show 5,000 after the successful transaction.
Am I clear now? Yes. Raja now there are different different type of databases. So we'll I'll quickly give you the brief of the different type of databases but we are going to focus only on the one type of database which is used in major projects. So we have got different different type of databases. The first one in our list is the relational database. So we are going to learn relational database. Database is what? It's nothing but it's a place where you store your data. Yeah. Where you store your data. So we have got no SQL graph database centralized distributed in our curriculum we have got relational database SQL works with relational database only.
So our focus would be on this but I'll just quickly walk you guys through these also so that you understand these terms. We'll definitely not deep dive that is not required. So let's talk about relational database. Database is what it's storage of data. So relational database says that I am going to store the data. Yeah. In the form of the tables. Now what tables as? Tables as columns. Yeah. It has columns. Let's say student ID, student name, student number, all of these. Yep. And then it has got data. So this is what this is relational database.
Now we also call it as relational. It means the tables are connected to each other. Yeah, the tables will be connected to each other. So how they are connected to each other? I'll give you one example but we are going to deep dive into this. This is what we are going to learn. So it's very much okay if you do not understand it right away 100%. And yeah, that's very much okay. If you understand 50% of it, that's also fine. So, for example, let's say that I've got let me let me see if I've got something.
Just give me a second. So, instead of writing, I'll better show you. Just give me a second. Yes. Yes. So you can see these are what these are tables with rows with columns and rows. So it's a relational database. So relational database says that this is table let's say this is table one, this is table two and this is table three. So relational database says that there's a relationship between the tables. Yeah, there's a relationship between the tables. Now, when I say that there's a relationship between the tables, what does that mean? So, if you see for example, so this table is storing the data of the orders, order date, order ID, customer ID, product ID, quantity.
So here the customer ID is 1 2 3. So here we are not storing the data of the customer in this table. We are just saying that this transaction is made by the customer with the ID 1 2 3 but we are storing this data of the customer the information of the customer in another table. So for example 1 2 3 ID is of anul and he is male we can have more information phone number so many so much of it. So this is just to make you understand. So in case of relational databases everything is stored in the form of the table all the data and then we have the relationship between the table.
So you can see that this table and this table is related to each other. Yeah. This table and this table is related to each other. So when I say that two things are related to each other. Let's say that you are related to your uh sibling. So there's something that is common between you. Let's say you're related to each other because of the family. Yeah. In the same way, let's say that you have got multiple friends and you say that okay, I am uh you know somehow I am now that doesn't make much of sense but yeah let's say that I am related to this friend in a way that we all belong to the same college.
So that's a key between the relationship uh that's a key between you and your friends to establish the relationship. So you guys tell me see I've got this table customer table and I've got this orders table. So what do you think what is the key between this table and this table that is actually making the relationship happen. So in order to make the relationship happen, there should be some something in common. Yes. Customer ID. Yeah. Tell me about this one and this one. Now product ID. I hope this is clear, right? So this is how the relational databases are designed.
We are going to deep dive into it. That's what we are going to learn for next eight classes. Now let's talk about the other databases that we have. Okay, here I've got okay I just totally forgot that I've got a PPD and here I'm showing that how the different tables are related to each other. So there's a key a common key but let it be. Yeah, I've already explained you and we are going anyways going to deep dive into it. Okay, a lot of uh speaking from my set again I'm so sorry because I can't help it.
From tomorrow we'll do a lot of hands-on this one. Yeah. Now if I give you the examples of the relational database, examples are MySQL. You're here to learn MySQL. So that's a relational database. In the same way we have got SQL server, Oracle, Postgress. Now if you learn even one single database if you learn MySQL then you can say that you know all the others and I'll tell you the reason why why because 85 to 90% of all the database they are same. It's just that there's little bit syntax here and there. So you don't need to learn all the different relational databases.
If you learn one you you will surely be able to work on the others also. So if I'm let's say I'm taking interview so if I know that the person knows my SQL very well but in my project we are using SQL server I will not hesitate hiring that person because if that person is good as in uh if that person knows that candidate knows my SQL and he's able to answer all the questions and he understands the length and the breadth of the technology then I'm sure that uh working on SQL server will will be definitely no big deal.
So all these databases, relational databases, they're very similar. You don't have to worry about learning different different databases. That is definitely not required. You learn one properly, you can work on any database for that matter. Fine. Now uh there's one thing about the relational database and why I'm talking about it right now because after this we have got no SQL database. So see relational database is kind of a strict database. So when I say it's a strict database what does that mean? So it simply means that let's say I've got a student. Yeah, I've got you can see over here I'm storing the student details role number name and marks awarded.
So let's say I've got a new student. Yeah. Now for this new student I want to store the data but I've got I've got more data for this new new student. So I've got let's say his role number is four name is Niha marks is whatever. Yeah. But I've also got one more data for for him for her. So let's say I've got city as Pune. So relational databases say yeah the that I'm so sorry you have something extra I cannot accommodate. So it's very strict you're getting so this table says that you've got extra column I'm sorry I can just accommodate three columns.
So I am I cannot provide you this flexibility of storing anything in me. Yeah, I've got three columns. You have to stick to three columns. You cannot give me four columns. So it's very strict. I'll give you one more example of strict. The second strictness it says that now it says that this column is integer. It means that it can take only integer values. Yeah, it can take only integer values. So again I go ahead and give the details but let's say I've got some string value. Yeah I want to give let's say 10. So again it will say no.
It will say what what are you doing? I can just take integer. What the hell are you providing me? You're providing me 10 like the string 10. Sorry I can't do that. So it's very strict. Yeah, it says that see I've created this table with the three columns with a certain data type for all the columns. So for this one we have got the data type as integer. This one let's say as string. Yeah, ware and so on and so forth. So we have to stick to that. Yeah, we have to stick to that. We'll talk about that.
Aperta. We'll we'll see to that. Yep. It's very easy to set these rules. So, you got that. The relational database is very very strict. You get that? Am I clear with this point? How do we do that? Once we start writing the code, you'll get to know and it's very easy. It's like one word things. Yeah. You just have to add one keyword and then you're done. Done and dusted. Am I clear that the relational database are super strict, very stringent? Fine. Now let's say there's a requirement. There's a requirement. The requirement is that we want flexibility.
Yeah, we want flexibility. So what I want is let's say that I am um I'm the business owner and I do not want this. Yeah, because let's say I I I am I have run my own school and I say that fine. Yeah, but let's say there's some student with some you know more things. Let's say that he has got some uh he or she has got some certificates or maybe some achievements. So I want to store that data also. Yeah. I simply do not want to discard it. Yep. So either you add one more column to your table.
Yep. or give me something else that is more flexible. I want to store everything whatever whoever is coming to my school. Yeah. Whoever is getting registered, whichever student is getting registered in my school, whatever information they are giving me, I want to store it. So I just simply do not want to discard any of the information. So here comes NoSQL databases. So NoSQL databases. Now we are not going to get into into the architecture of it. As you can see these are non-tabable databases. Yeah. So it stores the data in a way. Now this also stores the data.
Yeah. This also stores the data but it stores the data in a way that it is super flexible. So do you know what JSON? Do you have you heard about JSON? So Google it. Yeah, just Google it sometimes. Or maybe I'll just show it to you. Some uh JSON structure so you don't have to deep dive into it. I'm just showing you so that Why is it taking me to Yahoo? Yeah. So I'll just quickly show you how does it look like. So relational database stores the data in the form of in the form of uh tables and in case of no SQL it stores the data in the form of JSON and there are other ways also but I'll show you the JSON one.
I'm just uh looking for something that is quite easy to understand. Yeah. So here you here you go. So if you see this is what this is JSON. So for example you've got student. So we we say student. Yeah. Or let's say employee. Yeah. Employee. So you're storing the first name, last name, display name, middle name, birth name of the employee. Now this is let's say the information of some XX employee. Now let's say that we have got another employee and that another employee has got some other information also. let's say passport number. So it easily accommodates with that.
It says fine. So I'm going to have one more node. So this is one node for one data for one employee. So you've got 100 employees. So you'll get 100 nodes. So it says that I'm very much okay with it. You have got one more data. So I just have to add one more key value pair over here. Yeah. Key and this is a value. So this is how JSON looks like. So it's very very much accommodating. It says that I'm very much okay with it. Yeah, I'm not strict. Right now I've got five details.
Yeah, five columns. If you got 10 columns for the next employee, I can easily accommodate it. So I'm not strict like tables. So that's what NoSQL says. So it stores the data in different different formats. So it stores the data in key value, column, graph and document format. You don't have to deep dive into it. But yes, so why do we use NoSQL? This you should know. So if you want that flexibility, see tables are very strict. So you want that flexibility that tomorrow if your data comes in some other format, you should be able to store it.
Yeah, it should not it should not say no. Your database shouldn't say no. Then you can go for NoSQL database. So am I clear with this point? Definitely you don't have to deep dive into it. XML format. Yes. XML JSON key value pair. Exactly. Okay. The next one is graph database. So I'll take a pause. Why I don't with whatever you see on my slide I want you guys to guess the use case of graph what do you see over here social media fine so have you seen or you might you on Instagram or Facebook you might have seen that it keeps giving you recommendation of friends of friends, mutual connections, suggested friends.
Have you seen that? So whenever we have got data like this, yeah, where the data is very much related, yeah, it's mutually related. You can see over here. Yeah. So we use graph database. So friends of friends, so this is again graph database. In the same way product recommendation so you buy one product then it starts showing you all the other products. So that can again come under graph database. We have ML also in that it depends but yeah this is what this is graph database. So uh it stores the data in the form of the graph not table.
So basically this is you. Yeah. You're browsing Facebook. It will start showing you the mutual connections. This this this. Yeah. So this is how it works. You would have never worked on the graph database. Usually uh it is used by the social media companies. Yeah. Social uh media companies then uh it is also used by the banks I think for the fraud detection etc. Yeah. But it saves the data as a graph so that they can you can find the connection between the data. Fine. Now we'll talk about centralized So centralized database it can be any database for that matter.
It can mean SQL, NoSQL, graph. So centralized database is what? You have got one Yeah, you've got one database and everybody's connected to this one So there's only one database. You have one centralized database and everybody is connected to this centralized database. Let's say that City Bank has got one centralized database. So tell me what could be the problems of having centralized one single big database. What if the database crashes? What if there's a power cut? There's a failure. What will happen? Everything will go down. you're not able to access your bank account and so the users.
Yes. So this is a centralized database where you have just got one single big database storing everything and a lot of companies still uses centralized database though it is not recommended. Now what do you think what should be the solution of centralized database? Now I'm not expecting the right word for it. I'm just expecting that what should be the solution what you you would do. Don't you think so you have the copies of it multiple copies? Yep. So backups. Yes. So if this goes down you have a backup up and running so that you do not uh because of the system crash your website will not go down as simple as that.
So having these backups definitely is pretty expensive because here you maintaining only one database. Now let's say I have got two backups. So I'll end up maintaining three databases right? So it's pretty expensive but yes we call it as distributed databases where the data is stored in multiple places and that's is again done by all the big companies and that is the reason why these days you'll not see that your site is going down. Yeah. All the good big companies websites they are always up and running. So in Pune this happened almost a year back I think it was it happened in June July.
So I stay in Hindabari those who are from Pune. So uh there was some issues with the power. Now this area where I'm staying is the IT hub one of the IT hub. So there was some big issue with the power supply of and that was for the whole area and we were without the power for 3 days straight 3 days and it was not only for the households it was for all the IT parks also and uh we have got some data centers when I say data centers um as in uh you can say servers which are storing a lot of data.
So we have got some data center we have got a data center also here in uh this part of Pune in Javari. So everything went down. So definitely the these are very common problems. It can definitely occur. So that's the reason why the companies they always prefer having the distributed So instead of having one centralized database, they're going to have databases at multiple places to avoid uh any downtime. Am I clear? Now here are the differences. You can uh just quickly read this slide. I've already explained you the differences between the two. Fine. So let's do one thing.
I think we have got a lot of theory and I've been speaking from last one and a half hours. So it's not uh my thing. It's about you guys. Because if somebody speaks or if you have to listen somebody for more than 20 minutes, we tend to uh do a we tend to daydream. So according to some theories I think the attention span of a human being is only 20 minutes not more than that. So we'll do one thing we'll take a break and after the break we'll continue because we've got the next topic. So I just want to you know cover these topics in continuation or if you're okay maybe I'll take another 15 minutes for these topics not more than that.
Oh wow, everybody is saying go ahead. I'm so happy. Fine. Let's go back to our library image. I literally have to go back. Now tell me one thing. We've got the data. We've got the books. We have got the library storing the books. Who manages the library? Somebody should also be manage it, right? Who manages the library? Librarian. Okay. So in we just learn about data. We learn about the database. Don't you think so? We want somebody who can manage the database. We want a tool which can manage which can help us. Anyways, we are going to manage definitely.
But we want a tool which can help us manage the database. So let's say if librarian is also managing the library but the librarian might be uh maybe maintaining some book uh some records. Yeah it might be the librarian might be using something in order to maintain the library. So I remember when I was in college so my because that time it was like long back. So my library teacher uh there was a there was a computer of course in the library in front of uh on on her desk. So she used to use that also she used to maintain one register one copy.
Yeah. And she used to write who's taking which book and what's the last date of the submission what's the fine all of these things. So there's a system that needs uh that we need in order to maintain the things. So here also in order to maintain or not maintain in order to manage the database we have got DBMS. Here we have got DBMS. So you can see database management system. So database management system is nothing but it allows user to create update retrieve and manage the data in the structure format. So basically see you've got the data you have got the database with a lot of data.
Now in order to talk to the database get the data out of it insert the data in it update the data delete the data whatever you want to do with the data for that we need a system. Yeah we need a system and we call it as DBMS database management system. So it's a software that helps us manage the databases. So what you can do in this see you can create the database you can read. Yeah you have got the data right. So you can create you can read you can make the updates you can delete it.
So you can do all of these things. So these are called CRUD operations. So do not get scared with these jarens, technical jargon. These are very simple thing. So when I say CRUD C stands for what? Everyone tell me C stands for what? I just talk about the operations. It means create. Yes. So CRUD operation you're going to listen uh to this term a lot. So this is not specific to the databases only like Yep. R stands for what? Read. Yes. Very good. U stands for what? Update. And D stands for delete. So if anybody says CRUD operations, do not get scared of it.
What is this CR? It's nothing. You're creating the data. You're just like u you've got a wardrobe. So you are just looking at your wardrobe. How how many clothes you've got. Maybe you're updating your wardrobe like you're adding something to it. you're removing something from from it and so on and so forth. So here also we do all of these things but we do it with the help of the software called DBFS and guys see u okay maybe I'll talk about that later not right away now relational DBMS is what tell me what it could be I just told you what DBMS what RDB DBMS could What RDBMS to manage the relational database?
You know that there are so many databases, right? We learned about the relational database. Now to manage the relational database, what we have? We have got relational DBMS. Simple. So this is a software which help us to manage the database. As simple as that. Now what is SQL? So see understand this thing. Now you've got a software. Now hear me out. Yeah, you've got DBMS software. So you're going to talk to the DBMS and you're going to make the DM DBMS work for you. Yeah. You say DBMS, can you please create a table for me?
Of course. So DBMS will create the table for you. But DBMS says that I don't understand plain English. Yeah, I I I'm not charg I do don't understand plain English. So DBMS says I can do a lot of things for you but then you have to speak to me in my language the language that I understand. So DBMS in order to talk to DBMS you have to use SQL and that's what we are going to learn. We are going to learn SQL. Why? Because with the help of SQL, we can talk to the DBMS and get our work done.
Sorry, I think there's some issue with the pend. Yeah, get our work done. That is CRUD. Any of the CRUD operations that we want to perform on the database. So, you're getting just like let's say there's a librarian. Yeah, librarian is what? librarian in our analogy is DBMS who manages the database. Yeah. With the U. So then we have got library. So library is what? Library is the database and inside the library we have got books. So books are what? Books are data. These are data. Now let's say that you want to fetch some book.
Yeah. You want to fetch some book. You want some some book. So you go to the librarian and you say that I want so and so book. Yeah. I want book of let's say Dan Brown. So and so your librarian will go and may fetch it for So you're getting so you're going to talk to the librarian. So you may talk to the librarian in the language that your librarian understands. That makes sense also. Yeah. If your librarian understands only one language that it's English and if you start speaking Spanish in front of that librarian, the librarian would be like what are you saying?
I'm like please bother. Yeah. So it the librarian will not do your work. As simple as that. So here also in order to talk to the DBMS now in order to make DBMS work for us we use SQL as simple as that. Yes. So it understands SQL. So it's a language. It's a query language. So you can see over here that it's a structured query language and it is designed to manage and manipulate the data in relational database manage systems. You use RDBMS. You use SQL and RDBMS. So am I clear? What is SQL? So you have got four entities.
You've got data. Data is saved in the database. In order to manage the database, we have got DBMS. So in DBMS only we store the data actually. Yep. In the form of the databases. Now in order to make the DBMS work for us, we talk to DBMS in SQL language. I hope I'm clear. Am I clear guys? What is SQL quickly? So you can just read this slide. I'll wait for a minute. So Fatima it's very simple. See you're going to use a tool just like if I use Excel. So in order to use Excel, Excel only understands English.
So I can just work I can just use I I'm not sure if it has got more languages. I'm not aware about that. But till uh like now I've just used English on Excel. So in case of DBMS also in order to talk to the DBMS you need to use SQL language. Yeah, that's a language of DBMS. Yes, everything is uh everything is done in DBMS Rajpad. So we are going to use DBMS. It's a software in order to manage the databases. I hope I have answered all the questions on the chat. Yeah, Harun. So, we'll come to that also.
Allow me a minute. Maybe I'll ask Raxita to do that. You're talking about the practice lab, right? Okay. So, uh at the end of the session, Pakita will help you with it. Maybe I'll also check it. I'll also help. Fine. So, uh Amin has got a very good question. What is the difference between SQL and MySQL? SQL is a language. Hear me out. Yeah. SQL is a language and MySQL MySQL is the DBMS. So we have got multiple relational DBMS. We have got multiple relational database management systems in the market. For example, MySQL. Then we have got SQL server.
So it shares the name with the databases. Yeah. shares the name same name with the databases Oracle uh sorry for this writing guys and then Postgress I don't know what is happening but yeah so these are this is what this is a DBMS or you can say database also they share the same name in order to talk to the MySQL we use SQL language so SQL is a language and this is a DBMS have I answered your question amin So in order to talk to SQL server also you'll use SQL. In order to talk to Oracle also you're going to use SQL.
Postgress also you're going to use SQL. So SQL is a language and my SQL is the I repeat my SQL okay there's some issue I'm not able to write but yeah my SQL posgress SQL server these are what these are the softwares yeah these are what these are RDBMS database management systems in order to talk to the database management system we need a language the language is SQL so my SQL is a DBMS and SQL is a language to talk to The DBMS it's a coding language. Exactly. So I think we are done. So this is a boring topic but yes it's not curriculum.
So we are definitely going to cover uh tables and entity relationship model. So let's keep it for uh let's keep it uh let's do it after the break. Yeah, we'll keep it for after the break. So I think we are good with whatever we have covered so far. A quick recap. We learn about what is data. We learn about what is What what is database? Then we learn about the different type of databases that we have. also we learn about asset guarantees of database. So okay here I don't have the slide for the same we are just having the slide for the attribute.
So I'll quickly cover about the main components of the ER model. So if I talk about the ER model components the first and the foremost component comp component is entity. So entity is what? Entity is nothing but the real world object. So basically entity you can think of it as a table. So it's a real world object. For example, I gave you the example of student or employee and it is represented with the help of rectangle. We just talked about the table. So what attributes could be? So attributes are nothing but the details of the entity.
Yes. So all of you are right. Attributes are the characteristics details. Yep. of an entity. So let me write it. So attribute about what they are the property of an entity. So if I give you the example of student you tell me what could be the attributes. What could be the attributes for the student table? Student entity ID, name, age, class, marks, etc., etc. Right? So these are nothing but the attributes. Attributes are shown using ovals. Yeah. So whenever you see oval, it means that it's an attribute. Then we have got relationship. Now you know that tables they can be related to So how the entities are connected to So it shows the relationship between the two entities.
Just give me a second. There. Yeah. We'll talk about primary key and foreign key. Not right now. But yes, how entities are connected? to each other. So I gave you the example of orders table. So you told me that the two tables are connected using customer ID, right? So relationship is how the entities are connected to each other. So if I give you the example, let's say that we have got two entities. Students is one of the entity and course. So course, let's say students, let's talk about simply learn. So student table has got all the information about you guys and courses table has got all the information about the courses that are provided by simply learn.
So if I talk about the relationship between the two. So simply students have enrolled or I would say student has enrolled for which course? Yeah, I'll simply say in rows for codes and relationship are denoted with the help of diamonds. Now I told you that in order to establish the relationship you need to have the keys. Yeah, you need to have the keys. So I'll talk about the keys right away. 80s. I'll give you the little bit idea about it. So we have a primary key. Now what is a primary key? So primary key uniquely it uniquely identifies an entity.
So if I give you an example over here. So uh before I give you this example, let's talk about a day-to-day life example. So let's say that our government now whether you're sitting in US or India, wherever your country is, whichever your country is, wherever you're sitting. So the government is maintaining the database of all the citizens. Now you I'm tulika Gupta and there might be hundreds and thousands of tul not hundreds and thousand but at least thousands of tulika gupta in India right that very much possibility right so my data and the other tulika gupta data will coincide so it has to make sure that we it uniquely identify my my data and it uniquely identify the other tulika Gupta's data so what do you think what government would use what is my unique identity in India we have got Aadhaar card those who are joining from US those who are not Indians maybe passport number bank card yes so it uniquely identifies an entity so over here now you guys tell me if I talk about okay in this table we don't have any primary key okay in this table can you see any primary key customer ID is a primary key and that makes sense also.
See customer name can be repetitive. We can have a lot of customers with the same name as Ashul and me. So this can be definitely repetitated but how will we uniquely identify this anu or how will we differentiate this anul with the other anu that we have got in our database using the customer ID. Fine. Can you tell me what is the primary key for this table? So we have got the data of the products. So we want a key that will uniquely identify each product its product ID. So am I clear with primary key?
Okay, we'll talk about foreign key now. So foreign key is basically it connects two entities. Yeah, it connects two entity. So let's say you've got the entity one. It has got some primary key D1. Now we have got entity 2. So in order to connect with entity one, entity two is using this primary key. So for this entity, this is not the primary key rather it's a foreign key. Yeah, this is a foreign key. So I'll explain it to you with the help of the example over here. Now again let's talk about this table and this table and we're going to repeat these concepts of primary key and foreign key.
So please make sure that you understand and you remembers the concept. So tell me one thing uh again the same question that I've asked you before the two tables are related with which column? Quickly this table I'm talking about and this table I'm talking about. We use over only. These are the attributes. So we use over only. Yeah. Customer key. Now customer key is what? It's a primary key in this table. Yes. It's a primary key in this table. Now we are using the primary key of this table. In this table. So for this table for let's say the name of this table is orders.
For this table orders ID becomes It becomes what? it becomes foreigner. Yes, it becomes foreign key. So I repeat I repeat this is what this is a private this is a primary key. Yeah this is a primary key. Now in order to connect this entity the customer entity with that of the orders entity the column that I'm using the common column that I'm using is customer ID. Now for this table customer ID is a primary key. But for this table customer ID is what? It's a foreign key. It's not a primary key. So foreign key help us to connect the two entities.
Yeah. So this foreign key is a primary key of the one entity and it becomes a foreign key of the other entity. Am I clear? We are going to again talk about this. Yes. So see this is what this is a primary key. So when the primary key is referenced in other table in order to establish the relationship between the two entities. I repeat when the primary key is referenced into the other table in order to create the relationship between the two tables in order to two tables. Yeah. So it becomes the foreign key on the other table.
So this is what this is a foreign key. We going to revisit this concept when we start our coding. Am I clear now Shua? Just remember this thing that whenever you refer primary key in the other table in order to create a relationship between the two entities, it becomes a foreign key. Am I clear? So I'll just quickly show you how the diagrams looks like. I think here I'm not I have not created the diagram. Fine. I'll just quickly show you. So it looks like this. You've got the entity. So student this entity may have multiple attributes let's say name okay I'm so sorry I don't know what is happening id now I've got another table again the name of the table is course and these two tables are related to each other so there's a relationship between the two so this is what in rows.
So this is how we create it. So if somebody gives you any entity diagram, er diagram, you should be able to understand student and courses are nothing but the entities. The ovals that you see are nothing but the attributes of the entities and the diamond that you see are nothing but the relationship of the entities. Am I clear? Fine. Now in case of attributes also we have got different different type of attributes. No. So uh there is one I think one exercise for you all. I'll see to that. If you can do it today that's fine.
Otherwise we'll do it tomorrow. So I'll ask you to create one year dialog. So we'll see right. So there are different different type of attributes. Now this is little bit boring topic but that's fine. Attributes are nothing but the features of your entity. So we have got the key attribute. Then we have got the derived attribute, multivaried attribute and composite attribute. So let's cover all of these. So key attributes are nothing but it used to identify one entity from the group of entity. So I just explain you the three attribute. So employee ID, student ID, role number, passport number.
These are what these are key attributes. So you can just have a look. Let's look into other attributes that we have got. Now what are composite attributes? As you can see on my screen, it's very simple. Just give me a second. I think I've got something on the chart. Okay, please go back to the previous slide. Fine. Is this the one for product table? A okay I'll come to yes key attributes are primary keys okay for product table A is asking for the product table now tell me for product table I'm talking about the product table the one that I have highlighted what is the primary key the same question product ID and I'm using it in this table so in this table a primary key of one entity is used in the other table.
So for other table this becomes what? This becomes what? It becomes foreign key. You can also write FK. Yeah, you can just write answers in Y also. No, N. So I'm very much okay with that. Yeah, you don't have to type in the whole thing. Fine. So key attributes I hope I'm clear. Composite is also very simple. So a lot of time we have got the attributes which are composed of several attributes. So for example address. So address is composed of three attributes. So we have got country, state and zip code and all the values or values of these three makes address.
So that's what composite means. Am I clear with composite? Okay. And my laptop is acting up. Just give me a second. Yeah. Anyways, we'll continue. So what is what are multivalued attributes? Now there can be some attributes. There can be some attributes which may have multiple values. Yeah, which may have multiple values. For example, let's say that we have got the attribute order or let's say we have got the attribute Yep. So we have got the attribute order. So order let's say that you make a order. Yeah. You make an order. So in ca in case of order in case of order let's say I make an order of a product I'm not able to write okay there's some issue with the writing thing just give me a second let me try this yeah so let's say we have got the product yeah so I buy one product of some quantity, two quantity, I buy the other product of one quantity.
So what I mean to say is that these attributes may can have multiple values. It can have more than one value. So we represent it by double ovals as you can see. So as I told you that you are not going to design the database. That's not your job. So that will be designed by somebody else. But you're going to work on the database. You're going to query the database. You're going to generate or play with the data of the database. So you should know if somebody give you this AR diagram, you should be able to know what this ER diagram is representing.
And it's a very simple thing. If you see, it's just like the walk in the park. It's so simple. Moving ahead, we have got derived attributes. So okay, why why don't you guess what derived Did you're guessing? I'll just open this. Yes. So all of you are right. So it means that these values see attributes are what? They are like column. They're columns, right? So the values of these attributes, the values inside these attributes will be derived from the other attributes. For example, let's say that you've got uh experience. Now, we may derive the value of experience uh with the help of let's say I've got the joining date of the employee and today date rate date.
Yeah. So, experience in our company let's say that it's simply learn employees for simply learn. So, experience in simply learn how many years in simply learn. So see this value can be derived from the other attributes. Yeah. So we do not have the value we we are not going to save the value in this column rather we are going to derive it during the runtime. Yeah. So because see if I save it let's say I save it. So today it's 2 years let's say. Yeah. So let's say I've saved it 2 years but after 2 months it will be 2 years and 2 months.
So if I'm saving these value it may not give me the right values it right now while I'm saving yeah at this point of time maybe it's 2 years for an employee but after a year it will be 3 years. So again and again I have to update my database. So I can simply derive it if possible I can simply derive it. So how I can derive it? Let's say I've got another attributes with the uh start date or the joining date. Yeah. So let's say I've got another attribute with a start date or joining date and that of today's date.
So with this I can calculate the experience of the employee. So am I clear what derived attributes are? So Raja we usually create the column for the derived attributes. We are going to work on it. We usually create the column for it. But u so it's like you may or may not create the column. You can create this column on the runtime. So anyways you may or may not create the column. Once we start working on SQL this will be clear. You'll understand. So am I clear? What are derived attributes everyone? Yes, Danish has given a wonderful example price.
So quantity into unit price is total price derive attribute. Perfect. Very good Nish. Okay. relationship you already Now, uh there are few things that just give me a second. I would like to just give me a second, guys. We'll just learn few more terms. I know these are boring, but yeah, we'll learn few more term. So entity sets are what? What? Entity sets are nothing but the relationship. So for example, for we have got employee. Yeah, we have got the employee. We have got three employees. Let's say we have got three employees. Employee one. So let's say employee one is Niha.
Employee 2 is Jon. Employee 3 is Mark. So entity set will tell us the relationship that Niha is let's say working on so and so project. So let's say this is a project. Yep. So let's say this is a project and this project belongs to so and so department. So with the help of relationship set you at least give the basic idea of how the relationship is. So for example I repeat Niha is working on so and so project and this project belongs to so and so department. John is working on so and so project and that belongs to so and so department.
So this is what this is nothing but the relationship set. So you can see that it depicts that E1 works in D2 and E2 works in D3. So E E1 works in D2 and E2 works in D3. So this is something that is not created as a part of the document also to be very honest that you'll see er model for sure that is part created as a part of the document for the database design. So it just give you the brief of some data some dummy data of the entities and how it is connected to the other entities data.
So just give you the glimpse of it. So you can see that high volume of monthly transaction. So that itself is enough to tell that what database are we going to use. So uh we are going to use RDBMS. Why? Because see what we want is we want this customer information is currently stored in different departments and so and so and the bank they want to consolidate it. So see they have the customer they have the credit card. So we want the relationship between the data to be there. So we'll go with RDBMS. So see with with the help of RDBMS as you can see it's not that RDBMS is the only way for it.
So see I'll just read it once again. You're working for a bank that is launching a new credit card product. So you're working for a bank. The bank aims to target existing customers who already have saving accounts, a good credit history and a high volume of monthly transaction. So basically it's a marketing thing. However, this uh customer information is currently stored in a different department. So you're getting all the data scattered. Yeah. So some of the customers are in Excel, some of are in the legacy systems, some of they are in the local folders. So what they want is they want to consolidate the all the customers and their respective usually whenever it comes to the online transactions we you we go for RDBMS.
Why not uh see why not graph? Because here is no networking that is being done. So graph doesn't make sense. distributed you can say as I told you distributed is something that see distributed is something that can be used for RDM DMS that can be used for NoSQL yeah it's it's a way of storing the data uh or you can say way of replicating the data not storing the data but it's the way of replicating so uh it has nothing to do with RDBMS or NoSQL you can replicate your RDBMS data also so if you replicate it at multiple places then it becomes distributed data storage the database.
So anyways so uh here we are not focusing on distributed or centralized we are just focusing on that are we going to use which database are we going to use. So graph is definitely not the answer. NoSQL is also not the answer because here it is not saying explicitly that the data is coming in you know different different formats and we need the flexibility to in order to store the data and so RDBMS is the best option. So definitely you can use NoSQL also we it's not that NoSQL will say no I cannot store the data for this one of course you can use it but RDBMS will be the best choice as per the question.
Yes, very good raindo. So the data is also structured over here. Exactly. So it's not flexible. The data is structured. So guys, uh there's little more theory that we're going to cover tomorrow and it's not going to take much of time. But yes, I do not want to hurry up on covering this part. It's a very simple one. It's a very simple one. We'll understand with some examples. It will take another 30 minutes. So today maybe now you can ask the questions if you have any. That's the first thing. And the secondly uh let me let me Yep.
Yep. So you can ask the question if you've got any. And the second thing is that Rakita is going to help you or she's going to guide you with the lab access with the lab. Yeah. SQL lab. So composite attributes are the attributes which are created by other attributes. So basically if I say that I've got an attribute address. So this address attribute is created or is composed of several attributes that is country, state and zip code. So all of these three things makes the uh makes the uh address you understanding? So in order to say the address you need these other three attributes also.
So this attribute is composed of these three other attributes. So for example let's say birth date. So let's say for the birth date we have got year then we have got the end then we have got month. We have got three different attributes. So birth date will be composed of day year and month. No say that I would not suggest you to use any other DBMS and the reason is that sometimes the syntaxes are different. So when the syntaxes are different you will get error. So I do not want that confusion to happen. So I would suggest all of you to use MySQL.
And as I told you before also as I told you before also that uh just give me a second. Yeah. Uh if you're using your personal laptop, it would be best that you download the MySQL, you install it and then you use MySQL workbench in the class that is installed in your machine. But in case if you're using your office laptop and you have got this limitation of uh like you cannot download and install then you can use Zlab. No, multialued is not okay. So multialued is not just give me a second. Yeah. Is not composed of the different attributes.
So this is what this is composed of different attributes. Multialue says that I can hold more than one value. So it says that I can hold multiple values. So, uh, got it. Just give me a second. Oh, yeah. Have you got it? See multialued says that I can have I I can accommodate multiple values. So one attribute can accommodate multiple Composite says that I am made up of multiple attributes. So there's a difference. It says that I've got three different attributes. So if you combine these three attributes then I'm composed. Yeah. So then I'm how uh this is how I'm made up made up of.
So you have to literally combine these three attributes in order to create me. Multialued says that I can I can carry or I can hold two values at a time. Let me think of some other example. So u okay I'll give you one more example. Now tell me one thing. Phone number. So you might have seen that phone number can have multiple values. Yes or no? Multiple phone numbers. Yeah. So that is what multialued. So it is not composed of multiple attributes. So that is multivalued. It means that one attribute can have multiple values in it.
So what I mean to say is that I've got student one with some phone number. Okay, some phone number and one has got another phone number also. So this is what this phone number is what multialued. It means that same student yeah same student has got two phone numbers. So this becomes multivalued. It means one attribute can have multiple values in it. Am I now clear over here composite attribute on the other hand says so it's a very different thing yeah do not mix up the things it says that see it says for example if I explain you okay So for example we have got attribute full name.
So full name is a composite attribute because I can divide it into let's say first name, middle name and last name. So if we combine these through three it becomes full name. So that's what composite means. Yeah, that's what composite means. Multival means that one attribute can have multiple values. But composite means that one attribute can be divided into multiple other attributes. Yeah. It is same as that of workbench. Please make sure that you guys download and install my SQL. Schubab again derived is very different. Yeah, derived is different. So in case of derived, what we do is uh we create a formula.
There's a formula behind the scenes. Comp composite there's no formula. In case of derived there's a formula. So composite is saying that okay I can be divided into these three. But let's say if I've got a formula let's say I've got a derived one. Let's say it says revenue. So let's say this is a derived one and how are we calculating? We are calculating with price and quantity. So you're getting this is a formula that is applied in order to get the derived So this cannot be splitted into parts. You cannot split them into parts.
That will not make any logic. Right? So if I give you 100 as a revenue, how can you split it into the parts? You can't split it into the parts. But if I g give you for example miss, Mary, John, this you can split this you can split into first name, last name etc. But if I calculate revenue, you cannot split it. So this is not composite. This is derived. How many entities are there? They no. So those who are saying two, it's not two, it's one. Can you see that? I yesterday we learned that entities are represented by the rectangle.
And what is this? This is a relationship. So this is a relationship. So basically what it is saying is now hear me out. It's very simple thing. So, urary relationship is a relationship where the entity is related to itself. So, it's a self relationship where an entity a table is related to itself. So, if I give you this example of employee, let's say that we have got the employee table. Now, hear me out. It's very simple. So we have got the ID of the employee and then we have got the name of the employee. So let's say 1 2 3 4 and name I'll say A B C D.
Yep. I'm not writing the proper names. And here here let's say I've got one more attribute that is manager. So manager maybe manager ID. So let's say that A's manager is D. So I will say four. B's manager is again D. C's manager is let's say uh let's say B and D there no manager. Yeah, no manager or so over here you can see that the table is related to itself. You're getting so the table is related to itself. So here because if I talk about the manager ID you can see that if I tell you okay let me ask you the question.
So can you tell me what is the name of the manager of A? What is the name of the manager…
Transcript truncated. Watch the full video for the complete content.
More from Simplilearn
Get daily recaps from
Simplilearn
AI-powered summaries delivered to your inbox. Save hours every week while staying fully informed.


![AWS Solution Architect Full Course 2026 [FREE] | AWS Solution Architect Tutorial 2026 | Simplilearn thumbnail](https://rewiz.app/images?url=https://i.ytimg.com/vi/J9R_huR5lDc/maxresdefault.jpg)




