Top 1000+ Solved DataBase Management System (DBMS) MCQ Questions Answer

From 781 to 795 of 1187

Q. create table apartment(ownerID varchar (5), ownername varchar(25), floor numeric(4,0),primary key (ownerID:));Choose the correct option regarding the above statement

a. The statement is syntactically wrong

b. It creates a relation with three attributes ownerID, ownername, floor in which floor cannot be null.

c. It creates a relation with three attributes ownerID, ownername, floor in which ownerID cannot be null.

d. It creates a relation with three attributes ownerID, ownername, floor in which ownername must consist of at least 25 characters.

  • c. It creates a relation with three attributes ownerID, ownername, floor in which ownerID cannot be null.

Q. What does the notnull integrity constraint do?

a. It ensures that at least one tuple is present in the relation

b. It ensures that at least one foreign key is present in the relation

c. It ensures that all tuples have a finite value on a specified attribute

d. It ensures that all tuples have finite attributes on all the relations

  • c. It ensures that all tuples have a finite value on a specified attribute

Q. Which SQL function is used to count the number of rows in a SQL query?

a. COUNT()

b. NUMBER()

c. SUM()

d. COUNT(*)

  • d. COUNT(*)

Q. Which SQL keyword is used to retrieve a maximum value?

a. MOST

b. TOP

c. MAX

d. UPPER

  • c. MAX

Q. Which of the following is not a DDL command?

a. UPDATE

b. TRUNCATE

c. ALTER

d. None of the Mentioned

  • a. UPDATE

Q. Which of the following are TCL commands?

a. UPDATE and TRUNCATE

b. SELECT and INSERT

c. GRANT and REVOKE

d. ROLLBACK and SAVEPOINT

  • d. ROLLBACK and SAVEPOINT

Q. ________________ is not a category of SQL command.

a. TCL

b. SCL

c. DCL

d. DDL

  • b. SCL

Q. If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is usedby default ______________

a. ASC

b. DESC

c. There is no default value

d. None of the mentioned

  • a. ASC

Q. Which of the following statement is true?

a. DELETE does not free the space containing the table and TRUNCATE free the space containing the table

b. Both DELETE and TRUNCATE free the space containing the table

c. Both DELETE and TRUNCATE does not free the space containing the table

d. DELETE free the space containing the table and TRUNCATE does not free the space containing the table

  • a. DELETE does not free the space containing the table and TRUNCATE free the space containing the table

Q. What is the purpose of the SQL AS clause?

a. The AS SQL clause is used to change the name of a column in the result set or to assign a name to a derived column

b. The AS clause is used with the JOIN clause only

c. The AS clause defines a search condition

d. All of the mentioned

  • a. The AS SQL clause is used to change the name of a column in the result set or to assign a name to a derived column

Q. What does DML stand for?

a. Different Mode Level

b. Data Model Language

c. Data Mode Lane

d. Data Manipulation language

  • d. Data Manipulation language

Q. With SQL, how do you select all the records from a table named “Persons” where the valueof the column “FirstName” ends with an “a”?

a. SELECT * FROM Persons WHERE FirstName=’a’

b. SELECT * FROM Persons WHERE FirstName LIKE ‘a%’

c. SELECT * FROM Persons WHERE FirstName LIKE ‘%a’

d. SELECT * FROM Persons WHERE FirstName=’%a%’

  • c. SELECT * FROM Persons WHERE FirstName LIKE ‘%a’

Q. With SQL, how can you return all the records from a table named “Persons” sorteddescending by “FirstName”?

a. SELECT * FROM Persons SORT BY ‘FirstName’ DESC

b. SELECT * FROM Persons ORDER FirstName DESC

c. SELECT * FROM Persons SORT ‘FirstName’ DESC

d. SELECT * FROM Persons ORDER BY FirstName DESC

  • d. SELECT * FROM Persons ORDER BY FirstName DESC
Subscribe Now

Get All Updates & News