SQL Fundamentals: Oracle and MySQL

Test your knowledge of SQL basics, Oracle database concepts, and MySQL syntax including transactions, functions, and data manipulation.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

The default password of root user is

  1. My$ql
  2. Linuxab$
  3. ""
  4. None of the above
Question 2 Multiple Choice (Single Answer)

What will be the output of the query select * from table1 order by rand()

  1. Error
  2. All columns ordered randomly
  3. rows picked in a random way
  4. None of the above
Question 3 True/False

Is it a valid mySQL statements? SELECT @min_price:=MIN(price),@max_price:=MAX(price) FROM shop; SELECT * FROM shop WHERE price=@min_price OR price=@max_price;

  1. True
  2. False
Question 4 Multiple Choice (Single Answer)

What will be the output of the query SELECT column FROM table ORDER BY column DESC LIMIT 7,10;

  1. Would skip the first 7, and then get you the next ten highest.
  2. not a valid mysql query
  3. Would skip the first 10, and then get you the next 7 highest.
  4. None of the above
Question 5 True/False

The mysql contains a user root?

  1. True
  2. False
Question 6 Multiple Choice (Single Answer)

The default password of root user is

  1. My$ql
  2. Linuxab$
  3. ""
  4. None of the above
Question 7 Multiple Choice (Single Answer)

What will be the output of the query select * from table1 order by rand()

  1. Error
  2. All columns ordered randomly
  3. rows picked in a random way
  4. None of the above
Question 8 True/False

Is it a valid mySQL statements? SELECT @min_price:=MIN(price),@max_price:=MAX(price) FROM shop; SELECT * FROM shop WHERE price=@min_price OR price=@max_price;

  1. True
  2. False
Question 9 Multiple Choice (Single Answer)

What will be the output of the query SELECT column FROM table ORDER BY column DESC LIMIT 7,10;

  1. Would skip the first 7, and then get you the next ten highest.
  2. not a valid mysql query
  3. Would skip the first 10, and then get you the next 7 highest.
  4. None of the above
Question 10 Multiple Choice (Single Answer)

Which Oracle access method is the fastest way for Oracle to retrieve a single row?

  1. Primary key access
  2. Access via unique index
  3. Table access by ROWID
  4. Full table scan
Question 11 Multiple Choice (Single Answer)

Which of the following can be a valid column name?

  1. Column
  2. 1966_Invoices
  3. Catch_#22
  4. #Invoices
Question 12 Multiple Choice (Single Answer)

Which command will delete all data from a table and will not write to the rollback segment?

  1. DROP
  2. DELETE
  3. CASCADE
  4. TRUNCATE
Question 13 Multiple Choice (Single Answer)

Which character function can be used to return a specified portion of a character string?

  1. INSTR
  2. SUBSTRING
  3. SUBSTR
  4. POS
Question 14 Multiple Choice (Single Answer)

When a user creates an object without a TABLESPACE clause, where will Oracle store the segment?

  1. System tablespace
  2. Users tablespace
  3. Default tablespace for the user
  4. Oracle will give an error
Question 15 Multiple Choice (Single Answer)

Which character is used to continue a statement in SQL*Plus?

  1. *
  2. /
  3. -
  4. @
Question 16 Multiple Choice (Single Answer)

What is the best way for a deadlock to be resolved?

  1. All statements are removed and have to be resubmitted
  2. The Oracle server rolls back the statement that detected the deadlock
  3. The administrator has to kill the session
  4. Deadlocks can not be resolved
Question 17 Multiple Choice (Single Answer)

When an executable SQL statement executes, a transaction begins. Which of the following events can NOT cause a transaction to end?

  1. The user disconnects from Oracle
  2. A COMMIT or a ROLLBACK statement is used in conjunction with a SAVEPOINT clause
  3. A user process is terminated abnormally
  4. A DDL statement such as DROP, GRANT, RENAME
Question 18 Multiple Choice (Single Answer)

Which dictionary view or views should be monitored to determine how long users are waiting for dispatchers?

  1. V$SESSTAT
  2. V$QUEUE
  3. V$SHARED_SERVER
  4. V$VIEW
Question 19 Multiple Choice (Single Answer)

Which of the following options would be queried to get the descriptions of all tablespaces?

  1. USER_TABLESPACES
  2. V$TABLESPACE
  3. DBA_TABLESPACE_GROUPS
  4. DBA_TABLESPACES
Question 20 Multiple Choice (Single Answer)

A single database session failure is classified as what type of error?

  1. Statement failure
  2. User process failure
  3. Network failure
  4. Instance failure