Tag: databases

Questions Related to databases

Which SQL statement is used to return only different values?

  1. SELECT DIFFERENT

  2. SELECT DISTINCT

  3. SELECT UNIQUE

  4. SELECT PRIMARY


Correct Option: B

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"?

  1. SELECT * FROM Persons WHERE FirstName LIKE '%a'

  2. SELECT * FROM Persons WHERE FirstName='a'

  3. SELECT * FROM Persons WHERE FirstName LIKE 'a%'

  4. SELECT * FROM Persons WHERE FirstName='%a%'


Correct Option: C

AI Explanation

To select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a", you can use the SQL query:

Option C) SELECT * FROM Persons WHERE FirstName LIKE 'a%'

Explanation for each option:

Option A) SELECT * FROM Persons WHERE FirstName LIKE '%a' This option is incorrect because the '%a' wildcard pattern at the end will match any value that ends with 'a', not just those that start with 'a'.

Option B) SELECT * FROM Persons WHERE FirstName='a' This option is incorrect because it will only select the records where the value of the column "FirstName" is exactly 'a', not those that start with 'a'.

Option C) SELECT * FROM Persons WHERE FirstName LIKE 'a%' This option is correct because the 'a%' wildcard pattern at the end will match any value that starts with 'a'. This is the correct way to select all the records where the value of the column "FirstName" starts with 'a'.

Option D) SELECT * FROM Persons WHERE FirstName='%a%' This option is incorrect because the '%a%' wildcard pattern on both sides will match any value that contains 'a', not just those that start with 'a'.

The correct answer is Option C) SELECT * FROM Persons WHERE FirstName LIKE 'a%'. This option is correct because it selects all the records where the value of the column "FirstName" starts with 'a'.

  1. SELECT [all] FROM Persons

  2. SELECT Persons

  3. SELECT *.Persons

  4. SELECT * FROM Persons


Correct Option: D
  1. iSQL*Plus commands manipulate table definitions in the database.

  2. iSQL*Plus is the Oracle proprietary interface for executing SQL statements.

  3. iSQL*Plus commands cannot be abbreviated.

  4. iSQL*Plus commands are accesses from a browser.


Correct Option: B,D
  1. Use the DESCRIBE command in the EMP_DEPT VU view.

  2. Use the DEFINE VIEW command on the EMP_DEPT VU view.

  3. Query the USER_VIEWS data dictionary view to search for the EMP_DEPT_VU view.

  4. Query the USER_SOURCE data dictionary view to search for the EMP_DEPT_VU view.


Correct Option: C
  1. insert

  2. update

  3. select

  4. describe


Correct Option: D