Learn SQL the right way - session 3 | Primary Key vs Unique Key | Trendytech

Поділитися
Вставка
  • Опубліковано 2 жов 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.
    Primary Key
    Unique Key
    Auto Increment Values
    Primary vs Unique Key
    TABLE OF CONTENT
    2:25 Primary key
    11:00 Auto increment key
    14:00 Unique key
    15:30 Primary key vs Unique key
    𝗝𝗼𝗶𝗻 𝗺𝗲 𝗼𝗻 𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:🔥
    🔅Sumit LinkedIn - / bigdatabysumit
    🔅Sumit Instagram - / bigdatabysumit
    If you're looking to master SQL with real time usecases & looking to crack top product based companies, this tutorial is for you. Just follow through and you'll be able to write SQL queries in no time.
    SQL, short for Structured Query Language, is a language used by software developers, data engineers, data scientists and anyone who works with data. With SQL, you can store data in relational databases and write queries to extract valuable information.
    Even if you are someone who is working on SQL Server, Oracle DB, PostgreSQL or any other relational DB. Then you should be able to use your learning with hardly 5% syntax change.
    #SQL #RDBMS #database #bigdata #dataengineering

КОМЕНТАРІ • 88

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

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

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

      I have been working as a QA automation engineer. would like to update my skill/competency. which course do you suggest for me sir?

    • @traveltv1707-eu7em
      @traveltv1707-eu7em 11 місяців тому

      ​😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊

  • @PriyankaBhatt-m7o
    @PriyankaBhatt-m7o Рік тому

    It is really a very good course. I am learning SQL from your videos and I am loving it. Thank you.

  • @nikhilgupta6803
    @nikhilgupta6803 2 роки тому +19

    waiting for the completion of basics and upcoming advanced concepts of sql sumit sir....excellent work n gift for working professionals.

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

      Thank you Nikhil for those kind words. Motivates me to create more :)

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

      @@sumitmittal07 🙏

  • @akp7-7
    @akp7-7 2 роки тому +3

    sir when primary key is set auto-increment for id and we have a unique key for name ..why for each wrong value for unique key ..the primary key auto increment it self? like my id=1 if i give unique key two times wrong .then 3rd time i gave correct value as per unique key..now my id=4..why not id=2 or 3 because value was not inserted in db and they were wrong as per unique key.

  • @Oisimran
    @Oisimran 2 роки тому +4

    Spark-Sumit Forever😁

  • @narenderreddynarender8970
    @narenderreddynarender8970 2 роки тому +4

    Hello Sumit. Thank you for providing valuable course in tough times. I've followed few channels for SQL and it's always confusing because lot of other flavours of SQL are mixed with it. Hopefully I'll find out complete SQL course and be able to write easy to intermediate queries required for Data Analyst. Thank you again and very good luck to all the viewer's and subscribers of this course 👍🙏🙂

  • @dineshchavan9462
    @dineshchavan9462 2 роки тому +4

    Beyond the ordinary..No words to describe your teaching..it is flawless..

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

    If unique key allow NULL values but if table definition has NOT NULL constraint then would NULL be accepted??

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

    While explaining about unique key ,
    As you said we can have one primary key
    But in composite primary key you used two columns as primary key i.e
    PRIMARY KEY (ID, NAME)
    Then how it is possible ?
    THEN

  • @dlakhaiyar
    @dlakhaiyar 2 роки тому +4

    Sumit Sir makes everything simple, he is a true magician.
    Thank you so much Sir for the SQL couse, I am loving it! ❤️

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

      Pleased that you are liking the SQL series :)

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

    Hi Sumit sir, can you please help with the names of other DB's where multiple null values are not allowed for Unique Key constraint?

  • @akashshirale1927
    @akashshirale1927 5 місяців тому

    If we make the unique key as not null as well, will it behave like primary key?

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

    Sir can you also please do the videos of plsql course please

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

    Wonderful lession sir ...looking forward to go deeper into SQL🙂

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

      Keep following, you will master SQL the right way :)

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

    Sir kar diya subscribe :)

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

    Amazing SQL videos.. finally i have found good channel for SQL

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

    Dont waste money on paid lectures. Trust me , this sql series is better than almost 99.9% of paid lectures.

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

    This is the way of teaching

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

    Where is the notepad document sir

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

    Hello Sir, Good day. Sir , You mentioned about in session 1 you will provide this notepad where you are writing . But this is the 3rd video but i am not able to find any link related about this note.
    if you will provide it will very helpful for us..
    Thank you Sir:)

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

    where i can find this notes

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

    Fall in love with learning SQL

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

    It is rare to find such easy and descriptive session .My suggestion is to go through complete playlist practice along side . It will take some time but trust it will worth it.
    I am one of student of Sumit sir's big data program. The way he explain the concept is just phenomenal.
    Thanks Sumit sir :)

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

    Sir, Auto_increment dint work alone, i had to add Primary Key to it

  • @lakshminarayanavanapalli6769

    Hello sir.....do we have a concept of composite unique key??

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

    Excited for 4th Video

  • @SoumyaChatterjee-o7t
    @SoumyaChatterjee-o7t Рік тому

    @Sumit Sir: If you can share the commands & class notes in the description section that would be really great.

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

    13:45 autoincrement is irrespective of primary key right ? good candidate i didnt get
    🤔

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

    Hi Sumit, i have started this course can you please tell shortcut to paste the code from notepad to the groomIDE workspace as ctrl+V does not work.

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

    Hi Sumit sir,
    From where I can download notes for these seasions

  • @Venom-yk3wu
    @Venom-yk3wu Рік тому

    bt u added two primary keys in the table ? when u said we can add only 1

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

    Hey Sumit can you pls procedures, views, and triggers

  • @AdityaSharma-xh8tg
    @AdityaSharma-xh8tg 2 роки тому

    Sir, based on below screen shot
    here if ID is unique key, then does that mean records 2 and 3 are different, since Null means (we do not know the value) hence records 2 and 3 are distinct? even though they look same, but the records are unique
    Please advise..

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

    Sumit sir ye document provide kardo please

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

    Sir can u give real life scenarios in which only Primary Key can/should be used and in situations where only Unique Key can/should be used? and thanks for the video 👍👍💖💖

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

    When you use auto increment the structure of a table was showing thats the primary key is also active but you are using auto increment how both of them can be use at the same time.

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

    Well described, My 2nd Day of this learning session.

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

    sir combination of unique keys means the same thing as putting the unique key in from of column name?

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

    thank you for the quality course SUMIT SIR

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

    so far the session are upto point, very easy to understand - good work sumit sir 👏

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

    Thx

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

    spr

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

    What is a real life example where a unique key can be used?

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

    Really appreciate your way of teaching sir . Clarity is on next level . Many thanks for your complete SQL play list .

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

    Thanks sumit ! Good job 👍

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

    For Auto Increment key Default it would take 1,2,.... For 1101,1102,.... how can we get this ID's in auto increment. Sumit Sir Could pls tell us ?

    • @SAURABHKUMAR-nn8sl
      @SAURABHKUMAR-nn8sl 2 роки тому

      Insert the first record with id 1101 explicitly eg: INSERT INTO employee(id, fn, ln, age) VALUES (1101, '.....', ....... );
      Then insert normally, no need to specify id in columns, it will auto-increment. eg: INSERT INTO employee(fn, ln, age) VALUES ..... ;

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

    Amazing ❤🔥

  • @RahulKumar-io1fw
    @RahulKumar-io1fw 2 роки тому

    Sir Can we get your notes for sql series it is reallly very helpful

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

    Thankyou Sumit Sir ! Nice tutorials 🙂

  • @SachinSharma-yd1ck
    @SachinSharma-yd1ck 2 роки тому

    Hi Sumit sir, I cannot connect to your LinkedIn account. Please provide a link so that I can connect to you. I need some help so want to get in touch with you. Thanks in advance!

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

    Hi Sir, an amazing journey, I am starting it to sharpen my skills in SQL, without you it wouldn't have possible. Hats of for you Sir.

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

    Hey there, kudos to your great efforts.
    I have a simple enquiry as an newbie sql learner.
    Why cant i have more than one primary key in a single table?
    Thanks for taking care of this.

    • @Naveen-qz1rv
      @Naveen-qz1rv 2 роки тому +1

      Basically its like a roll number of a student.. you can have multiple keys which can uniquely identify records, bt those keys will be candidate key.. one key among them will be chosen as primary key for the table.. And yes, a table xan only have one and only primary key.. they key can be combo of multiple columns, but ony one primary key can exist

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

    Excellent teaching Sumit Sir.

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

      Happy to know that you are enjoying my teaching :)

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

    when I create table in this format and then describe the table it shows id as primary key although I have specified it as UNIQUE KEY, if you could please tell the reason behind this..
    create table employee
    (
    id int UNIQUE KEY AUTO_INCREMENT,
    firstname varchar(20),
    lastname varchar(20),
    age int NOT NULL
    );

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

      if this happened because of the auto increment then what if want to use auto increment with unique key.

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

      @@swarajkumar9550 create table employee (
      id int AUTO_INCREMENT,
      firstname varchar(20),
      lastname varchar(20),
      age int NOT NULL,
      UNIQUE KEY (id)
      );

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

    Thank you sir🙌

  • @VinaySingh-op1el
    @VinaySingh-op1el Рік тому

    Thank you so much sir

  • @fitking1234
    @fitking1234 5 місяців тому

    Amazing Lecture

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

    You are doing an excellent work sir. Keep it up.

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

    Why u r dropping table, can't we use alter /update table?

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

      We can definitely use alter as seen in session 4... However Update is to update the record but not the structure.

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

    Sir, your way of teaching is amazing.

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

    Hello Sir, Can we auto-increment Unique Keys?

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

      yes we can have it , but no meaning to do as we do it for primary key just to ensure if we have duplicate records then also we can distingiush between them.

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

    Great video SIr!

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

    You are the best

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

    excellent

  • @AdityaSharma-xh8tg
    @AdityaSharma-xh8tg 2 роки тому +1

    Hi Sir,
    Thank you very much for this video, I have a question here which others might have as well:
    Primary key (FirstName,LastName) is this same as FirstName varchar(20) Primary Key,
    LastName Varchar(20) PrimaryKey, will the sql editor accept the second statement? Since you said there is only one Primary key but we can have combination of 2 columns as Primary Key? Looking at the schema if there are more than 1 column with Primary key, should we say that Primary key was imposed on the combination of those columns?

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

      Hi Aditya , have you got the answer for it, if please can you replay it! thanks

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

      hey they are not same PRIMARY KEY(...) will work but second one will not work you can try maybe because if we give it for seperate columns, then this statement will be wrong like we can have only one primary key

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

    I am a working professional and loved your teaching methodology. Is there a way to get the running notes you are creating during the videos? @Trendytech Insights

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