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

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


Correct Option: C

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

  1. *

  2. /

  3. -

  4. @


Correct Option: C

AI Explanation

To answer this question, you need to understand how statements are executed in SQL*Plus.

In SQL*Plus, a statement can be continued onto the next line by using the hyphen ("-") character. This is known as a line continuation character.

Option A) * - This character is not used to continue a statement in SQL*Plus. Option B) / - This character is used to execute a statement in SQL*Plus, but it is not used to continue a statement onto the next line. Option C) - This character is the correct answer. It is used to continue a statement onto the next line in SQL*Plus. Option D) @ - This character is used to run a script or a file in SQL*Plus, but it is not used to continue a statement onto the next line.

The correct answer is Option C) -. This character is used to continue a statement in SQL*Plus.

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

Which of the following SQL functions can operate on any datatype?

  1. TO_CHAR

  2. LOWER

  3. LPAD

  4. MAX


Correct Option: D

AI Explanation

To answer this question, you need to understand the SQL functions and their capabilities. Let's go through each option to understand why it is correct or incorrect:

Option A) TO_CHAR - This function is used to convert a number or date to a character string. It operates on specific datatypes like numbers and dates, so it cannot operate on any datatype. Therefore, Option A is incorrect.

Option B) LOWER - This function is used to convert a character string to lowercase. It operates on character strings and can be used with any datatype that can be implicitly converted to a character string. Therefore, Option B is incorrect.

Option C) LPAD - This function is used to pad a character string with a specified character to a specified length. It operates on character strings and can be used with any datatype that can be implicitly converted to a character string. Therefore, Option C is incorrect.

Option D) MAX - This function is used to return the maximum value in a column or a set of values. It can operate on any datatype, including numbers, characters, and dates. Therefore, Option D is correct.

The correct answer is D. This option is correct because the MAX function can operate on any datatype.

Choose correct syntax to insert values into r4r_team table

  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

AI Explanation

To answer this question, you need to understand the syntax for inserting values into a table using the INSERT statement. Let's go through each option to understand why it is correct or incorrect:

Option A) INSERT INTO r4r_team (id, username, exp) VALUES (1, 'r4r01', '2') - This option is correct. It follows the correct syntax for inserting values into the r4r_team table. The column names (id, username, exp) are specified, followed by the keyword VALUES, and then the corresponding values (1, 'r4r01', '2').

Option B) INSERT INTO r4r_team VALUES (1, 'r4r01', '2') - This option is incorrect. While it inserts values into the r4r_team table, it does not specify the column names. It assumes that the values are being inserted in the order of the columns defined in the table, which can lead to errors if the order is different.

Option C) INSERT INTO r4r_team (id, username, exp) VALUE (1, 'r4r01', '2') - This option is incorrect. The correct keyword is VALUES, not VALUE. This is a syntax error.

Option D) INSERT INTO table r4r_team (id, username, exp) VALUE (1, 'r4r01', '2') - This option is incorrect. The correct syntax does not include the keyword "table" before the table name. Additionally, the correct keyword is VALUES, not VALUE.

The correct answer is A. This option is correct because it follows the correct syntax for inserting values into the r4r_team table, specifying the column names and corresponding values.

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

delete will lower the water mark

  1. True

  2. False


Correct Option: B

Which of the following denote group clause in SQL

  1. having

  2. group by

  3. where

  4. both 1 and 2


Correct Option: D

AI Explanation

To answer this question, we need to understand the purpose of the GROUP BY clause in SQL.

The GROUP BY clause is used to group rows in a table based on one or more columns. It is often used in conjunction with aggregate functions (such as SUM, COUNT, AVG, etc.) to perform calculations on groups of data.

Let's go through each option to determine which one denotes the GROUP BY clause:

Option A) having - The HAVING clause is used to filter the results of a query based on a condition that applies to groups created by the GROUP BY clause. It is used after the GROUP BY clause and aggregate functions. While the HAVING clause is related to the GROUP BY clause, it does not denote the GROUP BY clause itself.

Option B) group by - The GROUP BY clause is used to group rows in a table based on one or more columns. This option correctly denotes the GROUP BY clause.

Option C) where - The WHERE clause is used to filter rows in a table based on a condition. It is used before the GROUP BY clause and does not denote the GROUP BY clause itself.

Option D) both 1 and 2 - Option D is correct because it includes both the HAVING clause (option A) and the GROUP BY clause (option B), which together form the group clause in SQL.

Therefore, the correct answer is option D.

If base table does not exists, can we create a view?

  1. True

  2. False


Correct Option: A

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

Which of the following data types are used in SQL?

  1. Long

  2. Date

  3. rowid

  4. all above


Correct Option: D

Which of the following SQL statement create a sequence SE with starting value as 30 and in increments of 20?

  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

Which of the following is not allowed while creating a table using CRRATE TABLE in SQL?

  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