Oracle and SQL Basics

A basic test for Oracle Starters.

25 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following best describes Oracle?

  1. Spreadsheet
  2. Relational Database Management System
  3. Database Management System
  4. Object Relational Database Management System
Question 2 Multiple Choice (Single Answer)

Which of the following SQL keywords is used to resize a column definition?

  1. Alter table
  2. Resize
  3. Drop
  4. Change Size
Question 3 Multiple Choice (Single Answer)

SQL stands for _____.

  1. Structured Question Lanaguage
  2. Strurctured Queried Language
  3. Structured Query Language
  4. Structured Queries Language
Question 4 Multiple Choice (Single Answer)

The Like operator uses some special symbols called wildcards for pattern matching. Which of the following are valid wildcard characters in SQL?

  1. & and *
  2. % and *
  3. % and _ (underscore)
  4. $ and _ (underscore)
Question 5 Multiple Choice (Single Answer)

Which of the following SQL statements can be used to display the list of available tables?

  1. Select * from tables
  2. Select * from tab
  3. Select * from tabs
  4. Select all from tab
Question 6 Multiple Choice (Single Answer)

Which of the following statements is used to undo any accidental changes in a table?

  1. Undo
  2. Recover
  3. Rollback
  4. Recall
Question 7 Multiple Choice (Single Answer)

A user in Oracle must have which of the following privileges in order to create objects like tables, views, etc.?

  1. Connect
  2. Admin
  3. Create User
  4. Resource
Question 8 Multiple Choice (Single Answer)

The temporary name of a table or a column is known as _____.

  1. view
  2. object
  3. synonym
  4. alias
Question 9 Multiple Choice (Single Answer)

The Truncate Table statement when issued, _____.

  1. deletes all the records from a table
  2. deletes all the rows along with the table
  3. deletes the structure of the table leaving rows intact
  4. deletes only the null rows of a table
Question 10 Multiple Choice (Single Answer)

We can modify the data type of a column which already has data only _____.

  1. when the data type of the column is varchar
  2. when the column is empty
  3. Anytime we want, there are no restrictions
  4. If we are logged in as SYSTEM
Question 11 Multiple Choice (Single Answer)

A Select/Delete/Update statement that does not have a where clause will _____.

  1. affect no record
  2. affect all the records
  3. return an error
  4. affect only the first record
Question 12 Multiple Choice (Single Answer)

All the values in 'where in' clause must be separated by a _____.

  1. colon (:)
  2. period (.)
  3. comma (,)
  4. space
Question 13 Multiple Choice (Single Answer)

The ___ statement is used to save changes made to a table.

  1. Save All
  2. Save Now
  3. Commit
  4. Commits
Question 14 Multiple Choice (Single Answer)

The and operator is written as __ in SQL.

  1. &&
  2. and
  3. &
  4. *
Question 15 Multiple Choice (Single Answer)

How can we select all the records from a table named company list where the value of the column company is IBM?

  1. Select [all] from company list where company = IBM
  2. Select * from company list where company = IBM
  3. Select * from company list where company = ibm
  4. Select * * from company list where company = IBM
Question 16 Multiple Choice (Single Answer)

The statement to return all the records from a table named books sorted in descending by the column author is _____.

  1. select * from books order by author
  2. select * from books by order desc
  3. select * from books order by author desc
  4. select * from books sort by author desc
Question 17 Multiple Choice (Single Answer)

How can we count the number of records in the sample table?

  1. Select column(*) from sample
  2. Select count() from sample
  3. Select column() from sample
  4. Select count(*) from sample
Question 18 Multiple Choice (Single Answer)

Which of the following is a valid statement to select all the records from a table named city where the value of the column cityname starts with an 'A'?

  1. SELECT * FROM city WHERE cityname = '%A%'
  2. SELECT * FROM city WHERE cityname = 'A'
  3. SELECT * FROM city WHERE cityname LIKE '%A'
  4. SELECT * FROM city WHERE cityname LIKE 'A%'
Question 19 Multiple Choice (Single Answer)

Which of the following statements creates a copy of the table named source with the name target?

  1. Create table target (Select * from source)
  2. Create table target from source
  3. Create table target from source as select * from source
  4. Create table target as select * from source
Question 20 Multiple Choice (Single Answer)

Assume that in a table named Papers, there is a column named Name. Which of the following SQL statements can be used to set its value to NULL?

  1. Update table papers set name=null
  2. Update papers set name=null
  3. Update papers set name is null
  4. Update name set papers=null
Question 21 Multiple Choice (Single Answer)

Which of the following is a valid statement to insert a new record in the doctor table?

  1. Insert into doctor values('Sam','Twain')
  2. Insert ('Sam','Twain') into doctors
  3. Insert values('Sam','Twain') into doctors
  4. Insert doctor values('Sam','Twain')
Question 22 Multiple Choice (Single Answer)

Which SQL statement is used to extract data from a table?

  1. Select
  2. Display
  3. Get
  4. Describe
Question 23 Multiple Choice (Single Answer)

Which of the following keywords is different from others in terms of functionality?

  1. Insert
  2. Delete
  3. Alter
  4. Update
Question 24 Multiple Choice (Single Answer)

Which of the following SQL commands is used to delete data from a table?

  1. Remove
  2. Truncate
  3. Delete
  4. Drop
Question 25 Multiple Choice (Single Answer)

Which SQL statement is used to return only different (non duplicate) values in a select statement?

  1. Distinct
  2. Primary key
  3. Unique
  4. Different