0% found this document useful (0 votes)
22 views3 pages

SQL 1

The document is a monthly test on SQL covering various topics such as operators, data types, SQL commands, and functions. It includes multiple-choice questions that assess knowledge of SQL syntax and concepts. Key topics include pattern matching, data retrieval, aggregate functions, and constraints.

Uploaded by

Magline Pereira
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)
22 views3 pages

SQL 1

The document is a monthly test on SQL covering various topics such as operators, data types, SQL commands, and functions. It includes multiple-choice questions that assess knowledge of SQL syntax and concepts. Key topics include pattern matching, data retrieval, aggregate functions, and constraints.

Uploaded by

Magline Pereira
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/ 3

MONTHLY TEST – JANUARY (SQL)

1. Which operator performs pattern matching?


a) BETWEEN operator b) LIKE operator c) EXISTS operator d) None of these
2. What operator tests column for the absence of data?
a) EXISTS operator b) NOT operator c) IS NULL operator d) None of these
3. In SQL, which of the following is not a data manipulation language commands?
a) SELECT b) CREATE c) INSERT d) UPDATE
4. Which SQL keyword is used to retrieve only unique values?
a) DISTINCTIVE b) UNIQUE c) DISTINCT d) DIFFERENT
5. Which of the following SQL commands is used to retrieve data?
a) DELETE b) INSERT c) SELECT d) JOIN
6. Which of the following is a SQL aggregate function?
a) LEFT b) AVG c) JOIN d) LEN
7. Which SQL statement is used to delete data FROM a database?
a) COLLAPSE b) REMOVE c) ALTER d) DELETE
8. Which SQL keyword is used to sort the result-set?
a) SORT BY b) ORDER c) ORDER BY d) SORT
9. The __________clause of SELECT query allows us to select only those rows in the results that satisfy a
specified condition.
a) Where b) from c) having d) like
10. Which of the following function is used to FIND the largest value from the given data in MYSQL?
a) MAX () b) MAXIMUM () c) LARGEST () d) BIG ()
11. The data types CHAR (n) and VARCHAR (n) are used to create _______ and _______ types of string/text
fields in a database.
a) Fixed, equal b) Equal, variable c) Fixed, variable d) Variable, equal
12. What is the full form of DDL?
a) Dynamic Data Language b) Detailed Data Language
c) Data Definition Language d) Data Derivation Language
13. SELECT name FROM stu WHERE subject LIKE ‘_______ Computer Science’;
Which one of the following has to be added into the blank space to select the subject which has Computer
Science as its ending string?
a) $ b) _ c) || d) %

MONTHLY TEST – JANUARY (SQL)


1. Which operator performs pattern matching?
a) BETWEEN operator b) LIKE operator c) EXISTS operator d) None of these
2. What operator tests column for the absence of data?
a) EXISTS operator b) NOT operator c) IS NULL operator d) None of these
3. In SQL, which of the following is not a data manipulation language commands?
a) SELECT b) CREATE c) INSERT d) UPDATE
4. Which SQL keyword is used to retrieve only unique values?
a) DISTINCTIVE b) UNIQUE c) DISTINCT d) DIFFERENT
5. Which of the following SQL commands is used to retrieve data?
a) DELETE b) INSERT c) SELECT d) JOIN
6. Which of the following is a SQL aggregate function?
a) LEFT b) AVG c) JOIN d) LEN
7. Which SQL statement is used to delete data FROM a database?
a) COLLAPSE b) REMOVE c) ALTER d) DELETE
8. Which SQL keyword is used to sort the result-set?
a) SORT BY b) ORDER c) ORDER BY d) SORT
9. The __________clause of SELECT query allows us to select only those rows in the results that satisfy a
specified condition.
a) Where b) from c) having d) like
10. Which of the following function is used to FIND the largest value from the given data in MYSQL?
a) MAX () b) MAXIMUM () c) LARGEST () d) BIG ()
11. The data types CHAR (n) and VARCHAR (n) are used to create _______ and _______ types of string/text
fields in a database.
a) Fixed, equal b) Equal, variable c) Fixed, variable d) Variable, equal
12. What is the full form of DDL?
a) Dynamic Data Language b) Detailed Data Language
c) Data Definition Language d) Data Derivation Language
13. SELECT name FROM stu WHERE subject LIKE ‘_______ Computer Science’;
Which one of the following has to be added into the blank space to select the subject which has Computer
Science as its ending string?
a) $ b) _ c) || d) %
14. Which of the following function is not an aggregate function?
a) Round() b) Sum() c) Count () d) Avg ()
15. Select correct SQL query from below to find the temperature in increasing order of all cites.
a) SELECT city FROM weather ORDER BY temperature;
b) SELECT city, temperature FROM weather;
c) SELECT city, temperature FROM weather ORDER BY temperature;
d) SELECT city, temperature FROM weather ORDER BY city;
16. By default, ORDER BY clause lists the results in _______ order.
a) Descending b) Any c) Same d) Ascending
17. Which of the following attributes can be considered as a choice for primary key?
a)Name b)Street c) Roll No d) Subject
18. In the given query which keyword has to be inserted?
INSERT INTO employee______(1002, “Kausar”, 2000);
a) Table b) Values c) Relation d) Field
19. Select correct SQL query to rename a table named EMP as EMPLOYEE
a) alter table emp rename as employee b) alter table emp rename to employee
c) alter table rename emp employee d) alter table name emp as employee
20. Memory requirement for INTEGER data type is __________ bytes.
a) 1 b) 2 c) 4 d) 8
21. If column “Marks” contains the data set {25, 35, 25, 35, 38}, what will be the output after the execution of
the given query?
SELECT MARKS (DISTINCT) FROM STUDENTS;
a) 25, 35, 25, 35, 38 b) 25, 25, 35, 35, 38 c) 25, 35, 38 d) 25, 25, 35, 35
22. Maximum number of characters can be stored in CHAR data type.
a) 30 b) 50 c) 255 d) 65535
23. What is the full form of SQL?
a) Structured Query Language b) Structured Query List c) Simple Query Language d) None of these
24. Names given to the table and its columns can contain
a) alphabets a-z, digits 0-9 and _ (underscore) b) alphabets a-z, digits 0-9 and $ (dollar sign)
c) alphabets a-z, digits 0-9, _ (underscore) and $ (dollar sign) d) alphabets a-z and digits 0-9
25. Which of the following is not a constrain in MySql?
a) default b) create c) unique d) auto_increment

14. Which of the following function is not an aggregate function?


a) Round() b) Sum() c) Count () d) Avg ()
15. Select correct SQL query from below to find the temperature in increasing order of all cites.
a) SELECT city FROM weather ORDER BY temperature;
b) SELECT city, temperature FROM weather;
c) SELECT city, temperature FROM weather ORDER BY temperature;
d) SELECT city, temperature FROM weather ORDER BY city;
16. By default, ORDER BY clause lists the results in _______ order.
a) Descending b) Any c) Same d) Ascending
17. Which of the following attributes can be considered as a choice for primary key?
a)Name b)Street c) Roll No d) Subject
18. In the given query which keyword has to be inserted?
INSERT INTO employee______(1002, “Kausar”, 2000);
a) Table b) Values c) Relation d) Field
19. Select correct SQL query to rename a table named EMP as EMPLOYEE
a) alter table emp rename as employee b) alter table emp rename to employee
c) alter table rename emp employee d) alter table name emp as employee
20. Memory requirement for INTEGER data type is __________ bytes.
a) 1 b) 2 c) 4 d) 8
21. If column “Marks” contains the data set {25, 35, 25, 35, 38}, what will be the output after the execution of
the given query?
SELECT MARKS (DISTINCT) FROM STUDENTS;
a) 25, 35, 25, 35, 38 b) 25, 25, 35, 35, 38 c) 25, 35, 38 d) 25, 25, 35, 35
22. Maximum number of characters can be stored in CHAR data type.
a) 30 b) 50 c) 255 d) 65535
23. What is the full form of SQL?
a) Structured Query Language b) Structured Query List c) Simple Query Language d) None of these
24. Names given to the table and its columns can contain
a) alphabets a-z, digits 0-9 and _ (underscore) b) alphabets a-z, digits 0-9 and $ (dollar sign)
c) alphabets a-z, digits 0-9, _ (underscore) and $ (dollar sign) d) alphabets a-z and digits 0-9
25. Which of the following is not a constrain in MySql?
a) default b) create c) unique d) auto_increment

You might also like