Following script is given to you at Google Classroom. Run script to generate tables in
Oracle APEX.
EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
DEPT (DEPTNO, DNAME, LOC)
SALGRADE (GRADE, LOSAL, HISAL)
INSTRUCTOR: HAROON SHAHZAD 2
After setting up all relations, you need to apply following queries to get data from given
relations: (Write queries and also paste screenshots in answer file)
i. Give data of all employees whose salary is greater than 5000.
ii. Give only those departments name whose deptno is 30 and Location is New York.
iii. Display the employee name, job id and start date of employees hired between February
20, 1998 and May, 1, 1998. Order the query in ascending order by hire date.
iv. Display the data of all employees who do not have managers. (means whose managers
are null)
v. Display the names of all employees where the third letter of the name is ‘a’.
vi. Write a query to display all employee records who have been hired in month February.
vii. Give all employees records who have salary in between 1000 and 2000 (both included)
viii. Get all employee names whose name second letter is ‘A’.
ix. Retrieve all employees records who doesn’t take commission.
x. Get all employees records who work as ‘CLERK’.
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps
- The FOREIGN KEY constraint should be added to which table? ( refer to the tables in the JustLee Books database). a. the table representing the "one" side of a one-to-many relationship b. the parent table in a parent-child relationship c. the child table in a parent-child relationship d. the table that doesn’t have a primary keyarrow_forwardTask 6: The Car Maintenance team considered that the available maintenance tasks should also have the price information in the database. Alter the MAINTENANCE_TYPES table to include a new column named MAINTENANCE_PRICE of type FLOAT. ANSWER IN MYSQL PLEASEarrow_forward14. How many records are created when you apply a Cartesian join (Cross join) to the invoice and invoice items table? 1. The following diagram is a depiction of what type of join? a. Inner Join b. Full outer join C. Left join d. Right join 16. Select which of the following statements are true regarding inner joins. (Select all that apply) a. There is no limit to the number of table you can join with an inner join. b. Performance will most likely worsen with the more joins you make Inner joins retrieve all matching and nonmatching rows from a table d. Inner joins are one of the most popular types of joins use 17. Which of the following is true regarding Aliases? (Select all that apply.) a. Aliases are often used to make column names more readable b. SQL aliases are used to give a table, or a column in a table, a temporary name. An alias only exists for the duration of the query. 18. What is wrong with the following query? SELECT Customers.CustomerName, Orders.OrderID FROM LEFT JOIN ON…arrow_forward
- Task 5:The marketing team wants to celebrate the success of StayWell with a party. The team wants a table with the names of all residents and owners combined into single column named PARTICIPANT. You need to combine this information from the tables and send it back to the team. You do not need to create a new table in the database schema. I found the answer but it wroten on paper so its really hard to understand what it is, that's why I am posting this question again.arrow_forwardJOIN TABLES One row in the PAT_ENC table represents one patient encounter. One row in the ORDER MED table represents one medication order. One patient encounter can have many medication orders but one medication order can only have one patient encounter. In other words, the cardinality of this PAT_ENC to ORDER_MED relationship is one-to- many. You start a query with PAT_ENC. You then add ORDER_MED using an inner join. What is true about the granularity of the result set before and after adding the ORDER_MED table? SELECT ONE OF THE FOLLOWING A. The granularity stays at one row per patient encounter. B. The granularity stays at one row per medication order. C. The granularity changes from one row per patient encounter to one row per medication order on an encounter. D. The granularity changes from one row per medication order to one row per patient encounter.arrow_forwardOpen the Missing Addresses query in Design view. Add a new column to determine if a customer does not have an address on file. If the customer’s Address is null, it should display Missing. If not, it should display nothing. Name the column AddressPresent. Add criteria of Missing to the column you just created, so only the customers missing an address display. Move the AddressPresent field so it appears between PhoneNumber and Address. Run the query. Ensure only customers with null Address fields display. Save and close the query.arrow_forward
- q16arrow_forwardPLZ help with the following: 1. Populate every relation with “sufficient” representative rows (at least 4 for each table). Create table book (title varchar(80) not null, year INT not null , num INT primary key , subject Varchar(50) null); Create table client (CID int primary key,fname varchar(20), lname varchar(20), type varchar(6), constraint checkclient check (type in ('Faculty', 'Student'))); Create table author (year INT, ID INT primary key, fname varchar(50) not null,lname varchar(50)); Create table BookAuthors(booknum int, authorID int, primary key (booknum, authorID), constraint fk_book foreign key (booknum) references book(num),constraint fk_author foreign key (authorid) references author(id)); create table bookcheckouts( booknum int, clientID int, checkoutdate date, expectedDuedate date not null, returnedate date, primary key (booknum, clientID, checkoutDate),constraint book_checks foreign key(booknum) references book(num),constraint book_clients foreign key…arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY