SQL session 5 | Foreign Key Constraint - Complete Demonstration | Trendytech

Поділитися
Вставка
  • Опубліковано 7 вер 2024
  • 𝐖𝐚𝐧𝐭 𝐭𝐨 𝐌𝐚𝐬𝐭𝐞𝐫 𝐒𝐐𝐋? 𝐋𝐞𝐚𝐫𝐧 𝐒𝐐𝐋 𝐭𝐡𝐞 𝐫𝐢𝐠𝐡𝐭 𝐰𝐚𝐲 𝐭𝐡𝐫𝐨𝐮𝐠𝐡 𝐭𝐡𝐞 𝐦𝐨𝐬𝐭 𝐬𝐨𝐮𝐠𝐡𝐭 𝐚𝐟𝐭𝐞𝐫 𝐜𝐨𝐮𝐫𝐬𝐞 - 𝐒𝐐𝐋 𝐂𝐡𝐚𝐦𝐩𝐢𝐨𝐧𝐬 𝐏𝐫𝐨𝐠𝐫𝐚𝐦 𝐛𝐲 𝐒𝐮𝐦𝐢𝐭 𝐒𝐢𝐫!
    "𝐀 8 𝐰𝐞𝐞𝐤 𝐏𝐫𝐨𝐠𝐫𝐚𝐦 𝐝𝐞𝐬𝐢𝐠𝐧𝐞𝐝 𝐭𝐨 𝐡𝐞𝐥𝐩 𝐲𝐨𝐮 𝐜𝐫𝐚𝐜𝐤 𝐭𝐡𝐞 𝐢𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰𝐬 𝐨𝐟 𝐭𝐨𝐩 𝐩𝐫𝐨𝐝𝐮𝐜𝐭 𝐛𝐚𝐬𝐞𝐝 𝐜𝐨𝐦𝐩𝐚𝐧𝐢𝐞𝐬 𝐛𝐲 𝐝𝐞𝐯𝐞𝐥𝐨𝐩𝐢𝐧𝐠 𝐚 𝐭𝐡𝐨𝐮𝐠𝐡𝐭 𝐩𝐫𝐨𝐜𝐞𝐬𝐬 𝐚𝐧𝐝 𝐚𝐧 𝐚𝐩𝐩𝐫𝐨𝐚𝐜𝐡 𝐭𝐨 𝐬𝐨𝐥𝐯𝐞 𝐚𝐧 𝐮𝐧𝐬𝐞𝐞𝐧 𝐏𝐫𝐨𝐛𝐥𝐞𝐦."
    𝐇𝐞𝐫𝐞 𝐢𝐬 𝐡𝐨𝐰 𝐲𝐨𝐮 𝐜𝐚𝐧 𝐫𝐞𝐠𝐢𝐬𝐭𝐞𝐫 𝐟𝐨𝐫 𝐭𝐡𝐞 𝐏𝐫𝐨𝐠𝐫𝐚𝐦 -
    𝐑𝐞𝐠𝐢𝐬𝐭𝐫𝐚𝐭𝐢𝐨𝐧 𝐋𝐢𝐧𝐤 (𝐂𝐨𝐮𝐫𝐬𝐞 𝐀𝐜𝐜𝐞𝐬𝐬 𝐟𝐫𝐨𝐦 𝐈𝐧𝐝𝐢𝐚) : rzp.io/l/SQLINR
    𝐑𝐞𝐠𝐢𝐬𝐭𝐫𝐚𝐭𝐢𝐨𝐧 𝐋𝐢𝐧𝐤 (𝐂𝐨𝐮𝐫𝐬𝐞 𝐀𝐜𝐜𝐞𝐬𝐬 𝐟𝐫𝐨𝐦 𝐨𝐮𝐭𝐬𝐢𝐝𝐞 𝐈𝐧𝐝𝐢𝐚) : rzp.io/l/SQLUSD
    𝐖𝐚𝐧𝐭 𝐭𝐨 𝐥𝐞𝐚𝐫𝐧 𝐁𝐢𝐠 𝐃𝐚𝐭𝐚 𝐛𝐲 𝐒𝐮𝐦𝐢𝐭 𝐒𝐢𝐫?
    𝐜𝐡𝐞𝐜𝐤𝐨𝐮𝐭 𝐭𝐡𝐞 𝐛𝐢𝐠 𝐝𝐚𝐭𝐚 𝐜𝐨𝐮𝐫𝐬𝐞 𝐝𝐞𝐭𝐚𝐢𝐥𝐬
    𝐖𝐞𝐛𝐬𝐢𝐭𝐞 : trendytech.in/...
    I have trained over 20,000+ professionals in the field of Data Engineering in the last 5 years.
    In this session we have talked about following things
    TABLE OF CONTENT
    0:53 Create student table
    11:30 Insert seed data in a student table
    17:00 Create courses table
    19:10 Insert seed data in a courses table
    22:00 Create relationship among students and courses table
    26:50 Foreign Key
    34:20 Delete from courses table, If dependent record exists it will give error.
    36:15 Theory definition of Foreign Key
    41:00 Check constraints
    𝗝𝗼𝗶𝗻 𝗺𝗲 𝗼𝗻 𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:🔥
    🔅Sumit LinkedIn - / bigdatabysumit
    🔅Sumit Instagram - / bigdatabysumit
    #SQL #RDBMS #database #bigdata #dataengineering

КОМЕНТАРІ • 147

  • @sumitmittal07
    @sumitmittal07  2 роки тому +1

    Checkout the Big Data course details here: trendytech.in/?referrer=youtube_sql6

  • @pridename2858
    @pridename2858 Рік тому +7

    Hi guys, its shame that this wonderful SQL series has around 2k thumbs up only. Remember to this Teacher Mr Sumit..he input his soul, hard core efforts by heart, he is trying to work for your success for your career progression by providing this specific skill free of cost. Guys, please be honest to yourself and make this 2k to 200K,I believe it worth more than that. I am earning 100K in $ just because this guy Mr. Sumit, no brainer you are earning or soon will get more than me. Hope you will respect Mr. Sumit genuine efforts for you.

  • @mmartel02
    @mmartel02 2 роки тому +37

    Recommendation for students following along. At this point in the course, you should avoid dropping and recreating tables when altering the structure of your tables - this isn't a good representation of what you'd do in a real world setting. Take this opportunity to practice your ALTER/ADD/DROP/MODIFY/CHANGE commands to make the changes needed to your existing table.
    For Example, you can add a foreign key to the selected_course column with the following command:
    ALTER TABLE students ADD FOREIGN KEY (selected_course) REFERENCES courses(course_id);
    Thank you for the great content Sumit!

    • @navneet2649
      @navneet2649 2 роки тому

      First of all thanks so much for ur comment. It really helps to know different perspective! 👍👍💖💖

    • @navneet2649
      @navneet2649 2 роки тому +1

      @21:05 there is a issue which I am facing while going for what u said, here we are wanting to add a column named 'selected_course' in the table, but if I use the " *ALTER* TABLE students *ADD* COLUMN selected_course INT;" then the system is adding this new column in the last of my table, but if we go for DROP TABLE and CREATE TABLE then we can decide where to place this new column, so pls guide!

    • @navneet2649
      @navneet2649 2 роки тому

      In Session 4 of this course, we have learned abt ADD, DROP and MODIFY but then what is CHANGE, it didnt come till now!! ??

    • @mmartel02
      @mmartel02 2 роки тому +1

      Use AFTER {column_name} after your ADD COLUMN command

    • @mmartel02
      @mmartel02 2 роки тому

      Modify and change have the same function except change allows you to rename the column whereas modify does not

  • @asifbhat3796
    @asifbhat3796 Рік тому +1

    this is called real teaching. Other big tech education giants are just reading from the book and paste it on slides .

  • @mdhasib1844
    @mdhasib1844 Рік тому +2

    Thank you sumit sir for your effort. Its been 6 days since I am watching your SQL series and I would say; your teaching style is fantastic.

  • @venkataabhilash5356
    @venkataabhilash5356 2 роки тому +6

    This session will say how you different from other trainers..really nice explaination

    • @sumitmittal07
      @sumitmittal07  2 роки тому +3

      Thank you and hope you would like the upcoming videos as well :)

  • @priyankachoudhary934
    @priyankachoudhary934 Рік тому +1

    One of the best explanation of Foreign Key. Cleared the vision of FK.

  • @optionkingrobot
    @optionkingrobot 2 місяці тому

    Really ................ Awesome feeling at end of this video , BIG SALUTE for such a lovely way of teaching and helping us. Thanks sirji 🙏🙏

  • @UMERohanVerma
    @UMERohanVerma 8 місяців тому

    Sir I really appreciate the amount of hard work done and time spent to put all these concepts and materials together and creating this playlist.
    Hats off

  • @idiotengineer1012
    @idiotengineer1012 Рік тому

    It's really good session that mean person will realise what is SQL and how it works... I specifically suggest to all watch this playlist of SQL to learn..

  • @user-kf6gw6eo2n
    @user-kf6gw6eo2n Рік тому

    Very useful session however 7 seven years i came to know the actual things on foreign key. Thanks a lot Sumit Sir.

  • @jimitshah7636
    @jimitshah7636 2 роки тому

    Best explanation of foreign key available on the internet!

  • @amritmanash7950
    @amritmanash7950 Рік тому

    One of the best way to explain foreign key thank you so much sumit sir for this sql free course on UA-cam

  • @shashankseth3041
    @shashankseth3041 Рік тому

    In production it's not a good practise to drop the table always to make any changes like adding foreign key or modifying schema so let's say you already have student table and now you have added course table and you want to add the enrolled_course column in students table and enter the courses they enrolled for then you will go in this way in production environment.
    Two important things table on which you applying foriegn key is child table and from the table you are pullying or taking reference of this foreign key is parent table
    First add enrolled_course column in student table by below command
    1) alter table students add column enrolled_course int not null;
    Now apply foreign key on this column by below command
    2) alter table students add foreign key (enrolled_course) references course(course_id);
    Here the catch is if there is already data in course_id in course table but as of now the enrolled_course column in the student table is blank system will not accept this command and it will throw error
    Error Code:1452 cannot update or add a child row: a foreign key constraint fails
    So to overcome this error first you will disable the foreign key checks by running the below command
    3) set foreign_key_checks = 0;
    (0 means disabled 1 means enabled if want to enable again then you can run it again by giving 1)
    Now after running this command run the above command 2 again it will work
    Now you want to modify/enter the values in multiple rows for students for enrolled_course field so to modifu values in multiple rows you'll run the below command
    update students
    set enrolled_course = (case when student_id = 1 then 3
    when student_id = 2 then 1
    when student_id = 3 then 1
    when student_id = 4 then 3
    when student_id = 5 then 2
    when student_id = 6 then 3
    when student_id = 7 then 6
    end)
    where student_id in (1,2,3,4,5,6,7);
    which means student with id 1,4 and 6 enrolled for course 3, with id 2,3 enrolled for course 1 and with id 5 enrolled for course 2 and with id 6 enrolled for course
    Also when you will do desc student to see the structure of student table
    the enrolled_course will show as MUL KEY
    MUL KEY means its integer column and non indexed which means multiple records of same values are accepted in this column
    Now if you keep the command 3
    set foreign_key_checks = 0;
    Like this only when you will do insert for any student with enrolled_course id out of range in course id it will still accept because this check is disable so its advisable to enable it again you can try by inserting any column in student table with course id out of range see it will accept that so enable this again. That's why its mandatory and always advisable to keep this check always ENABLE
    4) set foreign_key_checks = 1;
    After enabling this delete the record you entered above with out of range course_id to verify this check with false course_id to maintain the reference integrity of the table.
    To know more about reference integrity of tables in relational DBMS refer this IBM block
    www.ibm.com/docs/en/informix-servers/14.10?topic=integrity-referential
    Now when you'll enter any record which is out of range of course_id in course table it will throw error

    • @RohanNagnurwar-iv4lc
      @RohanNagnurwar-iv4lc Рік тому

      Hi, I am new to this SQL world, just wanted to ask,with such difficulty to add the data ,why people use SQL?

  • @greatmonk
    @greatmonk Рік тому

    Thank you by explaining FOREIGN KEY in a most simplest way... Awesome. I am loving the sessions and believe me , this helps me too,in my day-to-day work...

  • @govindsinghtomar2003
    @govindsinghtomar2003 7 місяців тому

    Worth it to Watch. Great Explanation by Sumit Sir.

  • @KundanKumar-tu8dj
    @KundanKumar-tu8dj 2 роки тому +1

    Great explanation..thanks sir for wonderful SQL session

  • @lakshyagoel1893
    @lakshyagoel1893 2 роки тому +2

    Amazing explanation of relationship between two tables.Awesome content.

    • @sumitmittal07
      @sumitmittal07  2 роки тому

      Happy that you liked the explanation. Keep watching.

    • @satviktejas8716
      @satviktejas8716 2 роки тому

      WHERE ARE YOU FINDING THE NOTES WHICH SIR IS PREPARING PLZ TELL

  • @kaladharnaidusompalyam851
    @kaladharnaidusompalyam851 2 роки тому +1

    Thank you Sumit 👍 . Initially have doubt on Check . U cleared it at the end

  • @anupamkumar3197
    @anupamkumar3197 Рік тому +1

    create table students(
    student_id int AUTO_INCREMENT,
    student_fname varchar(30) NOT NULL,
    student_lname varchar(30) NOT NULL,
    student_mname varchar(30),
    st_email varchar(30) NOT NULL,
    st_phone varchar(30) NOT NULL,
    st_alt_phone varchar(15),
    enrollment_date TIMESTAMP NOT NULL,
    year_of_exp int NOT NULL,
    st_comp varchar(30),
    batch_date varchar(30) NOT NULL,
    soure_of_j varchar(30) NOT NULL,
    location varchar(30) NOT NULL,
    primary key(student_id),
    unique key(st_email)
    );

  • @vishnujatav6329
    @vishnujatav6329 2 роки тому +1

    Sumit sir, its really really helpful and and its amazing

    • @sumitmittal07
      @sumitmittal07  2 роки тому

      Happy to know that you are finding it helpful.

  • @hemanthp2702
    @hemanthp2702 Рік тому +1

    Could you please share the notepad in all of your lectures, as it will be a great way to refresh the contents and practice ourselves.

  • @sachinrathore7319
    @sachinrathore7319 2 роки тому +1

    Wonderful explanation of foreign key

  • @PROTECHRAHUL
    @PROTECHRAHUL 10 місяців тому

    does this playlist covers Types of Relationship in DBMS?

  • @mariageorge3278
    @mariageorge3278 3 місяці тому

    can we not use ALTER students ADD FOREIGN KEY (selected_course) REFRENCE course (course_id); ? instead of deleting the table and recreating the whole thing?
    for the data part we can use UPDATE command

  • @mayanktaggar456
    @mayanktaggar456 Рік тому +1

    Can you please share the file for the dummy data you are using in this video, please?

  • @GudduKumar-wy1hi
    @GudduKumar-wy1hi 10 місяців тому

    This video is good, but one thing I observed that course fee is high. Please look into this if possible. Since Generally middle class or lower middle class family student go for normal institute otherwise who is capable go for brand.

  • @sangeethapadamata2965
    @sangeethapadamata2965 Рік тому +1

    Best explanation of foreign key that I ever watched.

  • @swastiktripathy8412
    @swastiktripathy8412 2 роки тому

    Very nicely explained which can be easily understand by students. Thank You .

  • @nakulmopari4247
    @nakulmopari4247 2 роки тому +1

    Thank you sir, wonderful waiting for the 5th session

    • @sumitmittal07
      @sumitmittal07  2 роки тому

      this was actually the 5th session.. 6th session will be released tomorrow.

  • @mandakinigiri7493
    @mandakinigiri7493 3 місяці тому

    As for the enrollment date you take the data type as a timestamp then for the batch date why we selected the data type as varchar

  • @mathaliens651
    @mathaliens651 2 роки тому

    Up to the mark explaination of Foreign Key Great!

  • @abhishekkumar-sj2jj
    @abhishekkumar-sj2jj 2 роки тому

    very good explanation of foreign key and it's role

  • @sa2742
    @sa2742 Рік тому

    Thank you

  • @aayushmaan5887
    @aayushmaan5887 Місяць тому

    I am in doubt that while deleting the course_id =2 ,it was throwing error because of data entered in child table .so to delete that is ,do we need to delete first record from child table and then delete the course_id 2 from couse table ?
    Or Is there any other way to do so ???

  • @_AbhiTalks_
    @_AbhiTalks_ Рік тому

    Sir, can you please do a course on excel and python.

  • @abhilashshetty9782
    @abhilashshetty9782 Рік тому

    Simple and Worth watching complete SQL series!
    Sir please do a playlist for Python?

  • @ashwinisingh6251
    @ashwinisingh6251 2 роки тому

    I am in final year and teally enjoying this SQL series

  • @aadhavanmahendiran8074
    @aadhavanmahendiran8074 10 місяців тому

    This session is super interesting. where I can get the class document. especially seed data. it's too huge. previous classes are not that much. so can you share us the seed data sumit sir.

  • @nadeemshaikh5683
    @nadeemshaikh5683 Рік тому

    please share the how important of "underscore" sign during code..You can not use hyphen while coding(for Freshers)

  • @pallavinijamkar7862
    @pallavinijamkar7862 Рік тому

    Thank you Sumit sir this was an awesome session and very well explained where the basic things got pretty clear.

  • @gautamgoswami9510
    @gautamgoswami9510 Рік тому

    sir when I never give any default value then it takes null. not current time stamp in command line then what should I do for use current time stamp

  • @princesinghaniya3625
    @princesinghaniya3625 Рік тому

    hello sir when i try to run timestamp in enrollment_date field its not work its gives me error of 1364 .please guide me in this .

  • @kotagirigopi8106
    @kotagirigopi8106 Рік тому

    Amazing classes 👏👏👏

  • @isharkpraveen
    @isharkpraveen Рік тому

    Nie video... I didnt drop the table.. I just alter the table to add column

  • @gireeshkumarsingh4029
    @gireeshkumarsingh4029 2 роки тому +1

    Great Experience so far.
    I have some doubts sir :-
    1) SQL is not a case sensitive language yet when you asked to describe courses table by giving table name in capital it shows an error??
    2) Why have you given phone no. VARCHAR data type why not INT data type??
    Thank you!!

    • @parthagrawal5516
      @parthagrawal5516 2 роки тому

      I try to type int, No issue, I think sir has taken randomly. we can use int, then no issue.

    • @mmartel02
      @mmartel02 2 роки тому +5

      datatype (INT, VARCHAR, DATE, TIMESTAMP...) and functions (CREATE, ADD, DROP, ALTER, MODIFY, CHANGE, UPDATE, DELETE.....) are not case sensitive. You can refer to them either using upper or lower case; however the industry standard is to use upper case for readability.
      Your Table and Data ARE case sensitive. Table students, STUDENTs and Students would all be different.
      I hope this is clear.

  • @jodu1584
    @jodu1584 Рік тому

    amazing content !!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @rajiv3444
    @rajiv3444 Рік тому

    Thank you Sumith sir 🙏🙏

  • @HarshitSingh-tg9yv
    @HarshitSingh-tg9yv Рік тому

    Does the foreign key in the child table necessarily references to primary key of the parent table? Can it not be any other column of the parent table?

  • @balajibalasubramaniam8349
    @balajibalasubramaniam8349 2 роки тому +1

    THANK YOU SO MUCH SIR

  • @ritumdutta2438
    @ritumdutta2438 Рік тому

    Can you please add "On delete cascade" and "on delete update" concepts for foreign key

  • @smyphysics
    @smyphysics 2 роки тому

    thanks lot for the SQL stuff ..... Rohit sharma joke is nice ...

  • @vansharora1512
    @vansharora1512 Рік тому

    And he been in my sa situation obviously

  • @architkumar1265
    @architkumar1265 Рік тому

    I'm having a doubt, can we update all the records of a particular column at a same time ( Ex: lets say, we have column, "selected course" with the default value, 1, in every record). Now, if we want to change every record's value then can we update all records at same time (with update command) as INSERT command works, (to insert multiple values)..............?

  • @munnalalsharma1752
    @munnalalsharma1752 2 роки тому +1

    Thanks

  • @VishalSharma-il5yd
    @VishalSharma-il5yd Рік тому

    Thankq so much sir for the session

  • @VarunTaliyan
    @VarunTaliyan Рік тому +1

    While creating the "students" table, we have defined enrollment_date as "enrollment_date TIMESTAMP NOT NULL". However, when we describe the table in next query, we can see that Default column says "CURRENT_TIMESTAMP" and Extra column as "on update CURRENT_TIMESTAMP". How does system got to know that there should be a default value for enrollment date and it should take current timestamp on update as well ?
    I tried this on my local mysql installation but I am not getting this behaviour. Am I missing something? Please elaborate.
    Thanks.

    • @boredbanda3168
      @boredbanda3168 Рік тому

      Same here for some reason the default values 'CURRENT_TIMESTAMP' is to be explicitly mentioned while defining table. Else insertion in the table is failing.

  • @ankitgarg1987u
    @ankitgarg1987u Рік тому

    This was really useful

  • @karthika1490
    @karthika1490 Рік тому

    Please do playlist for python. That will be helpful alot for us

  • @nganthoibahidam7282
    @nganthoibahidam7282 2 роки тому

    Hi Sumit Sir,
    unique key assigned while creating a table is not allow in MSSQL, which give an error "Table level constraint doesn't specify column list". KIndly suggest why it is happening.

  • @syedasherahmed949
    @syedasherahmed949 Рік тому

    Field 'enrollment_date' doesn't have a default value. This error is showing although I have checked the data and how can i add in EXTRA update CURRENT_timestamp?

  • @shreyagrawal3806
    @shreyagrawal3806 Рік тому

    Helpful video

  • @sitrakaforler8696
    @sitrakaforler8696 Рік тому

    Great vidéo man !

  • @dhairyashiil
    @dhairyashiil 2 роки тому

    This course is fire 🔥

  • @dilawarjalil8842
    @dilawarjalil8842 Рік тому

    Thanks Sir

  • @keshavsaraswati1472
    @keshavsaraswati1472 2 роки тому +1

    so nicely explained :)

  • @TomJerry-bp9ig
    @TomJerry-bp9ig Рік тому

    Why the foreign key should always point to a "primary key" in parent table, why not any other key?

  • @pawanseth70
    @pawanseth70 2 роки тому

    Thanku very much sir

  • @jackreacher1921
    @jackreacher1921 Рік тому

    where can i get the bulky insert statement for copy paste?

  • @harshvrm100
    @harshvrm100 2 роки тому

    Foreign Key can be constraint the table that don't belongs to our curent database??

  • @nareshkonukati5647
    @nareshkonukati5647 2 роки тому

    Hi sir when I am using pgadmin4 for practice, I didn't get the output for some data

  • @shivampandey240
    @shivampandey240 Рік тому

    can foreign key be refered to unique key in another table

  • @jen4986
    @jen4986 2 роки тому +1

    15:07 I get this error. "ERROR 1364 (HY000): Field 'enrollment_date' doesn't have a default value"

    • @jen4986
      @jen4986 2 роки тому +3

      Difference maybe because I am using command line. So I solved it the following way.
      enrollment_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP
      Thank you for your lectures.

  • @saranshsehrawat8544
    @saranshsehrawat8544 Рік тому

    In MySQL workbench
    enrollment_date TIMESTAMP NOT NULL
    not working. i have to used TIMESTAMP DEFAULT NOW()

  • @anandsingh-pr6rr
    @anandsingh-pr6rr 2 роки тому +1

    thank you sir......one request from sir please share the data that you have used so that we can perform logical operation

    • @mmartel02
      @mmartel02 2 роки тому +2

      Manually typing the commands - while tedious and repetitive - is a great way to familiarize yourself with writing SQL commands. I suggest typing everything manually rather than copy pasting code.

  • @raghavmittal7112
    @raghavmittal7112 2 роки тому

    I had take offline coaching and seen many lectures its been 6 month noone able to teach properly how foreign key used why used first time i understand from non tech background

  • @therisingsinger4330
    @therisingsinger4330 6 місяців тому

    A small suggestion to u sir , aap Etna bada table banake time bahot waste kiye ,small table se v concepts clear ho sakta thaa😅😅...our main goal is to understand foreign key ...

  • @rekharanibaranwal3995
    @rekharanibaranwal3995 10 місяців тому

    Everything is fine but everytime dropping the table is frustrating

  • @vangapandupraveen4352
    @vangapandupraveen4352 Рік тому

    Please share the notes link

  • @swarajkumar9550
    @swarajkumar9550 2 роки тому

    while using timestamp in mySql, the syntax which you are explaining seems to be wrong..and thus values could also no the inserted un their, its saying enrollment date doesn't have a default value.

    • @keshavkarki7775
      @keshavkarki7775 Рік тому

      same with me

    • @gamersassemble539
      @gamersassemble539 Рік тому

      @@keshavkarki7775 @Swaraj kumar Use this : ALTER TABLE students MODIFY enrollment_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP;

    • @raghavrocks94
      @raghavrocks94 Рік тому

      @@gamersassemble539 woooorrkkkedddd !!!

  • @Gautamprakash17
    @Gautamprakash17 2 роки тому

    How to add auto increment in existing mysql table(20:11min)?

    • @sushyyyyyyyy
      @sushyyyyyyyy Рік тому +1

      alter table table_name modify column_name data_type auto_increment;
      eg. alter table student modify column student_id int auto_increment;

    • @Gautamprakash17
      @Gautamprakash17 Рік тому

      @@sushyyyyyyyy ty bro

  • @jagrati2406
    @jagrati2406 2 роки тому

    How to handle this scenario in real world? If we want to discontinue the course_id =2. At the same time, we want to keep the record of all students who have enrolled before but new students shouldn't be able to enroll to this course?

    • @abusadatmohammadsayem1311
      @abusadatmohammadsayem1311 Рік тому

      Or other way around update the course table to exclude course_id=2, then we should be good to go.

  • @abhisheksingh-ij1ho
    @abhisheksingh-ij1ho 2 роки тому

    where we will get these notes

  • @mohitjain6168
    @mohitjain6168 2 роки тому

    I think you should have added the data file (the data of students table) in the description.

  • @thenaveed5195
    @thenaveed5195 2 роки тому

    Can you upload the data and commonds used in this video?

    • @sumitmittal07
      @sumitmittal07  2 роки тому

      Will try including the most important commands in the description if feasible.

  • @BeyourBest1
    @BeyourBest1 2 роки тому

    Error cannot add foreign key constraint

  • @harshrajvaghela699
    @harshrajvaghela699 2 роки тому

    It's true or example data sci ,devops,web delopment

  • @harshrajvaghela699
    @harshrajvaghela699 2 роки тому +1

    How to delete multiple values
    How to update Multiple values

    • @sumitmittal07
      @sumitmittal07  2 роки тому +2

      This will covered in the upcoming sessions.

    • @mmartel02
      @mmartel02 2 роки тому

      Use a WHERE clauses with multiple 'OR' command to catch all the records you would like to update or delete
      For example, you can delete the first two rows of your student table with the following command:
      DELETE FROM students WHERE student_id=1 OR student_id=2;

  • @learntoday7783
    @learntoday7783 Рік тому

    29:00

  • @karthikjesus1519
    @karthikjesus1519 2 роки тому

    sir can we add multiple tables in single database??

    • @sumitmittal07
      @sumitmittal07  2 роки тому

      Yes a single database can have multiple related tables.

  • @VignanMani
    @VignanMani 25 днів тому

    sir can you please share the document

  • @medhabobbili5018
    @medhabobbili5018 Рік тому

    can anyone feel that the sound is too low in the videos ?

  • @mahadevduary3839
    @mahadevduary3839 2 роки тому

    where can i get the pdf or text file of this course

    • @sumitmittal07
      @sumitmittal07  2 роки тому +1

      Strongly advice to make notes while watching videos.

  • @amuladhanunjay7946
    @amuladhanunjay7946 2 роки тому

    Waiting for 📝 notes sir

  • @divyanshujha3908
    @divyanshujha3908 Рік тому +2

    Sir, can you please add a text file containing all the records, so that we can practice the commands ourselves. Thank you

    • @hemanthp2702
      @hemanthp2702 Рік тому

      Let know if you have received it...?

    • @divyanshujha3908
      @divyanshujha3908 Рік тому

      @@hemanthp2702 haven't yet

    • @rajatkhanna9886
      @rajatkhanna9886 Рік тому

      @@hemanthp2702 If you have a txt file for all the commands, can you please provide?

    • @hemanthp2702
      @hemanthp2702 Рік тому

      @@rajatkhanna9886 I am also awaiting this...

  • @rajorshi1000
    @rajorshi1000 2 роки тому +2

    Very well explained . Thanks Sumit sir.

    • @sumitmittal07
      @sumitmittal07  2 роки тому

      Happy that you are finding it easy to understand.

  • @shubhamSharma-du4ir
    @shubhamSharma-du4ir 2 роки тому

    Thank you Sir