DBA Assessments
DBA Assessments
Assessment 1
1. There are two rules which need to be satisfied in order to perform a union, intersect, and
accept in SQL. First, it must be made sure that the number as well as the order of the
columns must be the same in all queries. And lastly, the data types must also be
compatible.
2. An inner join must be used in order to display only all the matching records from 2 tables in a
database.
3. There will be a total of 30 records that will be produced in a cross join of one table with 5
records to a second table with 6 records.
4. Inner joins are advisable to use when a user wants to show only the matching records of
joined tables. Meanwhile, an outer join is supposed to be used when a user wants to display or
return rows from tables regardless if they match or not.
5. The main difference between these two joins is that the left join includes all the records from
the left side even if it does not exist in the right table. On the contrary, the right join returns all of
the rows from the right side regardless if it exists in the left table.
Activity
4. A. INTERSECT
SELECT DISTINCT EMPNO
FROM EMPLOYEE
WHERE DATEHIRED > '2018-12-31' &&
EMPNO IN ( SELECT EMPNO FROM EMPEVALUATION
WHERE RATING >= 90 && RATINGPERIOD = 'FY2019' );
B. JOIN