Sequel Set A
Sequel Set A
d) Alternate Key
3. Scenario: During a transaction, a power outage occurs. The database must ensure
no partial updates are saved.
Question: Which ACID property guarantees this behavior?
a) Atomicity
b) Consistency
c) Isolation
d) Durability
4. Scenario: A user wants to count how many orders were placed in March 2023 using
the orders table.
Question: Which query achieves this?
Sequel - Set A 1
AND '2023-03-31';
c) SELECT SUM(*) FROM orders FOR MONTH(order_date) = 3;
d) COUNT ALL orders IN March 2023;
5. Scenario: A team is building a social media app and needs a NoSQL database for
flexible, nested user profiles.
Question: Which NoSQL type is best suited?
a) Key-Value
b) Document
c) Graph
d) Column-family
d) It sorts data
8. Scenario: A company wants to store email addresses but prevent storing duplicate
values.
a) PRIMARY KEY
b) FOREIGN KEY
c) UNIQUE
d) NOT NULL
Sequel - Set A 2
9. Scenario: A query needs to return all users, even if they haven't placed orders.
Question: Which SQL JOIN type achieves this?
a) INNER JOIN
b) LEFT JOIN
c) RIGHT JOIN
d) CROSS JOIN
10. Scenario: The salary column has NULL values. A query calculates the total salary of
employees.
Question: How can you ensure NULL values don’t affect the sum?
Medium (6 Questions)
11. Scenario: A retail company’s orders table has order_id , customer_id , and order_total . They
want to find customers who spent over $1,000 in total.Question: Which query
should they use?
12. Scenario: A hospital database uses a patients table and a visits table linked by
. A report needs patient names and their visit dates.Question: Which JOIN is
patient_id
appropriate?
Sequel - Set A 3
13. Scenario: An e-commerce app experiences slow searches for products by name.
The team wants to optimize the products table.Question: Which indexing strategy is
best?
14. Scenario: A distributed database splits data across regions: US users on Node 1 and
EU users on Node 2.Question: What type of fragmentation is this?
a) Horizontal (row-based)
b) Vertical (column-based)
c) Hybrid
d) Round-robin
15. Scenario: A query uses GROUP BY category HAVING COUNT(*) > 10 .Question: What does the
HAVING clause do?
16. Scenario: A company uses PostgreSQL with millions of rows in a logs table. They
want to improve performance when retrieving logs for a specific date.Question:
What should they do?
Hard (4 Questions)
17. Scenario: A banking app processes two simultaneous transactions:
Sequel - Set A 4
T1: Transfers $100 from Account A to B.
a) Dirty Read
b) Lost Update
c) Phantom Read
d) Deadlock
18. Scenario: A global database uses eventual consistency. A user updates their profile
in Sydney, then immediately queries it in London and sees old data.Question: Which
CAP theorem trade-off does this reflect?
20. Scenario: A large dataset has millions of sales records. The company wants to
generate real-time reports while minimizing query load.
Sequel - Set A 5
c) Store precomputed aggregates in a separate table
d) Drop old records to reduce table size
Sequel - Set A 6