SQL - Programming Online Tests

SQL: Test 1

Question 1: ________ are the conversion functions ...

97 Comments. 1909 views since Sep 30, 2008

SQL Commands

Question 1: The SQL function SIGN (-50) gives value as ...

19 Comments. 668 views since Sep 29, 2008

PL SQL Basics

Question 1: Which section of the PL/SQL block handles errors and abnormal conditions ? ...

35 Comments. 556 views since Jul 5, 2008

SQL Basics

Question 1: Which of the following arithmetic functions are used in SQL ...

22 Comments. 515 views since Sep 29, 2008

SQL: Basic Commands

Question 1: Which of the command below undo the current transaction? ...

20 Comments. 442 views since Sep 29, 2008

Joins and Subqueries

Question 1: Which line of code has an error ? ...

12 Comments. 367 views since Jul 5, 2008

SQL Test 2

Question 1: What do you mean by DDL? ...

4 Comments. 273 views since Jul 2, 2011

SQL: Additional Commands

Question 1: What is the output of the following SQL statement? select TRANSLATE('MASTER AUTHOR', 'MAOU', 'Maou') ...

4 Comments. 196 views since Sep 29, 2008

Single Row and Group Function

Question 1: You want to display each project's start date as the day, week, number, and year. Which statement will give output like the following ? Tuesday Week 23, 1997 ...

4 Comments. 157 views since Jul 5, 2008

SQL Database: Oracle test

Question 1: Which one of the following characters is used to execute an anonymous PL/SQL block written at the SQL prompt ...

4 Comments. 145 views since Sep 27, 2008

Creating and Managing Tables Tables and Views

Question 1: The table STATE is defined as in the following table. If you execute the statement that follows, how many constraints will the STATE_COPY table have ? CREATE TABLE STATE_COPY AS SELECT * FROM STATE ...

4 Comments. 139 views since Jul 5, 2008

Exception Handeling

Question 1: What is the PRAGMA exception_init used for ? ...

4 Comments. 107 views since Jul 5, 2008

Miscellaneous Test 1

Question 1: The DEPT table has DEPTNO as the primary key and has the following data: SQL> SELECT * FROM dept; DEPTNO DNAME LOC ---------- -------------- ------------- 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON Consider the INSERT statement. Which option is correct? INSERT INTO (SELECT * FROM dept WHERE deptno = 10) VALUES (50, 'MARKETING', 'FORT WORTH'); ...

2 Comments. 97 views since Jul 5, 2008

Relational Technology and SELECT Statement

Question 1: What does a single line with a crowfoot on one end represent in an entity - relationship diagram ? ...

2 Comments. 61 views since Jul 5, 2008

Microsoft SQL Server

Question 1: What system database contains information about the interaction between the server and all resouces, physical and logical, outside the server ? ...

0 Comments. 59 views since Sep 16, 2008

Miscellaneous Test 3

Question 1: Consider the following code, then choose the most appropriate option. CREATE TABLE CUSTOMER ( CUSTOMER_ID NUMBER (5), CUSTOMER_NAME VARCHAR2 (40), ZIP NUMBER (5)) AS SELECT CUST_ID, NAME, ZIP_CODE FROM CUSTOMERS ...

4 Comments. 58 views since Jul 5, 2008

Miscellaneous Test 2

Question 1: With regard to the following PL/SQL block, which of the following options is most correct ? BEGIN UPDATE emp SET salary = salary * 1.10 WHERE class_code = 'A'; SAVEPOINT ClassA_FloorAdjusted; UPDATE emp SET salary = salary * 1.07 WHERE class_code = 'B'; SAVEPOINT ClassB_FloorAdjusted; UPDATE emp SET salary = salary * 1.05 WHERE class_code = 'C'; SAVEPOINT ClassC_FloorAdjusted; ROLLBACK TO SAVEPOINT ClassB_FloorAdjusted; UPDATE taxes SET max_tax = 76200*0.075 WHERE tax_type = 'FICA'; SAVEPOINT MaxTax; ROLLBACK to MaxTax; ROLLBACK to ClassA_FloorAdjusted; END; COMMIT; ...

1 Comments. 54 views since Jul 5, 2008

Miscellaneous Test 4

Question 1: Which data dictionary table can tell you who granted the DBA role to user BATMAN ? ...

0 Comments. 51 views since Jul 5, 2008

Miscellaneous Test 5

Question 1: What is done in the following PL/SQL code ? INVALID_DATE EXCEPTION; ...

1 Comments. 45 views since Jul 5, 2008

Composite Datatypes and Collections

Question 1: Which line in the following PL/SQL block will raise an exception ? Choose one. 1 declare 2 type company_rec is record 3 (id number not null 4 ,company_name company.comp_name%type 5 ,sic_code varchar2(5) 6 ,begin date 7 ,contact_phone varchar2(14) 8 ); 9 comp_rec company_rec; ...

0 Comments. 45 views since Jul 5, 2008

Miscellaneous Test 6

Question 1: What will be the value of V_STATUS when the following code is executed ? DECLARE V_BONUS BOOLEAN := TRUE; V_COMMISSION BOOLEAN := FALSE; BEGIN V_STATUS := V_BONUS AND V_COMMISSION; END; ...

1 Comments. 40 views since Jul 5, 2008

Other Database Objects and Data Dictionary

Question 1: Which of the following statements will create a primary key constraint pk_books on the table BOOKS, column ISBN? Choose one. ...

0 Comments. 38 views since Jul 5, 2008

Modifying Data and Security

Question 1: When a program executes a SELECT...FOR UPDATE statement, which of the following must it do ? A) Execute a COMMIT or ROLLBACK to end the transaction, even if no data has changed B) Change the data values in the rows selected, then commit or roll back to end the transaction C) Execute a COMMIT or ROLLBACK to end the transaction, but only if data has changed D) Because a transaction doesn't start until data has actually changed, no COMMIT or ROLLBACK needs to be executed ...

0 Comments. 34 views since Jul 5, 2008

Interacting with Database

Question 1: What is wrong with the following cursor declaration ? CURSOR c1 (pempno IN NUMBER (4)) IS SELECT EMPNO, ENAME FROM EMP WHERE EMPNO = pempno; ...

0 Comments. 32 views since Jul 5, 2008