MCQ : Select the correct answer.
1. What does SQL stand for?
a)Structured Query Language.
b)Simple Query Language.
c)Standardized Query Language.
d)System Query Language.
2. Which command is used to retrieve data from a table in SQL?
a)SELECT
b)INSERT
c)UPDATE
d)DELETE
3. Which command is used to add a new row in a table?
a) SELECT.
b) INSERT.
c) UPDATE.
d) DELETE.
4. Which command is used to modify existing data in a table?
a)SELECT
b)INSERT
c)UPDATE
d)DELETE
5. Which command is used to remove data from a table in SQL?
a)SELECT
b)INSERT
c)UPDATE
d)DELETE
6. Which SQL keyword is used to retrieve data from multiple tables?
a)SELECT
b)WHERE
c)JOIN
d)FROM
7. Which type of join returns only the rows that have matching values in both tables?
a) Outer Join
b) Inner Join
c) Left Join
d) Right Join
8. Which keyword is used to filter data in SQL?
a) WHERE
b) SELECT
c) JOIN
d) FROM
9. Which type of join returns all the rows from the left table and the matching rows from the
right table?
a) Outer Join
b) Inner Join
c) Left Join
d) Right Join
10. Which operator is used to combine multiple conditions in a WHERE clause in SQL?
a) AND
b) OR
c) NOT
d) XOR
11. Which SQL function is used to calculate the average value of a column?
a) SUM()
b) AVG()
c) MAX()
d) MIN()
12. Which SQL command is used to create a new table?
a) CREATE TABLE
b) ALTER TABLE
c) DROP TABLE
d) TRUCATENATE TABLE
13. Which SQL command is used to add a new column to an existing table?
a) CREATE TABLE
b) ALTER TABLE
c) DROP TABLE
d) TRUCATENATE TABLE
14. Which SQL command is used to change the data type of a column in an existing table?
a) MODIFY COLUMN
b) CHANGE COLUMN
c) UPDATE COLUMN
d) ALTER TABLE
15. Which SQL command is used to sort data in ascending order?
a) ORDER BY ASC
b) ORDER BY DESC
c) SORT BY ASC
d) SORT BY DESC
16. Which SQL operator is used to search for a specific pattern in a column?
a) IN
b) NOT
c) LIKE
d) EXISTS
17. What does PL/SQL stand for?
a) Procedural Language/Structured Query Language.
b) Programming Language/Structured Query Language.
c) Procedural Logic/Structured Query Language.
d) Programming Logic/Structured Query Language.
18. Which of the following is not a PL/SQL block?
a) Anonymous block.
b) Procedure.
c) Function.
d) Table.
19. Which of the following is the correct syntax for declaring a variable in PL/SQL?
a) DECLARE variable_name datatype;
b) DECLARE datatype variable_name;
c) datatype variable_name;
d) variable_name datatype;
20. Which of the following is the correct syntax for assigning a value to a variable in PL/SQL?
a) variable_name := value;
b) value := variable_name;
c) variable_name = value;
d) value = variable_name;
21. Which of the following is the correct syntax for declaring a constant in PL/SQL?
a) CONSTANT constant_name datatype := value;
b) constant_name CONSTANT datatype := value;
c) CONSTANT datatype constant_name := value;
d) datatype CONSTANT constant_name := value;
22. Which of the following is not a PL/SQL data type?
a) NUMBER
b) VARCHAR
c) DECIMAL
d) BOOLEAN
23. Which of the following is the correct syntax for declaring a record type in PL/SQL?
a) TYPE record_name IS RECORD (field1 datatype, field2 datatype);
b) TYPE record_name (field1 datatype, field2 datatype);
c) RECORD record_name (field1 datatype, field2 datatype);
d) RECORD record_name IS (field1 datatype, field2 datatype);
24. Which of the following is the correct syntax for declaring a record variable in PL/SQL?
a) record_name variable_name;
b) variable_name record_name;
c) variable_name record_name%ROWTYPE;
d) record_name%ROWTYPE variable_name;
25. Which of the following is the correct syntax for assigning values to a record variable in
PL/SQL?
a) variable_name := (value1, value2);
b) variable_name.field1 := value1;
c) variable_name(field1) := value1;
d) All the above
26. Which of the following is the correct syntax for creating a PL/SQL procedure?
a) CREATE PROCEDURE procedure_name IS BEGIN ... END;
b) PROCEDURE procedure_name IS BEGIN ... END;
c) CREATE PROCEDURE procedure_name (parameter1 datatype, parameter2 datatype) IS
BEGIN ... END;
d) PROCEDURE procedure_name (parameter1 datatype, parameter2 datatype) IS BEGIN ...
END;
27. What is the purpose of the EXCEPTION section in a PL/SQL block?
a) To declare variables
b) To define cursors
c) To handle errors and exceptions
d) All of the above are true
28. Which of the following is the correct syntax for defining a PL/SQL block with an
EXCEPTION section?
a) BEGIN ... EXCEPTION ... END;
b) BEGIN EXCEPTION ... END;
c) DECLARE ... BEGIN ... EXCEPTION ... END;
d) None of the above
29. Which of the following is the correct syntax for defining an anonymous PL/SQL block?
a) DECLARE ... BEGIN ... END;
b) BEGIN DECLARE ... END;
c) BEGIN ... END;
d) None of the above
30. Which of the following is the correct syntax for declaring an anonymous PL/SQL block with
an EXCEPTION section?
a) BEGIN ... EXCEPTION ... END;
b) BEGIN EXCEPTION ... END;
c) DECLARE ... BEGIN ... EXCEPTION ... END;
d) None of the above.

MCQ Select the correct answer.1. What does SQL stand fora.pdf

  • 1.
    MCQ : Selectthe correct answer. 1. What does SQL stand for? a)Structured Query Language. b)Simple Query Language. c)Standardized Query Language. d)System Query Language. 2. Which command is used to retrieve data from a table in SQL? a)SELECT b)INSERT c)UPDATE d)DELETE 3. Which command is used to add a new row in a table? a) SELECT. b) INSERT. c) UPDATE. d) DELETE. 4. Which command is used to modify existing data in a table? a)SELECT b)INSERT c)UPDATE d)DELETE 5. Which command is used to remove data from a table in SQL? a)SELECT b)INSERT c)UPDATE
  • 2.
    d)DELETE 6. Which SQLkeyword is used to retrieve data from multiple tables? a)SELECT b)WHERE c)JOIN d)FROM 7. Which type of join returns only the rows that have matching values in both tables? a) Outer Join b) Inner Join c) Left Join d) Right Join 8. Which keyword is used to filter data in SQL? a) WHERE b) SELECT c) JOIN d) FROM 9. Which type of join returns all the rows from the left table and the matching rows from the right table? a) Outer Join b) Inner Join c) Left Join d) Right Join 10. Which operator is used to combine multiple conditions in a WHERE clause in SQL? a) AND b) OR c) NOT d) XOR
  • 3.
    11. Which SQLfunction is used to calculate the average value of a column? a) SUM() b) AVG() c) MAX() d) MIN() 12. Which SQL command is used to create a new table? a) CREATE TABLE b) ALTER TABLE c) DROP TABLE d) TRUCATENATE TABLE 13. Which SQL command is used to add a new column to an existing table? a) CREATE TABLE b) ALTER TABLE c) DROP TABLE d) TRUCATENATE TABLE 14. Which SQL command is used to change the data type of a column in an existing table? a) MODIFY COLUMN b) CHANGE COLUMN c) UPDATE COLUMN d) ALTER TABLE 15. Which SQL command is used to sort data in ascending order? a) ORDER BY ASC b) ORDER BY DESC c) SORT BY ASC d) SORT BY DESC
  • 4.
    16. Which SQLoperator is used to search for a specific pattern in a column? a) IN b) NOT c) LIKE d) EXISTS 17. What does PL/SQL stand for? a) Procedural Language/Structured Query Language. b) Programming Language/Structured Query Language. c) Procedural Logic/Structured Query Language. d) Programming Logic/Structured Query Language. 18. Which of the following is not a PL/SQL block? a) Anonymous block. b) Procedure. c) Function. d) Table. 19. Which of the following is the correct syntax for declaring a variable in PL/SQL? a) DECLARE variable_name datatype; b) DECLARE datatype variable_name; c) datatype variable_name; d) variable_name datatype; 20. Which of the following is the correct syntax for assigning a value to a variable in PL/SQL? a) variable_name := value; b) value := variable_name; c) variable_name = value;
  • 5.
    d) value =variable_name; 21. Which of the following is the correct syntax for declaring a constant in PL/SQL? a) CONSTANT constant_name datatype := value; b) constant_name CONSTANT datatype := value; c) CONSTANT datatype constant_name := value; d) datatype CONSTANT constant_name := value; 22. Which of the following is not a PL/SQL data type? a) NUMBER b) VARCHAR c) DECIMAL d) BOOLEAN 23. Which of the following is the correct syntax for declaring a record type in PL/SQL? a) TYPE record_name IS RECORD (field1 datatype, field2 datatype); b) TYPE record_name (field1 datatype, field2 datatype); c) RECORD record_name (field1 datatype, field2 datatype); d) RECORD record_name IS (field1 datatype, field2 datatype); 24. Which of the following is the correct syntax for declaring a record variable in PL/SQL? a) record_name variable_name; b) variable_name record_name; c) variable_name record_name%ROWTYPE; d) record_name%ROWTYPE variable_name; 25. Which of the following is the correct syntax for assigning values to a record variable in PL/SQL? a) variable_name := (value1, value2); b) variable_name.field1 := value1;
  • 6.
    c) variable_name(field1) :=value1; d) All the above 26. Which of the following is the correct syntax for creating a PL/SQL procedure? a) CREATE PROCEDURE procedure_name IS BEGIN ... END; b) PROCEDURE procedure_name IS BEGIN ... END; c) CREATE PROCEDURE procedure_name (parameter1 datatype, parameter2 datatype) IS BEGIN ... END; d) PROCEDURE procedure_name (parameter1 datatype, parameter2 datatype) IS BEGIN ... END; 27. What is the purpose of the EXCEPTION section in a PL/SQL block? a) To declare variables b) To define cursors c) To handle errors and exceptions d) All of the above are true 28. Which of the following is the correct syntax for defining a PL/SQL block with an EXCEPTION section? a) BEGIN ... EXCEPTION ... END; b) BEGIN EXCEPTION ... END; c) DECLARE ... BEGIN ... EXCEPTION ... END; d) None of the above 29. Which of the following is the correct syntax for defining an anonymous PL/SQL block? a) DECLARE ... BEGIN ... END; b) BEGIN DECLARE ... END; c) BEGIN ... END; d) None of the above 30. Which of the following is the correct syntax for declaring an anonymous PL/SQL block with
  • 7.
    an EXCEPTION section? a)BEGIN ... EXCEPTION ... END; b) BEGIN EXCEPTION ... END; c) DECLARE ... BEGIN ... EXCEPTION ... END; d) None of the above.