DEV Community

Durga Pokharel
Durga Pokharel

Posted on

Day 28 Of 100DaysOfCode: SQL Join Operation

Today I learned more about relational database. Also worked on SQL. Did the operation like SQL insert, SQL delete, SQL update, sorting with ORDER by. Also learned basic of database model, database design, building a database model.

Worked on table having multiple column, learned about relational power and join operation using (ON, without ON). I learned these from Coursera.

SQL Join Operation

SQL uses the JOIN clause to reconnect tables. In the JOIN clause we specify the fields that are used to reconnect the rows between the tables.

The following is an example of a SELECT with a JOIN clause:

SELECT * FROM Follows JOIN People
    ON Follows.from_id = People.id WHERE People.id = 1
Enter fullscreen mode Exit fullscreen mode

The JOIN clause indicates that the table1 we are selecting cross both the table1 and table2 tables. The ON clause indicates how the two tables are to be joined: Take the rows from table1 and append the row from table2 where the field from_id in table1 is the same the id value in the table2 table.


Day 28 of #100DaysOfCode and #pythoncode
* Learned about relational database
* More about SQL
* SQL insert, delete, update, select, sorting with ORDER by
* The join operation#100DaysOfCode, #CodeNewbie , #beginner pic.twitter.com/Lwxxr6BXZ6

— Durga Pokharel (@mathdurga) January 21, 2021

Top comments (0)