If we want to join multiple tables and table names are "personal", "city" and "courses" then we can use below shown sql query : In "personal" table, there are 6 columns named id, name, percentage, age, gender, city. In "personal" table, column name "id" is PRIMARY KEY and column name "city" is FOREIGN KEY. In "courses" table, there are 2 columns named course_id and course_name. In "courses" table, column name "course_id" is PRIMARY KEY. In "city" table, there are 2 columns named cid and cityname. In "city" table, column name "cid" is PRIMARY KEY. If we want to join above three tables then we can use below shown sql query : SELECT * FROM personal INNER JOIN city ON personal.city = city.cid INNER JOIN courses ON personal.city = courses.course_id; If we want to apply alias or short name for table name then we can use below shown sql query : SELECT * FROM pers...
Comments
Post a Comment