Rate this paper
  • Currently rating
  • 1
  • 2
  • 3
  • 4
  • 5
0.00 / 0
views 1383 | downloads 827
Paper Topic:

Structured /query

How does querying multiple tables differ from querying a single table using SQL ? Give specific examples of the differences in the main parts of a SELECT statement

Suppose we have two tables Person and as

PID Last_Name First_Name Address City

1 Steve Ola Timoteivn 13 Sandnes

2 Mark Tove Borgvn 29 Sandnes

3 Mary Kari Storgt 10 Stavanger OID _No PID

1 73325 3

2 44532 3

3 12346 1

4 23465 1

5 39874 15 For knowing person details only Person table will be queried

p SELECT Last_Name , First_Name

FROM Persons

For querying multiples table , we put table name before column name (table_name .column_name ) in main part of SELECT statement

SELECT Person .Last_Name , Person .First_Name ._No

FROM Person

Discuss the types of joins you might need for the Video Store database

SQL joins are used to query data from multiple tables (two or more based on a relationship between certain columns in these tables (primary key and foreign key . The types of joins I might need for the Video Store database are

Inner Join : It will return rows when there is at least one match in both tables

Left Join : It will return all rows from the left table , even if there are no matches in the right table

Right Join : It will return all rows from the right table , even if there are no matches in the left table

Full Join : It will return rows when there is a match in one of the tables

Reference...

1 pages
35.5 KB
Free sing-up

Not the Essay You're looking for? Get a custom essay (only for $12.99)