Discuss how NULLs are treated in comparison operators in SQL. How are NULLs treated when…
- User
Discuss how NULLs are treated in comparison operators in SQL. How are NULLs treated when aggregate functions are applied in an SQL query? How are NULLs treated if they exist in grouping attributes? 2. Define the five basic relational algebra operations. Define the Join, Intersection, and Division operations in terms of these five basic operations with examples. 3. Discuss the differences between the five Join operations: Theta join, Equijoin, Natural join, Outer join, and Semijoin. Give examples to illustrate your answer. 4. There are different types of join operations that can be used to retrieve data, based on different relations. Describe the relation between theta and equal join 5. Describe the relations that would be produced by the following relational algebra operations: 6. Using relational algebra, produce a report of all employees from the IT and planning departments who are born after 1990. The following tables form part of a database held in an RDBMS:
- Assistant
- User
Using relational algebra, produce a report of all employees from the IT and planning departments who are born after 1990. The following tables form part of a database held in an RDBMS: Employee(empNo, fName,lName,address, DOB,sex,position,deptNo) Department(deptNo,mgrEmpNo) Project(projNo, projName,deptNo) WorksOn(empNo,projNo,dateWorked,hoursWorked) Formulate the following queries in relational algebra, tuple relational calculus, and domain relational calculus. a) List all employees. b) List all the details of employees who are female and born after 1990. c) List all employees who are not managers and are paid more than $1500. d) Produce a list of the names and addresses of all employees who work for the IT department. e) Produce a list of the names of all employees who work on the SCCS project. f) Produce a complete list of all managers who are due to retire this year, in alphabetical order of surname. g) Formulate the following queries in relational algebra. h) Find out how many managers are female. i) Produce a report of all projects under the IT department. j) Using the union operator, retrieve the list of employees who are neither managers nor supervisors. Attributes to be retrieved are first name, last name, position, sex and department number
- Assistant
Relational Algebra:
a) List all employees: π empNo, fName, lName, address, DOB, sex, position, deptNo (Employee)
b) List all details of employees who are female and born after 1990: σ sex='female' ∧ DOB > 1990 (Employee)
c) List all employees who are not managers and are paid more than $1500: σ position ≠ 'manager' ∧ salary > 1500 (Employee)