Docsity

Oracle Database SQL Certified Associate Practice Exam, Exams of Technology

Toggle sidebar
bg1
Oracle Database SQL Certified Associate Practice Exam
Question 1. Which of the following best describes the purpose of a relational database?
A) To store hierarchical data
B) To organize data into related tables
C) To manage networked data structures
D) To create flat files
Answer: B
Explanation: Relational databases use tables to organize data based on relationships, enabling efficient
storage, retrieval, and management of related information.
Question 2. What does SQL stand for?
A) Simple Query Language
B) Structured Query Language
C) Sequential Query Logic
D) Standard Question Language
Answer: B
Explanation: SQL stands for Structured Query Language, the standard language for querying and
manipulating relational databases.
Question 3. Which SQL statement retrieves all columns from the EMPLOYEES table?
A) SELECT * FROM EMPLOYEES;
B) GET ALL FROM EMPLOYEES;
C) SHOW EMPLOYEES;
D) DISPLAY * FROM EMPLOYEES;
Answer: A
Explanation: The SELECT * FROM EMPLOYEES; statement retrieves all columns from the EMPLOYEES
table.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51

Partial preview of the text

Download Oracle Database SQL Certified Associate Practice Exam and more Exams Technology in PDF only on Docsity!

Question 1. Which of the following best describes the purpose of a relational database? A) To store hierarchical data B) To organize data into related tables C) To manage networked data structures D) To create flat files Answer: B Explanation: Relational databases use tables to organize data based on relationships, enabling efficient storage, retrieval, and management of related information. Question 2. What does SQL stand for? A) Simple Query Language B) Structured Query Language C) Sequential Query Logic D) Standard Question Language Answer: B Explanation: SQL stands for Structured Query Language, the standard language for querying and manipulating relational databases. Question 3. Which SQL statement retrieves all columns from the EMPLOYEES table? A) SELECT * FROM EMPLOYEES; B) GET ALL FROM EMPLOYEES; C) SHOW EMPLOYEES; D) DISPLAY * FROM EMPLOYEES; Answer: A Explanation: The SELECT * FROM EMPLOYEES; statement retrieves all columns from the EMPLOYEES table.

Question 4. Which data type is used to store whole numbers in Oracle? A) VARCHAR B) NUMBER C) DATE D) CLOB Answer: B Explanation: The NUMBER data type is used to store numeric values, including whole numbers and decimals. Question 5. Which clause in a SELECT statement specifies the table to query? A) FROM B) WHERE C) SELECT D) ORDER BY Answer: A Explanation: The FROM clause identifies the table from which to retrieve data. Question 6. What is the main purpose of an Entity Relationship Diagram (ERD)? A) To document network protocols B) To model the logical structure of a database C) To design web pages D) To track server performance Answer: B Explanation: ERDs visually represent entities and their relationships for database design and data modeling.

Question 10. What does the WHERE clause do in a SQL query? A) Sorts the result set B) Limits the rows returned based on a condition C) Joins tables D) Specifies columns to display Answer: B Explanation: The WHERE clause filters rows according to specified conditions. Question 11. Which operator checks if a value is between two limits in SQL? A) BETWEEN B) WITHIN C) IN D) LIMIT Answer: A Explanation: BETWEEN checks if a value lies within a specified range. Question 12. What is the result of NULL + 5 in Oracle SQL? A) 5 B) NULL C) 0 D) Error Answer: B Explanation: Any arithmetic operation with NULL yields NULL.

Question 13. Which function returns the length of a string in Oracle SQL? A) SIZE B) LENGTH C) STRLEN D) COUNT Answer: B Explanation: LENGTH returns the number of characters in a string. Question 14. How do you rename a column heading in a SELECT statement? A) SELECT column AS alias B) SELECT column RENAME alias C) SELECT column NAME alias D) SELECT column TO alias Answer: A Explanation: The AS keyword assigns an alias as the column heading in the results. Question 15. Which symbol is used to prompt for a substitution variable in SQL*Plus? A) & B) # C) $ D) % Answer: A Explanation: & prompts the user to input a value for a substitution variable. Question 16. Which function removes leading and trailing spaces from a string?

B) SYSDATE

C) NOW

D) TODAY

Answer: B Explanation: SYSDATE returns the current date and time according to the database server. Question 20. How do you check for NULL values in a column? A) WHERE column IS NULL B) WHERE column = NULL C) WHERE column == NULL D) WHERE column NOT EXISTS Answer: A Explanation: IS NULL checks for NULL values in a specified column. Question 21. What is the output of SELECT INITCAP('oracle') FROM DUAL? A) oracle B) ORACLE C) Oracle D) oracLe Answer: C Explanation: INITCAP capitalizes the first letter of each word. Question 22. Which operator combines multiple search conditions in WHERE clauses? A) AND B) UNION

C) JOIN

D) COMBINE

Answer: A Explanation: AND combines multiple conditions for filtering rows. Question 23. What is the purpose of the GROUP BY clause? A) To join tables B) To aggregate data by specified columns C) To sort rows D) To filter rows Answer: B Explanation: GROUP BY aggregates rows based on column values for group functions. Question 24. Which function returns the highest value in a column? A) MAX B) TOP C) HIGHEST D) UPPER Answer: A Explanation: MAX returns the greatest value in a specified column. Question 25. Which SQL function counts the number of non-NULL rows in a column? A) COUNT(column) B) SUM(column) C) NUMBER(column)

Answer: B Explanation: MOD returns the remainder after division. Question 29. What does the TO_DATE function do? A) Converts a string to a numeric value B) Converts a string to a date value C) Converts a date to a string D) Converts a number to a string Answer: B Explanation: TO_DATE converts text to a date using a specified format. Question 30. Which keyword eliminates duplicate values from query results? A) DISTINCT B) UNIQUE C) ONLY D) SINGLE Answer: A Explanation: DISTINCT ensures only unique values appear in the result. Question 31. What is the result of SELECT ROUND(12.345, 2) FROM DUAL? A) 12. B) 12. C) 12. D) 12 Answer: C

Explanation: ROUND(12.345, 2) rounds to two decimal places, giving 12.35. Question 32. Which function returns the next occurrence of a specified weekday after a date? A) NEXT_DAY B) WEEK_DAY C) LAST_DAY D) DAY_AFTER Answer: A Explanation: NEXT_DAY returns the next specified weekday after a given date. Question 33. How do you concatenate 'Oracle' and 'SQL' in a query result? A) 'Oracle' || 'SQL' B) CONCAT('Oracle', 'SQL') C) 'Oracle' + 'SQL' D) 'Oracle' & 'SQL' Answer: A Explanation: || is the concatenation operator in Oracle SQL. Question 34. Which function pads a string on the left with characters? A) LPAD B) RPAD C) PADLEFT D) LEFT Answer: A Explanation: LPAD adds characters to the left side of a string.

Question 38. Which function counts all rows, including NULLs? A) COUNT() B) COUNT(column) C) TOTAL() D) SUM() Answer: A Explanation: COUNT() counts all rows regardless of NULLs. Question 39. What does the TO_CHAR function do? A) Converts a date or number to a string B) Converts a string to a date C) Converts a number to a date D) Converts a string to a number Answer: A Explanation: TO_CHAR converts values to string format. Question 40. Which symbol is used for comments in Oracle SQL? A) -- B) ## C) // D) ** Answer: A Explanation: -- starts a single-line comment in SQL. Question 41. Which function returns the last day of the month for a given date?

A) LAST_DAY

B) END_DAY

C) MONTH_END

D) FINAL_DAY

Answer: A Explanation: LAST_DAY returns the last day of the month for the input date. Question 42. What does the FETCH clause do? A) Limits the number of rows returned after OFFSET B) Joins tables C) Sorts results D) Filters rows Answer: A Explanation: FETCH restricts the number of rows in the result set, often used with OFFSET. Question 43. Which function returns the number of months between two dates? A) MONTHS_BETWEEN B) MONTH_DIFF C) DATE_DIFF D) MONTH_COUNT Answer: A Explanation: MONTHS_BETWEEN calculates the interval in months between two dates. Question 44. Which command displays the structure of a table in SQL*Plus? A) DESCRIBE

C) *

D)?

Answer: A Explanation: _ matches a single character in pattern searches. Question 48. Which character is used as a wildcard for multiple characters in LIKE? A) % B) _ C) * D) # Answer: A Explanation: % matches any sequence of characters in pattern searches. Question 49. Which function returns the position of a substring within a string? A) INSTR B) SUBSTR C) LOCATE D) FIND Answer: A Explanation: INSTR finds the position of a substring. Question 50. Which function extracts a substring from a string? A) SUBSTR B) INSTR C) MID

D) EXTRACT

Answer: A Explanation: SUBSTR returns a portion of a string given starting position and length. Question 51. What is the default sorting order in ORDER BY clause? A) Ascending B) Descending C) Random D) None Answer: A Explanation: ORDER BY sorts results in ascending order unless DESC is specified. Question 52. Which function nests multiple single-row functions in Oracle SQL? A) By chaining functions inside one another B) By using JOIN C) By using UNION D) By using GROUP BY Answer: A Explanation: Functions can be nested by placing one function inside another in an expression. Question 53. Which command sets a substitution variable value in SQL*Plus? A) DEFINE B) SET C) VARIABLE D) INPUT

Explanation: DECODE evaluates equality and returns corresponding values. Question 57. Which function returns NULL if two expressions are equal? A) NULLIF B) NVL C) NVL D) DECODE Answer: A Explanation: NULLIF returns NULL if its two arguments are equal. Question 58. Which function returns the first non-NULL value in a list? A) COALESCE B) NVL C) NVL D) DECODE Answer: A Explanation: COALESCE returns the first non-NULL argument. Question 59. Which clause restricts the number of rows returned in Oracle 12c and later? A) OFFSET FETCH B) LIMIT C) TOP D) ROWCOUNT Answer: A Explanation: OFFSET and FETCH limit rows in SQL:2008 compliant Oracle databases.

Question 60. Which data type stores fractional numbers in Oracle SQL? A) NUMBER B) INTEGER C) VARCHAR D) CHAR Answer: A Explanation: NUMBER supports both integer and fractional values. Question 61. Which function adds months to a date? A) ADD_MONTHS B) MONTHS_BETWEEN C) NEXT_DAY D) LAST_DAY Answer: A Explanation: ADD_MONTHS adds the specified number of months to a date. Question 62. Which keyword is used to join tables in SQL? A) JOIN B) ATTACH C) MERGE D) LINK Answer: A Explanation: JOIN combines rows from two or more tables based on related columns.