Chapter-1 Database Management System
1. A relation can have only one _____________ key and may have more than one _____________keys.
(a) Primary, Candidate
(b) Candidate, Alternate
(c) Candidate, Primary
(d) Alternate, Candidate
(a) Primary, Candidate
2. The vertical subset of a table is known as _____________.
(a) Tuple
(b) Row
(c) Attribute
(d) Relation
(c) Attribute
3. if software is released under open source, it means _____________.
(a) It is expensive
(b) Its source code is available to the user
(c) It belongs to a company
(d) It is a DBMS
(b) Its source code is available to the user
4. Which of the following columns in a student table can be used as the primary key?
(a) Class
(b) Section
(c) First Name
(d) Admission No
(d) Admission No
5. A tuple is also known as a _____________ .
(a) table
(b) relation
(c) row
(d) field
(c) row
6. An attribute is also known as a _____________.
(a) table
(b) relation
(c) row
(d) column
(d) column
7. A field or a combination of field in a table that has a unique value for each row is called _____________
(a) Candidate Key
(b) Foreign Key
(c) Main Key
(d) Alternate key
(a) Candidate key
8. Which of the following is a open source DBMS package ?
(a) ORACLE DB
(b) Enterprise DB
(c) IBM DB2
(d) SyBase
(b) Enterprise DB
9. An RDBMS is used to _____________.
(a) Store data in a random manner
(b) validate to modify data
(c) retrieve date through queries
(d) do all of these
(d) do all of these
10. The mobile database package SQLite is supported by _____________.
(a) Android
(b) Blackberry
(c) Window Phone
(d) all of these
(a) all of these
11. What does DBMS stand for?
(a) Database Management System
(b) Data Base Managing Software
(c) Data Backup Management System
(d) None of the above
(a) Database Management System
12. The primary key in a database is used to___________.
(a) Link tables
(b) Allow duplicate values
(c) Identify a record uniquely
(d) Create indexes
(c) Identify a record uniquely
13. What is a foreign key?
(a) A unique key in the table
(b) A secondary key
(c) A key used to unlock data
(d) A primary key of another table
(d) A primary key of another table
14. What is a candidate key?
(a) A key that can uniquely identify a record
(b) A primary key of a table
(c) A key composed of more than one attribute
(d) A foreign key in another table
(a) A key that can uniquely identify a record
15. Which of the following is a DBMS software?
(a) MS Excel
(b) Windows
(c) SAP
(d) Oracle
(d) Oracle
16. Which is a NoSQL database?
(a) MongoDB
(b) MySQL
(c) PostgreSQL
(d) PostgreSQL
(a) MongoDB
17. A composite key is__________.
(a) A primary key
(b) A non-unique key
(c) A key in another table
(d) A key with multiple fields
(d) A key with multiple fields
18. What does the term "tuple" refer to in a database?
(a) A field
(b) A table
(c) A record
(d) A key
(c) A record
19. A unique key_____________.
(a) Cannot have NULL values
(b) Can have NULL values
(c) Is always a foreign key
(d) Is never indexed
(b) Can have NULL values
20. Which is a distributed database?
(a) Centralized on one server
(b) Used for backups
(c) Stored on multiple servers
(d) Non-relational
(c) Stored on multiple servers
Chapter-2 Introduction to MySQL
1. SQL stands for_________________.
(a) Structured Query Language
(b) Statistical Query Language
(c) Standard Query Language
(d) Structured Query Library
(a) Structured Query Language
2. SQL was initially developed by _________________.
(a) IBM Inc.
(b) Microsoft Inc.
(c) Oracle Inc.
(d) Hewlett Packard
(a) IBM Inc.
3. Which of the following is a DDL command?
(a) CREATE
(b) SELECT
(c) COMMIT
(d) GRANT
(a) CREATE
4. Which of the following is a DML command?
(a) ALTER
(b) INSERT
(c) SAVEPOINT
(d) REVOKE
(b) INSERT
5. Which of the following is a DCL command?
(a) DROP
(b) DELETE
(c) UPDATE
(d) ROLLBACK
(d) ROLLBACK
6. Which of the following is a TCL command?
(a) CREATE
(b) SELECT
(c) COMMIT
(d) GRANT
(d) GRANT
7. DELETE command is used to _____________.
(a) removes a Table
(b) removes a Database
(c) removes records
(d) all of these
(c) removes records
8. IN operator is used to _______________.
(a) checks a value in a list
(b) matches a substring
(c) corrects a data
(d) inserts a column
(a) checks a value in a list
9. Which statement is used to insert new data in a table?
(a) ADD RECORD
(b) INSERT RECORD
(c) INSERT INTO
(d) INSERT ROW
(c) INSERT INTO
10. Which SQL keyword(s) is/are used to sort the rows in the output?
(a) SORTED ORDER
(b) SORT
(c) ORDER BY
(d) SORT BY
(c) ORDER BY
11. Which of the following is not a valid SQL statement?
(a) INSERT
(b) DELETE
(c) MODIFY
(d) UPDATE
(c) MODIFY
12. In a SELECT query, the WHERE clause is used to___________.
(a) Group records
(b) Filter records
(c) Sort records
(d) Join tables
(b) Filter records
13. Which of the following is used to retrieve data from a database?
(a) INSERT
(b) SELECT
(c) UPDATE
(d) DELETE
(b) SELECT
14. Which SQL clause is used to filter records?
(a) SELECT
(b) FROM
(c) WHERE
(d) GROUP BY
(c) WHERE
15. What is the purpose of the ORDER BY clause in SQL?
(a) To filter the result set
(b) To update the result set
(c) To limit the result set
(d) To sort the result set
(d) To sort the result set
16. Which SQL command is used to delete all rows from a table?
(a) DELETE
(b) REMOVE
(c) TRUNCATE
(d) DROP
(c) TRUNCATE
17. Which SQL statement is used to update existing data in a table?
(a) MODIFY
(b) UPDATE
(c) CHANGE
(d) ALTER
(b) UPDATE
18. What is the default sorting order of the ORDER BY clause?
(a) Ascending
(b) Descending
(c) Alphabetical
(d) Random
(a) Ascending
19. Which of the following SQL statements will add a new column to an existing table?
(a) MODIFY TABLE
(b) ALTER TABLE
(c) NEW COLUMN
(d) UPDATE TABLE
(b) ALTER TABLE
20. Which keyword is used to create a new table in SQL?
(a) NEW
(b) MAKE
(c) CREATE
(d) ADD
(c) CREATE
21. What does the LIKE operator do in SQL?
(a) Performs a case-sensitive search
(b) Finds an exact match
(c) Finds a pattern match
(d) Finds an approximate match
(c) Finds a pattern match
22. Which SQL command is used to remove a table from a database?
(a) DELETE TABLE
(b) DROP TABLE
(c) REMOVE TABLE
(d) REMOVE DATABASE
(b) DROP TABLE
23. What does the NULL keyword represent in SQL?
(a) Empty string
(b) Unknown or missing value
(c) Zero value
(d) A specific value
(b) Unknown or missing value
24. Which SQL statement is used to retrieve unique records from a table?
(a) SELECT UNIQUE
(b) SELECT DISTINCT
(c) SELECT DISTINCT FROM
(d) SELECT DISTINCT RECORD
(b) SELECT DISTINCT
25. Which SQL command is used to remove specific data from a table?
(a) DELETE
(b) REMOVE
(c) TRUNCATE
(d) DROP
(a) DELETE
26. Which of the following operators is used for pattern matching in SQL?
(a) IN
(b) LIKE
(c) BETWEEN
(d) EXISTS
(b) LIKE
27. Which of the following SQL statements will retrieve all records from the "customers" table?
(a) SELECT customers FROM *;
(b) RETRIEVE ALL FROM customers;
(c) SELECT * FROM customers;
(d) SELECT ALL customers;
(c) SELECT * FROM customers;
28. Which SQL keyword is used to remove duplicate values from the result set?
(a) REMOVE
(b) DISTINCT
(c) UNIQUE
(d) DIFFERENT
(b) DISTINCT
29. Which SQL command is used to update an existing table's structure?
(a) UPDATE TABLE
(b) MODIFY TABLE
(c) CHANGE TABLE
(d) ALTER TABLE
(d) ALTER TABLE
30. Which of the following is used to sort the result set in SQL?
(a) ORDER BY
(b) SORT BY
(c) GROUP BY
(d) HAVING
(a) ORDER BY
31. Which of the following SQL statements will return all records from the "students" table where the "age" column is greater than 18?
(a) SELECT * FROM students WHERE age > 18;
(b) SELECT * FROM students WHERE age >= 18;
(c) SELECT * FROM students WHERE age = 18;
(d) SELECT * FROM students HAVING age > 18;
(a) SELECT * FROM students WHERE age > 18;
32. Which of the following SQL commands is used to remove a database?
(a) DELETE DATABASE
(b) DROP DATABASE
(c) REMOVE DATABASE
(d) REMOVE DATABASE TABLE
(b) DROP DATABASE
33. Which SQL command is used to create a new record in a table?
(a) NEW RECORD
(b) ADD RECORD
(c) INSERT INTO
(d) CREATE
Ans
34. Which of the following is used to compare a value against a set of values?
(a) BETWEEN
(b) IN
(c) LIKE
(d) EQUALS
(b) IN
35. The wildcard character used for zero or more characters in SQL is:
(a) %
(b) _
(c) *
(d) ?
(a) %
36. Which of the following operators is used to compare a value within a specific range?
(a) BETWEEN
(b) IN
(c) LIKE
(d) EQUALS
(a) BETWEEN
37. The SQL statement to create a database is:
(a) CREATE DB
(b) CREATE DATABASE
(c) MAKE DATABASE
(d) NEW DATABASE
(b) CREATE DATABASE
38. To check for NULL values in SQL, use__________
(a) = NULL
(b) IS NULL
(c) NULL
(d) EQUAL NULL
(b) IS NULL
39. Which command is used to rename a table?
(a) RENAME TABLE
(b) ALTER TABLE ... RENAME TO
(c) MODIFY TABLE
(d) CHANGE TABLE NAME
(b) ALTER TABLE ... RENAME TO
40. A table can have multiple:
(a) Primary keys
(b) Unique keys
(c) Foreign keys
(d) Both b and c
(d) Both b and c