![]() ![]() As the student will be shifted to another class, so his information needs to be deleted.Ĭase 2: If a student wants to change his name/enrollment number, he has to update all three tables, i.e., T1, T2, and T3. Now, if there is a case where a student wants to change a class or change his name/enrollment number, we need to make certain changes in the database.įollowing is the design of our MySQL database (arrangement of tables).Ĭase 1: If a student wants to change his class, he must delete his name from all the tables, i.e., T1, T2, and T3. Both tables, T2 and T3, have three columns, i.e., enrollment number, name of the students, and marks of the student. Table T3 contains the marks of all the students in the Science subject. ![]() Table T2 contains the marks of all the students in the Mathematics subject. Let us now consider two more tables, i.e., T2 and T3. Table T1 has four columns, i.e., Enrollment number, name, email, and state of the student. Let us take an example in layman's terms to understand the usage of cascade keyword in SQL.Ĭonsider a table named T1 which contains the data of all the students in a class. IntroductionĬASCADE is a keyword in MySQL relational database management system. If the cascade keyword is added to a query written for the parent table, then both the parent and child tables change accordingly on the execution of the query. The keyword CASCADE is used as a conjunction while writing the query of ON DELETE or ON UPDATE. CASCADE in SQL is used to simultaneously delete or update an entry from both the child and parent table. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |