Querying Multiple Tables with SQL

Поделиться
HTML-код
  • Опубликовано: 24 сен 2016
  • Demonstration of how to query two or more tables with SQL Server.
  • НаукаНаука

Комментарии • 68

  • @dzunisanithemba99
    @dzunisanithemba99 16 дней назад +1

    Thank you for the simplicity.

  • @BudGooey
    @BudGooey 5 лет назад +11

    This is the first link out of about twenty different pages that actually helped me solve my issue.

    • @Southwestmo
      @Southwestmo 3 года назад

      Can you select the primary id itself?

  • @reghuk
    @reghuk 4 года назад +1

    Thank you man, you're a Gentleman and a scholar!

  • @anujdhumal9114
    @anujdhumal9114 4 года назад +1

    thank you very much for this video, i was stuck at one query ,and searched many videos and finally find accurate concept.

  • @sanjeevKumar-eg6hp
    @sanjeevKumar-eg6hp 3 года назад +3

    Thank you sir for wonderful explanation, It was very clear and anyone who watches the video can
    easily understand the concept
    It helped solve one of major obstacle in sql

  • @MXVMichael
    @MXVMichael 2 года назад +1

    I’m going to give to a try when I get to work 👍🏾👍🏾👍🏾Thanks buddy!

  • @babakiani
    @babakiani 3 года назад +1

    Thank you Larry! This content was really useful!

  • @115advitiya
    @115advitiya 3 года назад +1

    You really saved my behind with this video

  • @rodrigoalejandrogallardoga5812
    @rodrigoalejandrogallardoga5812 5 лет назад

    THANK YOU, very helpful and nicely explained.

  • @oatie4262
    @oatie4262 2 года назад +3

    Can't believe this only has 752 views when the content is so good. Thank you so much, this is waaaay clearer than what I was learning in school! Sharing it with my classmates!

  • @julianmac
    @julianmac 3 года назад +1

    Thanks, actually helped me so much.

  • @jansen6583
    @jansen6583 5 лет назад

    Thanks man I was wondering why my query was taking so long.

  • @i_declare_bankruptcy686
    @i_declare_bankruptcy686 2 года назад +4

    I think learning stuff on RUclips must be considered formal learning and I should be able to add that I know something I learnt from a RUclips tutorial on my resume.👌😂

  • @TheSQLGuy
    @TheSQLGuy 5 лет назад

    Great video! Really informative

  • @reeceytaylor
    @reeceytaylor 6 лет назад +2

    thanks, this helped me a lot

  • @drdoughnut38
    @drdoughnut38 5 лет назад +1

    You're a beast this is exactly what I needed!!

  • @kienolaliwatari9610
    @kienolaliwatari9610 2 года назад +1

    Thank you so much for this, it was really informative and helpful

  • @readysetsuccess
    @readysetsuccess 2 года назад

    Just in time learning. Thanks!

  • @AbinashMishra
    @AbinashMishra 3 года назад

    awesome keep going larry we need you, searched everywhere got a good explanation here. Eggactly what I need \m/ a 2016 video helping in 2021

    • @Alfredo5883
      @Alfredo5883 3 года назад

      Same here. People should do more tutorials on DML, bcos thats the core of having to learn sql

  • @smurfmoniquii
    @smurfmoniquii 4 года назад

    You are a lifesaver thanky ou!!!!

  • @tonystites2134
    @tonystites2134 6 лет назад

    how do you create a new table from that I tried Create Table tablename AS but it did not work

  • @KumarAnalytic
    @KumarAnalytic 5 лет назад

    Thanks sir.good explained

  • @ecxlv
    @ecxlv 4 года назад

    brilliantly explained sir

  • @balajir4448
    @balajir4448 5 лет назад +1

    Thank you, very useful

  • @ayanshaikh4993
    @ayanshaikh4993 Год назад +1

    Thanks Larry

  • @vamsireddy5051
    @vamsireddy5051 5 лет назад +1

    What about performance if you are using where conditions and join conditions?
    We know joins performance is good compare to where condition.
    Please let us clarify.

  • @januarekosubagio5525
    @januarekosubagio5525 7 лет назад +1

    in my case, I have 12 tables and I don't know how to join these tables.
    it looks simple but it is also complicated. I hope you can help me with this, anyway you did a great job keep it up sir !
    thanks

    • @reeceytaylor
      @reeceytaylor 6 лет назад

      you have to select your data and then when using the FROM query you type in the tables like this: FROM table 1, table 2, table 3 etc.

  • @EuanMcG
    @EuanMcG 3 года назад +1

    You are my hero

  • @wastedart1794
    @wastedart1794 3 года назад +1

    Thx you Larry this is definetly getting me in the rigte direction, but im trying to join for tabels its very hard, to get them connected or maybe i just need to improve myself, thx you anyway :)

    • @LarryDomine
      @LarryDomine  3 года назад +1

      It may not be you. Writing good SQL statements is dependent upon having a well designed database. The better the design the easier it is to retrieve the data. Checkout my video on using JOIN statements: ruclips.net/video/d3e0TtPswN0/видео.html

    • @wastedart1794
      @wastedart1794 3 года назад

      @@LarryDomine i will I agree I had to rework my dB and It fixed it all 😁 so now I am hammered, the problem got solved

  • @fitsumarja5865
    @fitsumarja5865 2 года назад +1

    thanks for your commitment and i would like to ask a question. which is when i execute exact same command(esp. the first one) it only fetches the column names only.

    • @LarryDomine
      @LarryDomine  2 года назад

      Data has to be in the table to be able to obtain anything more than the column names. Run some INSERT INTO statements to insert data into the tables.

  • @harinath8938
    @harinath8938 2 года назад +1

    good explanation very useful, but can you explain same as well as with 3 or more tables

    • @LarryDomine
      @LarryDomine  2 года назад

      Glad this video helped. The same sequence can be applied to more tables in a 'stacking' configuration. The key is to remember that you are taking data from a table to create its own virtual table that is used by another join statement. If there are a lot of joins to stacked, it may be due to a poor database design. Here is a link that may help you understand this process: codingstatus.com/sql-join-4-tables/

  • @soldadopreciso
    @soldadopreciso 5 лет назад +2

    how enable ssms to see two result tables in the same windows

    • @craigbaggley6047
      @craigbaggley6047 4 года назад

      1. Select * from
      2. Select * from
      Highlight both and execute.

  • @jaysanghavi8248
    @jaysanghavi8248 4 года назад

    Tysm☺️

  • @surabhisunil21
    @surabhisunil21 4 года назад

    is it possible to give a user defined column in jdbc?

    • @LarryDomine
      @LarryDomine  4 года назад

      Kind of....It is all about what data is needed in the relational database.
      A 'user defined column' is often a column in a relational database table where the user can enter any data they would like, as long it is of the correct datatype for the column.
      In a relational database management system, the importance is to collect data that can be queried to provide information. This then relates to collecting facts, such as name, address, income, favorite color, etc.
      There are times when data associated with an entity may not be easily defined, such as comments, opinions, analysis, etc. The data to be input to this column would not be easily defined answers are what can be considered a 'user defined column'.

  • @danielflamebrown5426
    @danielflamebrown5426 3 года назад

    Thank you...

  • @fahadm3444
    @fahadm3444 6 лет назад

    I am trying to pull data from three tables but running into a relation issues.
    Table1: Customer Table.
    Table 2: Invoice Table
    Table 3: Invoice Detail Table
    On table 1 the customer number column is "BPCNUM_0"
    On Table 2: The customer number column is "BPR_0"
    On Table 3: The customer number column is "BPCINV_0"
    Any idea how I can connect them to pull the data?

  • @sltech837
    @sltech837 3 года назад

    Good video

  • @jamarwilson3592
    @jamarwilson3592 2 года назад +1

    Can someone help me? at 5:25 he creates a - function next to select that corresponds to the block of code. How do I incorporate that? At the moment I can only answer 1 query.

    • @LarryDomine
      @LarryDomine  2 года назад

      At the point in the video more SQL statements are being used, not a function. Here is another video with an overview of SQL Statements ruclips.net/video/jWX78wsJMK0/видео.html

  • @cd78
    @cd78 5 лет назад

    Larry do you still have visibility over these comments

  • @umangternate
    @umangternate 3 года назад

    Can this method be applied to update and delete data from multiple tables?

    • @LarryDomine
      @LarryDomine  3 года назад +1

      Kind of.... Keep in mind that UPDATE and DELETE have their own syntax requirements. Here is an example I found from someone else to consider. stackoverflow.com/questions/2044467/how-to-update-two-tables-in-one-statement-in-sql-server-2005

  • @jbhargav7181
    @jbhargav7181 2 года назад

    Can we use IN operator by using two tables

  • @nileshmandlik9662
    @nileshmandlik9662 2 года назад

    more videos like this

  • @pratibhalohiya9874
    @pratibhalohiya9874 2 года назад

    i have a ques that we create one database and in one database we can create only one table . how ur database productorder included soo many tables ...???

    • @LarryDomine
      @LarryDomine  2 года назад

      One possible reason is you may not have permission to create tables in the database management system you are using. Check that out.
      If you have authority to create tables, you can use the tools in the database management system software, or you can write CREATE statements.
      docs.microsoft.com/en-us/sql/relational-databases/tables/create-tables-database-engine?view=sql-server-ver15

  • @yeyeTF2
    @yeyeTF2 4 года назад +5

    starts at 4:05

  • @gamer4lyfez325
    @gamer4lyfez325 5 лет назад

    why would you force 1080p ??

  • @Myself_9037
    @Myself_9037 11 месяцев назад +1

    I have a doubt. I have table with two fields, one field is array in table 1
    uID | Contact
    2 | 1221,1223
    3 | 1123
    Now value of 1221 and 1223 are in table Two. I want a query to join table 1 and table 2 using array of field2

    • @LarryDomine
      @LarryDomine  11 месяцев назад

      Not sure what it is you need to do. A JOIN is based upon joining tables based upon a the data in a common field (normally a primary key and foreign key). This creates a 'virtual table'. separate

    • @LarryDomine
      @LarryDomine  11 месяцев назад

      Here is a link with more information: dataschool.com/how-to-teach-people-sql/sql-join-types-explained-visually/

  • @itreportcambodia8283
    @itreportcambodia8283 3 года назад

    hello b

  • @pulkitlanjewar8454
    @pulkitlanjewar8454 2 года назад

    Description
    There are 2 datasets present in the file. Data 1 and Data 2
    The primary key for both data1 and data2 is Order Id + Product ID combination (i.e. the individual datasets do not have any duplicate on this combination)
    Provide solution and approach for the following:
    How to identify the Records (Order ID + Product ID combination) present in data1 but missing in data2 (Specify the number of records missing in your answer)
    How to identify the Records (Order ID + Product ID combination) missing in data1 but present in data2 (Specify the number of records missing in your answer)
    Find the Sum of the total Qty of Records missing in data1 but present in data2
    Find the total number of unique records (Order ID + Product ID combination) present in the combined dataset of data1 and data2
    Allowed Tools SQL

  • @arslanali1346
    @arslanali1346 3 года назад +1

    Please I have a few questions which I need help with.
    For these I have the tables ready but I am not sure if my queries are right. All the tables that I need are in section 1 which are done and completed. But for the queries from these tables are so confusing. I want to show you what I have done could you please show me if they are right . Please reply me if you can help me. I will send you all the queries I have done in the morning if you are ready to help me. Thank you
    God bless you.
    Kind regards
    Arslan

    • @LarryDomine
      @LarryDomine  3 года назад +2

      The demonstration in the video is for simple SELECT statements for use with mulitiple tables. When writing a query (SELECT statement) always work in reverse. Start with what data you would like to see as the result of the data. Then identify what table(s) this data will come from. This works for most queries in a well defined database. However, evaluate if this data and the tables they are in will need other types of Joins, Unions, or Sub Select statements from which to take the data from. Here is a link that I found that may help provide further information: www.essentialsql.com/a-case-study-on-how-to-use-joins-subqueries-and-unions-to-combine-data-in-sql/

    • @osoriomatucurane9511
      @osoriomatucurane9511 4 дня назад

      Awesome tutorial, crystal clear and concise. Thank you for the tutorial, specially for the trick to identify the matching column keys from the explorer windows and for the link to EssentialSQL with an interesting query. Kris Wenzil is a phenomenal SQL instructor