SQL Fundamentals: Oracle and MySQL
Test your knowledge of SQL basics, Oracle database concepts, and MySQL syntax including transactions, functions, and data manipulation.
Questions
The default password of root user is
- My$ql
- Linuxab$
- ""
- None of the above
What will be the output of the query select * from table1 order by rand()
- Error
- All columns ordered randomly
- rows picked in a random way
- None of the above
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;
- True
- False
What will be the output of the query SELECT column FROM table ORDER BY column DESC LIMIT 7,10;
- Would skip the first 7, and then get you the next ten highest.
- not a valid mysql query
- Would skip the first 10, and then get you the next 7 highest.
- None of the above
The mysql contains a user root?
- True
- False
The default password of root user is
- My$ql
- Linuxab$
- ""
- None of the above
What will be the output of the query select * from table1 order by rand()
- Error
- All columns ordered randomly
- rows picked in a random way
- None of the above
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;
- True
- False
What will be the output of the query SELECT column FROM table ORDER BY column DESC LIMIT 7,10;
- Would skip the first 7, and then get you the next ten highest.
- not a valid mysql query
- Would skip the first 10, and then get you the next 7 highest.
- None of the above
Which Oracle access method is the fastest way for Oracle to retrieve a single row?
- Primary key access
- Access via unique index
- Table access by ROWID
- Full table scan
Which of the following can be a valid column name?
- Column
- 1966_Invoices
- Catch_#22
- #Invoices
Which command will delete all data from a table and will not write to the rollback segment?
- DROP
- DELETE
- CASCADE
- TRUNCATE
Which character function can be used to return a specified portion of a character string?
- INSTR
- SUBSTRING
- SUBSTR
- POS
When a user creates an object without a TABLESPACE clause, where will Oracle store the segment?
- System tablespace
- Users tablespace
- Default tablespace for the user
- Oracle will give an error
Which character is used to continue a statement in SQL*Plus?
- *
- /
- -
- @
What is the best way for a deadlock to be resolved?
- All statements are removed and have to be resubmitted
- The Oracle server rolls back the statement that detected the deadlock
- The administrator has to kill the session
- Deadlocks can not be resolved
When an executable SQL statement executes, a transaction begins. Which of the following events can NOT cause a transaction to end?
- The user disconnects from Oracle
- A COMMIT or a ROLLBACK statement is used in conjunction with a SAVEPOINT clause
- A user process is terminated abnormally
- A DDL statement such as DROP, GRANT, RENAME
Which dictionary view or views should be monitored to determine how long users are waiting for dispatchers?
- V$SESSTAT
- V$QUEUE
- V$SHARED_SERVER
- V$VIEW
Which of the following options would be queried to get the descriptions of all tablespaces?
- USER_TABLESPACES
- V$TABLESPACE
- DBA_TABLESPACE_GROUPS
- DBA_TABLESPACES
A single database session failure is classified as what type of error?
- Statement failure
- User process failure
- Network failure
- Instance failure