Test Your Basic SQL Skills

Which is a character manipulation function?
TO_DATE
TRUNC
REPLACE
TRIM
The CUSTOMERS table has these columns: CUSTOMER_ID NUMBER (4) NOT NULL CUSTOMER_NAME VARCHAR2 (100) STREET_ADDRESS VARCHAR2 (150) CITY_ADDRESS VARCHAR2 (50) STATE_ADDRESS VARCHAR2 (50) PROVINCE_ADDRESS VARCHAR2 (50) COUNTRY_ADDRESS VARCHAR2 (50) POSTAL_CODE VARCHAR2 (12) CUSTOEMR_PHONE VARCHAR2 (20) Which statement finds the rows in the CUSTOMERS table that do not have a postal code
SELECT customer_id, customer_name FROM customers WHERE postal_code=NULL
SELECT customer_id, customer_name FROM customers WHERE postal_code IS NULL
SELECT customer_id, customer name FROM customers WHERE posta_code='_______'
SELECT customer_id, customer_name FROM customers WHERE postal_code CONTAINS NULL
Which statements is not correctly describe the functions and use of constraints?
Constraints prevent the deletion of a table if there are dependencies.
constraints enforce rules at the table level
constraints enforce rules at the view level
constraint make complex queries easy
You define a multiple-row subquery in the WHERE clause of an SQL query with a comparison operator"=" What happens when the main query is executed?
The main query fails because the multiple-row sub query cannot be used with the comparison operator.
the main query executes with all the values returned by the subquery
the main query executes with the last value returned by the subquery
the main query executes with the first value returned by the subquery
You would like to display the system date in the format *Monday, 01 June, 2001* Which SELECT statement should you use?
SELECT TO_CHAR(SYSDATE, 'FMDAY, DDD Month, YYYY') FROM dual
SELECT TO_CHAR(SYSDATE, 'FM Day, DD Month YYYY') FROM dual
SELECT TO_CHAR(SYSDATE, 'FMDD, DY Month 'YYY') FROM dual
The EMP table has these columns: ENAME VARCHAR2 (35) SALARY NUMBER (8, 2) HIRE_DATE DATE Management wants a list of names of employees who have been with the company for more than five yeas. Which SQL statement displays the required results?
SELECT ENAME FROM EMP WHERE (SYSDATE-HIRE_DATE)* 365 > 5
SELECT ENAME FROM EMP WHERE (SYSDATE-HIRE_DATE)/365 > 5
SELECT ENAME FROM EMP WHERE HIRE_DATE-SYSDATE > 5
SELECT ENAME FROM EMP WHERE SYSDATE-HIRE_DATE>5
You need to calculate the total of all salaries in the accounting department. Which group function should you use?
COUNT
SUM
MIN
MAX
A sub query can be used to _________.
retrieve data based on an unknown condition
convert data to a different format
sort data in a specific order
create groups of data
The ORDERS table has these columns ORDER_ID-NUMBER (4)-NOT NULL CUSTOMER_ID- NUMBER (12)-NOT NULL ORDER_TOTAL-NUMBER (10, 2) The ORDERS table tracks the Order number, the order total and the customer to whom the Order belongs. Which two statements retrieve orders with an inclusive total that ranges between 100.00 and 200.00 dollars?
SELECT customer_id, order_id, order_total FROM orders WHERE order_total >= 100 and <=200
SELECT customer_id, order_id, order_total FROM orders WHERE order_total BETWEEN 100 and 200
SELECT customer_id, order_id, order_total FROM orders HAVING order total BETWEEN 100 and 200
SELECT customer_id, order_id, order_total FROM orders RANGE ON order_total (100 AND 200) INCLUSIVE
What does the TRUNCATE statement do?
removes all columns from a table
shortens the tale to 10 rows
removes all rows from a table
removes the table
What is true regarding sub queries?
The inner query returns a value to the outer query.
The outer query must return a value to the inner query.
The outer query always sorts the results of the inner query.
The inner query always sorts the results of the outer query.
What constraints satisfied by Primary Key?
CHECK
NOT NULL
UNOQUE
UNIQUE & NOT NULL
What are the basic SQL statements?
JOIN
PROJECTION
SELECT
SELECTION,PROJECTION & JOIN
What is DCL?
Data control link
Data commit language
Data base control language
Data control language
To join N tables how many join conditions are required?
N-1
N-2
N+1
N +2
What is an aggregate function?
Takes many rows as input and gives no output.
Takes many rows as input and gives many output.
Takes one rows as input and gives one output.
Takes many rows as input and gives one output.
ISQL plus is a property of?
PL/SQL
SQL
ANSI
ORACLCE
Description:

This test is aimed at determining ones knowledge of basic DML,DDL statements.
Disclaimer: Content, such as images used in the questions (if any), have been picked up from various places for the sole purpose of Instruction.

Tags:

SQL  Oracle 9i  Oracle  DBA

Discussion

Vijay

In sql what is the meaning of DATETIMESTAFF?

284 days 13 hours 48 minutes ago

Narendra Kumar

TO_date is not character manipulation function.....

300 days 10 hours 58 minutes ago

Girish Deshpande

TO_date is not character manipulation function.....

320 days 6 hours 43 minutes ago

sandy

this test is very helpful to mee

1136 days 15 hours 17 minutes ago

jags

There ae some wrong answers in this test better they should correct this

1138 days 5 hours 52 minutes ago

sathya

its very usefull for learners .by sathya

1273 days 23 hours 50 minutes ago

sathya

its very usefull for learners .by sathya

1273 days 23 hours 50 minutes ago

Prabhudatta Barick

I found the answer of question
What constraints satisfied by Primary key answer
should be UNIQUE AND NOT NULL
bUT answer given here is CHECK how come it is true??????
I need clarification regarding this.........

1285 days 15 hours 24 minutes ago

nagajyothi

enjoyed the test and v r glad if you provide correct answers.

1329 days 13 hours 57 minutes ago

dk

character manipulation function is trim
and primary key satisfies unique and not null constraints...

1393 days 3 hours 16 minutes ago

Your Facebook Friends on WizIQ

More Tests By Author

ASP Server Controls
10 Questions | 533 Attempts

ASP.NET, Namespaces ASP.NET
10 Questions | 1831 Attempts

An ASP.NET Application
10 Questions | 356 Attempts