The questions can come in any order, so make sure you are selecting right option for all questions.
Select dept_name, dept_id, avg (salary)from instructor
group by dept_name;
This statement is erroneous because
(b) dept_id is not used in group by clause
(c) MAX()
They cannot be used in a ______ clause.
(b) Having, where
(c) with
(b) count(*)
(d) without aggregates
Select count(*) as X from Table_Name Group by column_name
(b) Valid
(b) True
(b) True
Multiple employees were hired on the same date
and you want to see the date only once.
Query - 1
Select distinct hiredate
From hr.employee
Order by hiredate;
Query - 2
Select hiredate
From hr.employees
Group by hiredate
Order by hiredate;
Which of the above query is valid?
(c) Both
How many row(s) are displayed ?
(a) 4
(d) SELECT AVG(salary) FROM instructor
(a) Min(Credits)
(c) Display job wise highest salary only if the salary is greater than or equal to 5000
CUSTOMER_ID NUMBER (4) NOT NULL
CUSTOMER_NAME VARCHAR2 (100) NOT NULL
STREET_ADDRESS VARCHAR2 (150)
CITY_ADDRESS VARHCAR2 (50)
STATE_ADDRESS VARCHAR2 (50)
PROVINCE_ADDRESS VARCHAR2 (50)
COUNTRY_ADDRESS VARCHAR2 (50)
POSTAL_CODE VARCHAR2 (12)
CUSTOMER_PHONE VARCHAR2 (20)
The CUSTOMER_ID column is the primary key for the table.
You need to determine how dispersed your customer base is.
Which expression finds the number of different countries
represented in the CUSTOMERS table?
(d) COUNT(DISTINCT country_address)
Column Name Type Remarks
EMPLOYEE_ID NUMBER From the EMPLOYEES table
EMP_NAME VARCHAR2(30) From the EMPLOYEES table
JOB_ID VARCHAR2(20) From the EMPLOYEES table
SALARY NUMBER From the EMPLOYEES table
DEPARTMENT_ID NUMBER From the DEPARTMENTS table
DEPT_NAME VARCHAR2(30) From the DEPARTMENTS table
Which SQL statement produces an error?
(d) None of the statements produce an error; all are valid.
EMP_ID NUMBER(4) NOT NULL
LAST_NAME VARCHAR2(30) NOT NULL
FIRST_NAME VARCHAR2(30)
DEPT_ID NUMBER(2)
Which statement produces the number of
different departments that have employees
with last name Smith?
(d) SELECT COUNT(DISTINCT dept_id) FROM employees WHERE last_name='Smith';