0

databases Online Quiz - 86

Description: databases Online Quiz - 86
Number of Questions: 20
Created by:
Tags: databases
Attempted 0/20 Correct 0 Score 0
  1. System tablespace

  2. Users tablespace

  3. Default tablespace for the user

  4. Oracle will give an error


Correct Option: C

To produce a meaningful result set without any cartesian products, what is the minimum number of conditions that should appear in the WHERE clause of a four-table join?

  1. 5

  2. 4

  3. 3

  4. There is no such criteria


Correct Option: C
  1. INSERT INTO r4r_team (id, username, exp) VALUES (1, ‘r4r01’, ‘2’);

  2. INSERT INTO r4r_team VALUES (1, ‘r4r01’, ‘2’);

  3. INSERT INTO r4r_team (id, username, exp) VALUE (1, ‘r4r01’, ‘2’);

  4. INSERT INTO table r4r_team (id, username, exp) VALUE (1, ‘r4r01’, ‘2’);


Correct Option: A

<> and != both are same operator into SQL

  1. True

  2. False


Correct Option: A

Choose true option

  1. BETWEEN -->>Used for range with in values

  2. LIKE -->>Used for Search a pattern

  3. IN -->>return east one of the columns in given set of values

  4. 1,2,3


Correct Option: D

Truncate is faster than delete

  1. True

  2. False


Correct Option: A
  1. having

  2. group by

  3. where

  4. both 1 and 2


Correct Option: D

If the base table of a view is deleted and we give SQL Select command on view table name

  1. Gives the columns referred in select statement of view

  2. Reports a error

  3. Select only particular columns of view table

  4. Outputs the whole view table


Correct Option: B
  1. GENERATE SEQUENCE SE START WITH 30 ADD BY 20;

  2. CREATE SEQUENCE SE START WITH 30 ADD BY 20;

  3. CREATE SEQUENCE SE START WITH 30 INCREMENT BY 20;

  4. GENERATE SEQUENCE SE INITIATE WITH 30 INCREMENT BY 20;


Correct Option: C

Which of the following is TRUE about Primary Key?

  1. Same value of Primary Key can appear in more than one row in the table

  2. A Primary key defined column can be of type LONG

  3. A column that is defined as Primary Key cannot contain NULL value

  4. Both A. and B.


Correct Option: C
  1. Table name can be an oracle reserved word

  2. Table names must begin with a letter

  3. Table names can contain in it numbers also

  4. None of the Above


Correct Option: A

With SQL, how can you return the number of records in the "Persons" table?

  1. SELECT COLUMNS(*) FROM Persons

  2. SELECT COUNT() FROM Persons

  3. SELECT COUNT(*) FROM Persons

  4. SELECT COLUMNS() FROM Persons


Correct Option: C

Which SQL keyword is used to sort the result-set?

  1. order

  2. sort

  3. order by

  4. sort by


Correct Option: C

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'.

- Hide questions