0% found this document useful (0 votes)
10 views13 pages

Quiz Bank

The document contains two quizzes focused on database management systems (DBMS) and SQL concepts. Quiz 1 covers topics such as database design, entity-relationship diagrams, and attributes, while Quiz 2 focuses on SQL commands, aggregate functions, and relational algebra operations. Each quiz consists of multiple-choice questions aimed at assessing knowledge in these areas.

Uploaded by

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

Quiz Bank

The document contains two quizzes focused on database management systems (DBMS) and SQL concepts. Quiz 1 covers topics such as database design, entity-relationship diagrams, and attributes, while Quiz 2 focuses on SQL commands, aggregate functions, and relational algebra operations. Each quiz consists of multiple-choice questions aimed at assessing knowledge in these areas.

Uploaded by

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

Quiz -1

1.​ Which of the following is NOT an advantage of a DBMS?​


a) Data redundancy reduction​
b) Faster data retrieval​
c) Inconsistent data management​
d) Scalability​

2.​ How does a DBMS improve data security compared to traditional file systems?​
a) By allowing unauthorized access​
b) By implementing access control and authentication​
c) By storing data in unstructured formats​
d) By eliminating the need for backups

3.​ Which phase of database design involves gathering user requirements and
understanding data needs?​
a) Conceptual Design​
b) Logical Design​
c) Requirements Collection and Analysis​
d) Physical Design​

4.​ During which phase is the Entity-Relationship (ER) model typically created?​
a) Physical Design​
b) Conceptual Design​
c) Transaction Implementation​
d) Requirements Collection​

5.​ What is the purpose of the Physical Design phase in database development?​
a) To determine how data will be stored and accessed efficiently​
b) To define business rules for data relationships​
c) To gather system requirements from stakeholders​
d) To create conceptual schemas using high-level models
6.​ Which shape is used to represent a relationship in an ER diagram?​
a) Rectangle​
b) Oval​
c) Diamond​
d) Triangle
7.​ What is the first step in designing an ER diagram?​
a) Identify relationships​
b) Identify entities​
c) Draw the final ER diagram​
d) Define primary keys​
8.​ What does cardinality define in an ER diagram?​
a) The number of entities in the database​
b) The attributes of an entity​
c) The number of relationships between entities​
d) The security level of the database​

9.​ Why is refining and validating an ER diagram important before implementation?​


a) To make the diagram more visually appealing​
b) To ensure data consistency and avoid redundancy​
c) To increase the number of relationships​
d) To add unnecessary attributes
10.​What does a double rectangle represent in an ER diagram?​
a) Weak entity​
b) Strong entity​
c) Derived attribute​
d) Composite attribute
11.​Which shape is used to represent an entity in an ER diagram?​
a) Oval​
b) Diamond​
c) Rectangle​
d) Triangle​

12.​What shape is used to denote attributes in an ER diagram?​


a) Rectangle​
b) Oval​
c) Diamond​
d) Parallelogram​

13.​In an ER diagram, relationships between entities are represented by which shape?​


a) Rectangle​
b) Circle​
c) Diamond​
d) Hexagon​

14.​Which shape is used to represent a weak entity in an ER diagram?​


a) Double oval​
b) Double rectangle​
c) Double diamond​
d) Single rectangle​

15.​A primary key attribute is usually represented in an ER diagram by:​


a) An underlined oval​
b) A bold rectangle​
c) An oval with a dotted border​
d) An underlined attribute inside an oval

16.​Which of the following best defines an entity in an ER diagram?

a) A collection of related attributes that represent a real-world object​


b) A type of relationship between two tables in a database​
c) A process that normalizes data in a relational model​
d) A constraint applied to database keys

17.​Which of the following best describes the difference between composite and
simple (atomic) attributes in an ER diagram?
18.​a) Composite attributes can be divided into smaller sub-parts, whereas simple attributes
cannot be divided further.​
b) Simple attributes can have multiple values, whereas composite attributes can have
only one value.​
c) Composite attributes are always primary keys, while simple attributes are not.​
d) Simple attributes must be derived, whereas composite attributes are stored directly in
the database.
19.​Which of the following is an example of a derived attribute?
a) Date of Birth
b) Age
c) Employee ID
d) Phone Number

20.​What is an entity type in a database context?

a) A specific instance of an object


b) A collection of attributes
c) A general category of objects with similar characteristics
d) A relationship between objects

21.​An entity set is best described as:

a) A single attribute of an entity


b) A collection of entities of the same type
c) A relationship between two entities
d) A specific attribute value

22.​Which of the following is NOT a characteristic of an attribute?

a) It describes a characteristic of an entity.


b) It can have multiple values for a single entity.
c) It has a specific data type.
d) It is always a single value for an entity.
23.​A relationship type defines:

a) A specific instance of a relationship between entities


b) The type of relationship between entity types
c) An attribute of an entity
d) A set of attributes

24.​A relationship set is:

a) A single relationship between two entities


b) A collection of relationships of the same type
c) A type of attribute
d) An entity type
Quiz -2

1. Why is selecting appropriate data types important when designing SQL tables?​

A. It simplifies data entry only​
B. It reduces storage space and improves performance​
C. It is required for syntax validation only​
D. It prevents data redundancy automatically​

2. Which of the following is NOT an aggregate function in SQL?​



A. COUNT()​
B. AVG()​
C. MAX()​
D. SELECT()​
3. What is the primary purpose of the GROUP BY clause in SQL?​
A. Filter rows before grouping​
B. Sort the data​
C. Group rows based on one or more columns for aggregation​
D. Delete duplicate rows​
4. How does the HAVING clause differ from the WHERE clause?​

A. HAVING filters individual rows, WHERE filters groups​
B. WHERE filters groups, HAVING filters individual rows​
C. WHERE filters rows before grouping; HAVING filters after grouping​
D. They both do the same thing​
5. What does the SQL DELETE command do?​
A. Deletes the table structure​
B. Deletes all columns in a table​
C. Deletes one or more rows from a table​
D. Deletes constraints only​
6. What is a nested (sub) query in SQL?​

A. A query that joins three tables​
B. A query inside another query​
C. A query that updates itself​
D. A query that deletes other queries

7. In SQL, how is a nested query executed?​

A. Outer query executes first, then inner​
B. Inner query executes first, then outer​
C. Both execute simultaneously​
D. Execution order is random​
8. What is the difference between DELETE and DROP in SQL?​
A. DELETE removes columns; DROP removes tables​
B. DELETE removes rows; DROP removes the entire table structure​
C. DELETE and DROP are synonyms​
D. DELETE is faster than DROP​
9. In relational algebra, what does the Projection (π) operation do?​
A. Filters rows based on a condition​
B. Removes duplicate rows​
C. Selects specific columns from a relation​
D. Sorts the relation​
10. What will the following SQL query return?

SELECT DepartmentID, COUNT(*) AS EmployeeCount


FROM Employees
GROUP BY DepartmentID
HAVING COUNT(*) > 20;

A. All employees in departments with fewer than 20 members​


B. Employees who earn more than $20​
C. Departments with more than 20 employees​
D. Total number of departments​
11. Which of the following SQL statements is used to remove an entire table from a
database permanently?​
A. DELETE​
B. REMOVE​
C. DROP​
D. TRUNCATE​
12. What does the following SQL command do?

DELETE FROM Student WHERE Branch = 'ME';

A. Deletes the Student table​


B. Deletes all students​
C. Deletes students from Mechanical Engineering branch​
D. Drops the 'Branch' column
13. In SQL, which clause is used to filter groups created by the GROUP BY clause?​
A. WHERE​
B. ORDER BY​
C. HAVING​
D. FILTER

14. What will the relational algebra operation σ(CGPA > 8.0)(Student) do?​
A. Select all attributes of students with CGPA greater than 8.0​
B. Project the CGPA of all students​
C. Remove students with CGPA less than 8.0​
D. Sort students by CGPA​
15. Which SQL aggregate function returns the number of rows matching a condition?​
A. COUNT()​
B. SUM()​
C. AVG()​
D. MAX()​
16. What is the key difference between DELETE and TRUNCATE in SQL?​
A. DELETE removes the structure, TRUNCATE doesn’t​
B. DELETE is faster than TRUNCATE​
C. TRUNCATE cannot be rolled back; DELETE can​
D. DELETE works only on numeric fields​
17. Which relational algebra operation is used to fetch specific attributes (columns) from
a relation?​
A. σ (Selection)​
B. π (Projection)​
C. × (Cartesian Product)​
D. ⨝ (Join)​
18. What type of subquery is executed once for every row of the outer query?​
A. Scalar subquery​
B. Correlated subquery​
C. Nested subquery​
D. Uncorrelated subquery​
19. Which SQL command is used to add a new column to an existing table?​
A. ALTER TABLE ADD COLUMN​
B. MODIFY TABLE ADD​
C. ADD COLUMN TO TABLE​
D. INSERT COLUMN

20. In relational algebra, which operation would combine EMPLOYEE and DEPARTMENT
tables using a common attribute DeptID?​
A. Cartesian Product​
B. Division​
C. Natural Join​
D. Selection​

21. In SQL, which part of a nested query is executed first?


A. Outer query
B. Main SELECT statement
C. Innermost subquery
D. WHERE clause

22. What is the result of the following SQL query?

SELECT Name FROM Employee


WHERE DeptID = (SELECT DeptID FROM Department WHERE DeptName = 'HR');
A. All employees in the 'HR' department
B. All employees from the Department table
C. Error – too many values
D. Employees with NULL DeptID

23. Which SQL clause is used to filter the result after GROUP BY?
A. WHERE
B. ORDER BY
C. HAVING
D. LIMIT

24. Which of the following is NOT a valid use case for subqueries?
A. Filtering rows
B. Creating new tables
C. Updating rows
D. Calculating aggregate values

25. What will happen if a subquery returns multiple rows in a context expecting a single row?
A. Executes normally
B. Throws an error
C. Ignores extra rows
D. Joins automatically

26. Which of the following is TRUE about correlated subqueries?


A. They execute only once
B. They are independent of outer query
C. They reference columns from the outer query
D. They must use GROUP BY

27. Which clause is evaluated first in a SQL SELECT statement?


A. SELECT
B. FROM
C. WHERE
D. ORDER BY

28. Which JOIN returns all combinations of rows from two tables?
A. INNER JOIN
B. LEFT JOIN
C. RIGHT JOIN
D. CROSS JOIN

29. In SQL, what keyword is used to compare a value with the result of a subquery returning
multiple values?
A. =
B. IN
C. EXISTS
D. LIKE

30. What does this SQL query do?

SELECT Name FROM Employee WHERE EXISTS (SELECT * FROM Department WHERE
DeptID = 'D1');
A. Returns employees from D1 only
B. Returns all employees if Department has D1
C. Returns no rows
D. Returns only departments

31. Which relational algebra operator selects tuples that satisfy a given condition?

●​ a) Project
●​ b) Join
●​ c) Select
●​ d) Union

32. Given two relations R and S, which operator combines them to produce a relation containing
all tuples from both R and S?
●​ a) Intersection
●​ b) Difference
●​ c) Union
●​ d) Product

33. The relational algebra operator that combines tuples from two relations based on a common
attribute is:

●​ a) Select
●​ b) Project
●​ c) Join
●​ d) Union

34. What does the following relational algebra expression compute?


πname,age(Student)\pi_{name, age}(Student)πname,age​(Student)

●​ a) All tuples from the Student relation


●​ b) Only the name attribute from the Student relation
●​ c) Only the name and age attributes from the Student relation
●​ d) The age attribute from the Student relation

35. Which set operation returns tuples that are in both relation R and relation S?

●​ a) Union
●​ b) Difference (R - S)
●​ c) Intersection
●​ d) Cartesian Product

36. Which command is used to add a new column to an existing table?​


A. UPDATE TABLE​
B. ADD COLUMN​
C. ALTER TABLE ... ADD​
D. MODIFY TABLE​
37. Which of the following will insert a new record with values into a table?​
A. INSERT INTO table_name (col1, col2) VALUES (val1, val2);​
B. INSERT (col1, col2) INTO table_name VALUES (val1, val2);​
C. ADD INTO table_name (col1, col2) VALUES (val1, val2);​
D. PUT INTO table_name VALUES (val1, val2);​
38 . To insert multiple rows at once, the correct syntax is:​
A. INSERT INTO table_name VALUES (1, 'A'), (2, 'B');​
B. INSERT table_name VALUES (1, 'A'), (2, 'B');​
C. INSERT INTO table_name (1, 'A') + (2, 'B');​
D. ADD INTO table_name VALUES (1, 'A'), (2, 'B');​
39. Which statement will insert records from one table into another?​
A. INSERT INTO table2 VALUES (SELECT * FROM table1);​
B. INSERT INTO table2 SELECT * FROM table1;​
C. SELECT INTO table2 FROM table1;​
D. COPY table1 TO table2;​
40. What is the result of a natural join?​
A. Cartesian product​
B. Combination of all tuples from two relations​
C. Join using all common attributes​
D. Difference between two relations​

You might also like