Enterprise systems assignment

Enterprisesystems assignment

Q1)An inner join returns the all the rows between two tables based on amatching column whereas an outer join returns all the rows from thetwo tables whereby if in table one does not have a matching column intable two null is returned and vice versa.

Aright join returns all rows from the right table together with thematching columns from left table and null for no values

Aleft join returnsall rows from the left table together with the matching columns fromright table and null for no values

Usingthe patients and Admissions table below illustrates outer join, innerjoin, left join and right join.

Example:

PatientsTable (left table)

Patient_id#

fname

sname

Age

1

kayeli

dennis

25

2

michael

Jaroya

26

3

Norbert

Auma

23

Admissionstable (right table)

Patient_id#

admission_id#

Admission_date

2

5

26-July-15

4

2

27-july-15

inner_join

Select* from Patients inner join Admissions onPatients.Patient_id=Admissions.Patient_id

Returnsthe rows given matching columns

Patient_id#

admission_id#

fname

sname

Age

Admission_date

2

5

michael

Jaroya

26

26-July-15

Outerjoin

Select* from Patients full outer join Admissions onPatients.Patient_id=Admissions.Patient_id

Returnsall the rows from both tables and null if there is no matchingcolumn.

Patient_id#

admission_id#

fname

sname

Age

1

kayeli

dennis

25

2

5

michael

Jaroya

26

3

Norbert

Auma

23

4

2

Rightouter join

Select* from Patients right outer join Admissions onPatients.Patient_id=Admissions.Patient_id

Returnsall rows from the right table together with the matching colums fromleft table and null for no values

Patient_id#

admission_id#

fname

sname

Age

Admission_date

2

5

michael

Jaroya

26

26-July-15

4

2

27-july-15

Leftouter join

Select* from Patients left outer join Admissions onPatients.Patient_id=Admissions.Patient_id

Returnsall rows from the left table together with the matching colums fromright table and null for no values

Patient_id#

admission_id#

fname

sname

Age

Admission_date

1

kayeli

dennis

25

2

5

michael

Jaroya

26

26-July-15

3

Norbert

Auma

23

Q2)

Sale#

RA#

Applied

Amount

Cust#

SalesRep#

S-2

RA-1

1666

10000

21 July

C-2

E-10

S-4

RA-2

10000

10000

26 July

C-2

E-10

S-1

RA-3

7200

7200

1 July

C-1

E-12

S-3

RA-4

16000

16000

22 July

C-5

E-10

S-5

RA-5

16600

16600

31 July

C-5

E-10

S-2

RA-6

1666

10000

21 July

C-2

E-10

Q3)

  1. Resource is usually the information about the goods or products being promoted. Internal agents are the sales/marketing personnel or customer service representatives. External agents are the customers

  2. Resources are labor, inventory and temporary use of asset. Internal agents are the sales/marketing personnel or customer service representatives. External agents are the customers.

  3. Resources vary among businesses. They include inventory and temporary use of asset that is rental. Internal Agents are typically purchasing agents and receiving clerks. External Agents are typically suppliers or vendors

  4. Resource is typically cash that is a list of cash accounts owned by the enterprise. Internal agents are the cashiers, accounts receivable clerks and other financial personnel. External agents are usually the customers and the clients.

Q4)