Database Test Part-01

  1. What will the output be if you try to perform arithmetic on NULL values? 0 NULL It will generate an error message Can’t be determined 2. Which of the following options is not correct about the DATEDIFF() function? It returns the difference between parts of two specified dates It takes … Continue Reading →

Oracle Test Part-03

  21. Which operator will be evaluated first in the following statement? Select (2+3*4/2-8) from dual: a. + b. – c. / d. * Answer: d. 22. Which of the following SELECT statements should be used to extract the year from the system date to display it in the format “2001”? a. SELECT TO_CHAR(SYSDATE, ‘yyyy’) … Continue Reading →

Oracle Test Part-02

11. What kinds of commands can be entered at the command prompt in 9i SQL Plus? PL/SQL Blocks SQL*PLUS commands Security commands SQL commands Answer: a, b, d. 12. What will happen if the emp table shown below is queried: select enpno,DISTINCT ename,Salary from emp; EMPNO ,unique value of ENAME … Continue Reading →

Oracle Test Part-01

1. Which type of join should be written to perform an outer join of tables A and B that returns all rows from B?a. Any outer joinb. A left outer joinc. A cross joind. A right outer joine. An inner join Answer: d. 2. How many join conditions should be there to avoid a Cartesian Join for … Continue Reading →

SQL Constraints

Types of SQL Constraints – NOT NULL – UNIQUE – CHECK – Primary Key – Foreign Key  SQL NOT NULL Constraint. By default, a column can hold NULL value. If we not want to allow NULL or empty value in a column of our table, then we need to place … Continue Reading →

SQL operators

  ALL Syntax ALL [ ( SELECT-Command ) ] Description: ALL is used to select all records of an SELECT statement. Example: SELECT * FROM tkunden WHERE rating > ALL ( SELECT rating FROM tkunden WHERE stadt=’Berlin’ ); Select all customers where rating is biger than the rating of all … Continue Reading →

SQL Concepts

  What is a SQL?  It is Structured Query language. It is a non procedural language and it is a database language. Categories in SQL commands  There are 3 broad categories in SQL commands. They are namely 1.Data Definition language (DDL)  2.Data Manipulation Language (DML)  3.Transaction Control Commands  Under each category there … Continue Reading →