You have a project that requires storing customer information with fixed fields like name, email, and phone number. Which type of database is best suited for this?
Think about which database type enforces a fixed structure for data.
SQL databases are designed to handle structured data with fixed schemas, making them ideal for customer information with defined fields.
Your application needs to store user-generated content that can vary in format and fields, such as comments, images, and tags. Which database type fits best?
Consider which database type allows storing data without a fixed schema.
NoSQL databases are designed to store flexible and varying data formats, making them suitable for user-generated content with different fields.
Given a SQL table Orders with columns OrderID, CustomerID, and Amount, what is the result of this query?
SELECT CustomerID, SUM(Amount) AS Total FROM Orders GROUP BY CustomerID;
SELECT CustomerID, SUM(Amount) AS Total FROM Orders GROUP BY CustomerID;
GROUP BY groups rows by customer and SUM adds amounts per group.
The query groups orders by customer and sums the amounts, returning total spent per customer.
Your app expects millions of users and needs to scale horizontally across many servers. Which database type is generally easier to scale horizontally?
Think about which database type is designed for easy distribution across servers.
NoSQL databases are generally designed for horizontal scaling, allowing data to be spread across many servers easily.
You need to build a banking system that requires complex transactions with strict consistency and rollback capabilities. Which database type is most suitable?
Consider which database type guarantees transaction safety and consistency.
SQL databases support ACID properties, which are essential for complex transactions requiring consistency and rollback.