0% found this document useful (0 votes)
62 views6 pages

MCQs 1

Uploaded by

savitamudhal1982
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views6 pages

MCQs 1

Uploaded by

savitamudhal1982
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

RDBMS MCQs

1. What does SQL stand for?


a) Structured Query Language
b) Standard Query Language
c) Simple Query Language
d) Sequential Query Language
2. Which of the following is NOT a valid keyword in SQL?
a) SELECT
b) DELETE
c) WHERE
d) INCLUDE
3. Which of the following operators is used to compare two values in SQL?
a) +
b) =
c) <>
d) &
4. What is the purpose of the SQL keyword “DISTINCT” in a SELECT statement?
a) To retrieve unique values from a column
b) To filter NULL values
c) To delete duplicate records
d) To sort the result set
5. Which of the following tasks CANNOT be accomplished using SQL?
a) Creating and modifying database structures
b) Writing complex algorithms for data analysis
c) Retrieving specific data from a database
d) Adding new data to a database
6. Which of the following is basis for SQL?
a) SQL Server
b) DBMS
c) RDBMS
d) Oracle
7. Which character is used to separate SQL statements in database systems?
a) :
b) %
c) _
d) ;

8. Which statement(s) are mandatory in a simple SQL SELECT statement?


a) Select, From
b) Select, OrderBy
c) Select, Where
d) Select, GroupBy
9. Which of the following is a default join type?
a) Right join
b) Left join
c) Inner join
d) Outer join
10. Which of the following command is used to create a database in SQL?
a) MAKE
b) CREATE
c) INSERT
d) DEVELOP
11. Which of the following statement is true about views in SQL?
a) We can delete but not insert rows in a view
b) We cannot insert and delete rows in a view
c) We can insert but not delete rows in a view
d) We can insert and delete rows in a view
12. What is the full form of PL in PL/SQL?
a) Programming Language
b) Programming Logic
c) Procedural Language
d) Procedural Logic
13. Which of the following can execute a trigger in PL/SQL?
a) Oracle server
b) User
c) Both user and oracle server
d) Neither user nor oracle server
14. Which of the following SQL statement selects only unique values from ‘section’ column of table ‘school’?
a) SELECT section FROM school;
b) SELECT DISTINCT section FROM school;
c) SELECT * FROM school;
d) SELECT ALL section FROM school;
15. Which SQL keyword is used to sort the data returned by a SELECT statement?
a) Group
b) Order
c) Group By
d) Order By
16. The SQL LIKE operator is used in which of the following clause?
a) Having
b) Select
c) Where
d) Group by

17.Which of the following are some common RDBMS in use?

 Oracle
 MySQL
 Heidi
 SQL
 All of the above
18. What command is used to create a new table in SQL?
a.CREATE TABLE
b. BUILD TABLE
c. GENERATE TABLE
d. None of the above
19. What does the following statement in SQL do?
DROP TABLE student;
a.Deletes a table called student.
b.Creates a table called student.
c.Check if there is a table called student.
d.None of the above.
20. Which of the following are types of Unicode character string types in SQL?
● nchar
● ntext
● Both A and B
● None of the above
21.What does BLOB in SQL stand for?
● Binary Large Objects
● Big Large Objects
● Binary Language for Objects
● None of the above

22. Which of the following datatype is most appropriate for storing a string of up to 255 characters?
● TEXT
● TINY TEXT
● BLOB
● BINARY
23. What happens when no value is inserted in an ENUM list?
● Nothing happens
● The code will crash
● A blank value is inserted in that case
● None of the above
24. What is the range of integers that can be held in the MEDIUMINT datatype of SQL?
● Signed numbers in the range of -8388608 to 8388607.
● Unsigned numbers in the range of 0 to 16777215.
● Both A and B.
● None of the above.
25.What does the following code snippet do?
ALTER TABLE STUDENT ADD(ADDRESS VARCHAR2(20));
● Adds a column called ADDRESS in the table student.
● Checks if a column called ADDRESS is present in the table student.
● Invalid Syntax
● None of the above

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


 REVOKE
 GRANT
 UPDATE
 RENAME
27.Which of the following commands is used to delete all rows and free up space from a table?
 TRUNCATE
 DROP
 DELETE
 ALTER
Show Explanation
28.Which of the following commands are a part of Data Control Language?
 Revoke
 Grant
 Both A and B
 None of the above
Show Explanation
29 What does the following code snippet do?
DELETE FROM STUDENTS
WHERE AGE = 16;
ROLLBACK;
 Performs an undo operation on the delete operation .
 Deletes the rows from the table where AGE = 16
 Deletes the entire table
 None of the above
Show Explanation
30 When is the wildcard in WHERE clause used?
 An exact match is necessary for a CREATE statement.
 An exact match is not possible in a SELECT statement.
 An exact match is necessary for a SELECT statement.
 None of the above.
Show Explanation
31 Which of the following is the full form of DDL?
 Data definition language
 Data derivation language
 Dynamic data language
 Detailed data language
Show Explanation
32 Which SQL constraint do we use to set some value to a field whose value has not been added explicitly?
 UNIQUE
 NOT NULL
 DEFAULT
 CHECK
Show Explanation
33 What are rows of a relation known as?
 Degree
 Entity
 Tuple
 None
 Show Explanation
34 During transaction before commit which of the following statements is done automatically in case of
shutdown?
 Rollback
 Commit
 View
 Flashback
 Show Explanation
35 Which of the following allows you to uniquely identify a tuple?
 Schema
 Attribute
 Super key
 Domain
Show Explanation
36 How many operations are considered to be the most basic SQL operations?
 4
 3
 2
 1
Show Explanation
37 Which of the following is not a SQL command?
 DELETE
 ORDER BY
 SELECT
 WHERE
Show Explanation
38 What does the following code snippet do?
SELECT TOP 5 * FROM students;
 Select the top 5 entries for all the columns in the students' table.
 Select all the entries from the students' table other than the top 5 entries
 Selects all entries from the student table except 5 random rows
 None of the above
Show Explanation
39 Which of the following matches the definition given below: It is an artificial key that aims to uniquely identify
each record.
 Primary Key
 Foreign Key
 Surrogate Key
 Composite Key
Show Explanation
40 Which of the following commands are used to put a restriction on the number of rows returned from a query?
 LIMIT
 LIKE
 WHERE
 GROUP BY
Show Explanatio
41 Which of the following are valid logical operators in SQL?
 SOME
 ALL
 AND
 All of the above
Show E
42 of the following commands is used to delete a trigger in SQL?
 DROP
 DELETE
 ALTER
 None of the above
Show Explanatio
43 Which of the following can replace the below query?
SELECT Name, ID
FROM Student, Courses
WHERE Student_ID = Courses_ID;
 Select Name,ID from Courses,Student where Student_ID = ID;
 Select Name, ID from Student natural join Courses;
 Select Name, ID from Student;
 Select ID from Student join Courses;
Show Explanation

44 What will be the output of the following code snippet?


SELECT ROUND (TRUNCATE (MOD (2500, 20), -1), 2) FROM dual;
 Error
 00
 0
 1
Show Explanation
45 Which of the following SQL functions compares the similarities of 2 strings and returns the result as a 4
character code?
 SOUNDEX
 DIFFERENCE
 CONCAT
 None of the above
Show Explanation

46 Which of the following operators is used to compare a value to a list of literal values that have been specified?
 ANY
 BETWEEN
 IN
 ALL
Show Explanation

47 Which of the following is not a valid SQL type?


 NUMERIC
 DECIMAL
 CHARACTER
 All of the above
Show Explanation

48 Which of the following constraints can be defined only at the column level?
 UNIQUE
 NOT NULL
 CHECK
 PRIMARY KEY
Show Explanation

49 Which of the following is not a valid aggregate function?


 count()
 Sum()
 Avg()
 all of the above
Show Explanation

50 Which of the following is known as the minimal super key?


 Primary key
 Foreign key
 Candidate key
 None of the above
Show Explanation

51 Which of the following is also known as a concatenated key?


 Primary Key
 Foreign Key
 Surrogate Key
 Composite Key
Show Explanation

52 Which of the following functions do we use to get a specified day of the month for a given date?
 DAY
 DATEPART
 GETDATE
 CURRENT_TIMESTAMP
Show Explanation

53 Select the valid SQL type.


 NUMERIC
 CHARACTER
 FLOAT
 All of the above
Show Explanation

54 Group of operations that form a single logical unit of work called?


 Network
 Unit
 Transaction
 None of the above
Show Explanation

55 How can SQL injections occur?


 Data is used to dynamically construct an SQL Query.
 Unintended data from an untrusted source enters the application.
 Both A and B.
 None of the above.
Show Explanation

56 How can the user change “Scaler” into “Interviewbit” in the “Name” column in the Users table?
 UPDATE User SET Name = 'Scaler' INTO Name = 'Interviewbit'
 MODIFY Users SET Name = 'Interviewbit' WHERE Name = 'Scaler'
 MODIFY Users SET Name = 'Scaler' INTO Name = 'Interviewbit'
 UPDATE Users SET Name = 'Interviewbit' WHERE Name = 'Scaler'
Show Explanation

57 How can we view all the triggers currently in the database?


 SHOW
 VIEW
 READ
 None of the above
Show Explanation

58 Identify the concurrency-based protocol?


 Lock based protocol
 Two-phase locking protocol
 Timestamp ordering protocol
 All
Show Explanation

59 NATURAL JOIN can also be termed as -


 Combination of Union and cartesian product
 Combination of Selection and cartesian product
 Combination of Projection and cartesian product
 None of the above
60 Which of the following commands is used to delete all rows and free up space from a table?
 TRUNCATE
 DROP
 DELETE
 ALTER
61 Which of the following commands are a part of Data Control Language?
 Revoke
 Grant
 Both A and B
 None of the above
Show Explanati

You might also like