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

Database Management Concepts Explained

The document provides a comprehensive overview of databases, including definitions of DBMS and RDBMS, key concepts like primary and foreign keys, normalization, ACID properties, and SQL joins. It also covers various SQL commands, differences between SQL and NoSQL databases, and practical examples of SQL queries. Additionally, it includes personal insights and motivations for pursuing a career in database management, particularly at RapidCompute.

Uploaded by

hanzalasiddiqe16
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 views31 pages

Database Management Concepts Explained

The document provides a comprehensive overview of databases, including definitions of DBMS and RDBMS, key concepts like primary and foreign keys, normalization, ACID properties, and SQL joins. It also covers various SQL commands, differences between SQL and NoSQL databases, and practical examples of SQL queries. Additionally, it includes personal insights and motivations for pursuing a career in database management, particularly at RapidCompute.

Uploaded by

hanzalasiddiqe16
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

TECHNICAL QUESTIONS & ANSWERS

What is a database?

A database is an organized collection of structured information or data stored electronically in a


computer system. It allows easy access, management, and updating of data.

What is DBMS and RDBMS?

• DBMS (Database Management System) manages data as files (e.g., MS Access).

• RDBMS (Relational Database Management System) stores data in tables with relations
(e.g., MySQL, PostgreSQL, Oracle).
RDBMS supports relationships, constraints, and ACID properties.

What are primary key and foreign key?

• Primary key: Uniquely identifies each record in a table.

• Foreign key: Establishes a relationship between two tables by referring to the primary
key of another table.

What is normalization?

Normalization is the process of organizing data to reduce redundancy and improve data
integrity.
Example: Dividing a big “Students” table into smaller related tables like Students, Courses, and
Enrollments.

What are ACID properties?

They ensure reliable database transactions:

• A – Atomicity (All or nothing)

• C – Consistency (Maintain rules)

• I – Isolation (Transactions don’t affect each other)


• D – Durability (Changes are permanent after commit)

What are SQL Joins?

Joins combine rows from two or more tables based on related columns.

• INNER JOIN: Returns matching records.

• LEFT JOIN: All records from left + matched ones from right.

• RIGHT JOIN: All records from right + matched from left.

• FULL JOIN: All records when there’s a match in either table.

What’s the difference between DELETE, DROP, and TRUNCATE?

Command Purpose Can Rollback Removes Table Structure

DELETE Deletes rows one by one Yes No

TRUNCATE Deletes all rows fast No No

DROP Deletes entire table No Yes

What’s the difference between SQL and NoSQL databases?

Feature SQL NoSQL

Structure Tables (rows/columns) Key-value, documents, graphs

Schema Fixed Flexible

Scalability Vertical Horizontal

Examples MySQL, PostgreSQL MongoDB, Cassandra

What is an index and why is it used?


An index speeds up query performance by creating a pointer to data in a table — similar to a
book index.
However, too many indexes can slow down writes (INSERT/UPDATE).

What is a stored procedure?

A stored procedure is a set of SQL statements stored in the database that can be reused.
Example:

CREATE PROCEDURE GetEmployees()

AS

SELECT * FROM Employees;

1 What is a view?

A view is a virtual table based on a query. It doesn’t store data itself but shows data dynamically
from one or more tables.

1 What is a transaction?

A transaction is a sequence of operations performed as a single logical unit. It ensures ACID


properties.

Example:

BEGIN TRANSACTION

UPDATE accounts SET balance = balance - 100 WHERE id = 1;

UPDATE accounts SET balance = balance + 100 WHERE id = 2;

COMMIT;

1 How do you optimize a slow SQL query?

• Check for missing indexes

• Avoid **SELECT *** (use only needed columns)


• Use WHERE filters properly

• Analyze execution plan

• Reduce joins if possible

• Use proper data types

1 What is a backup and restore?

• Backup: Copying database data to protect it from loss.

• Restore: Recovering data from the backup in case of failure.

Example: “I’d schedule regular backups and test recovery to ensure data safety.”

1 What is database replication?

Replication is the process of copying data from one database server to another to ensure
availability, reliability, and faster access.

1 What is database monitoring?

It involves tracking performance metrics like CPU usage, query execution time, connections, and
storage.
Tools like Prometheus, Grafana, or pgAdmin can be used.

1 What are IaaS, PaaS, SaaS?

Model Description Example

IaaS Infrastructure as a Service (servers, storage) AWS EC2

PaaS Platform as a Service (deploy apps, DBs) AWS RDS

SaaS Software as a Service (ready-to-use apps) Gmail

1 What is a managed database service?


A managed database is hosted and maintained by a cloud provider. They handle backups,
patching, scaling, and monitoring — so engineers can focus on using the database, not
managing it.

Examples: AWS RDS, Azure SQL, Google Cloud SQL.

1 What scripting or automation can be used in database management?

You can automate tasks like backups, monitoring, or user creation using:

• Bash / PowerShell scripts

• Python scripts

• Cron jobs (Linux scheduler)

2 What is RapidCompute known for?

RapidCompute is Pakistan’s first enterprise-grade cloud platform, offering:

• Secure cloud infrastructure & managed services

• Compliance with ISO 27001 and PCI DSS

• Services like IaaS, PaaS, Backup, Disaster Recovery, and Managed Databases

HR & SCENARIO QUESTIONS

Tell me about yourself.

My name is Hanzala Siddique, and I recently completed my Bachelor's in Computer Science. I’ve
built a strong interest in databases, cloud systems, and IT infrastructure.
I’ve practiced SQL, MySQL, and PostgreSQL locally and learned about performance and backup
basics.
I’m eager to start my career at RapidCompute because it’s a great place to learn enterprise-level
database management in a professional cloud environment.

Why do you want to join RapidCompute?


Because RapidCompute is Pakistan’s top cloud provider known for its secure and innovative
infrastructure services.
The Managed Database internship aligns perfectly with my passion for databases and cloud
platforms.
I want to learn from experienced professionals and grow my career in database and cloud
operations.

What are your career goals?

My goal is to become a Cloud Database Engineer.


In the short term, I want to strengthen my skills in database deployment, monitoring, and
automation.
In the long term, I aim to earn cloud certifications and work on large-scale, secure database
systems.

How do you handle a problem you don’t know?

I first try to research using documentation or official resources.


Then I test small solutions to understand the root cause.
If it’s still unclear, I consult teammates or seniors to learn the right approach.
I believe every issue is a chance to improve my understanding.

What are your strengths?

I’m patient while troubleshooting, eager to learn new technologies, and have good analytical
and communication skills.
I also enjoy documenting what I learn for future reference.

What was your final year project?

(If asked — adapt to your project)

My project involved working with data and backend systems, which improved my understanding
of SQL, databases, and system logic. It helped me connect theory with real-world data
applications.
Why database and not software development?

I enjoy understanding how data flows behind the scenes and how it’s stored, optimized, and
secured.
I find database management interesting because it’s the backbone of every system — stable
databases make applications reliable.

What do you know about RapidCompute’s services?

RapidCompute provides cloud infrastructure, managed services, disaster recovery, and security
compliance solutions.
They help organizations move their workloads to the cloud and manage systems efficiently with
security and reliability.

Describe a time you solved a difficult problem.

During my coursework, I faced a SQL query issue where the data wasn’t grouping properly. I
analyzed the schema, used aggregate functions, and fixed the JOIN logic — which taught me
how small syntax mistakes affect query results.

Do you have any questions for us?

Always ask 1–2 questions. Example:

“What kind of databases will interns work with here?”


“Will I get exposure to cloud database tools like AWS RDS or PostgreSQL in production
environments?”
“Does RapidCompute support interns in earning certifications?”

Step 1 — Create Database and Tables

-- Create the database

CREATE DATABASE CompanyDB;

USE CompanyDB;
-- Employees table

CREATE TABLE Employees (

EmpID INT PRIMARY KEY AUTO_INCREMENT,

EmpName VARCHAR(100),

DepartmentID INT,

Salary DECIMAL(10,2),

JoiningDate DATE

);

-- Departments table

CREATE TABLE Departments (

DepartmentID INT PRIMARY KEY AUTO_INCREMENT,

DepartmentName VARCHAR(100)

);

-- Customers table

CREATE TABLE Customers (

CustomerID INT PRIMARY KEY AUTO_INCREMENT,

CustomerName VARCHAR(100),

Region VARCHAR(50)

);

-- Products table

CREATE TABLE Products (

ProductID INT PRIMARY KEY AUTO_INCREMENT,

ProductName VARCHAR(100),
Price DECIMAL(10,2)

);

-- Orders table

CREATE TABLE Orders (

OrderID INT PRIMARY KEY AUTO_INCREMENT,

CustomerID INT,

ProductID INT,

OrderDate DATE,

Quantity INT,

Returned BOOLEAN DEFAULT FALSE,

FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID),

FOREIGN KEY (ProductID) REFERENCES Products(ProductID)

);

Step 2 — Insert Sample Data

-- Departments

INSERT INTO Departments (DepartmentName) VALUES

('IT'), ('HR'), ('Finance'), ('Marketing');

-- Employees

INSERT INTO Employees (EmpName, DepartmentID, Salary, JoiningDate) VALUES

('Ali Khan', 1, 8000, '2023-05-10'),

('Sara Ahmed', 2, 6000, '2022-08-12'),

('Bilal Hussain', 3, 9000, '2023-01-15'),

('Zain Malik', 1, 9500, '2023-02-10'),


('Ayesha Noor', 4, 5500, '2024-03-25'),

('Ali Khan', 1, 8000, '2023-05-10'); -- duplicate

-- Customers

INSERT INTO Customers (CustomerName, Region) VALUES

('Hamza', 'North'),

('Fatima', 'South'),

('Ahmed', 'East'),

('Sara', 'West'),

('Daniyal', 'North');

-- Products

INSERT INTO Products (ProductName, Price) VALUES

('Laptop', 1200),

('Phone', 800),

('Tablet', 400),

('Headphones', 150),

('Charger', 50);

-- Orders

INSERT INTO Orders (CustomerID, ProductID, OrderDate, Quantity, Returned) VALUES

(1, 1, '2025-01-01', 1, FALSE),

(1, 2, '2025-01-03', 2, FALSE),

(2, 3, '2025-02-10', 3, TRUE),

(3, 4, '2025-02-15', 1, FALSE),

(3, 1, '2025-03-20', 2, FALSE),


(4, 2, '2025-03-25', 1, FALSE),

(5, 5, '2025-04-02', 5, FALSE);

Step 3 — Perform and Explain Queries

Find Duplicate Records in Employees

SELECT EmpName, Salary, COUNT(*) AS DuplicateCount

FROM Employees

GROUP BY EmpName, Salary

HAVING COUNT(*) > 1;

Groups employees by name and salary, showing records that appear more than once.

Retrieve the Second Highest Salary

SELECT MAX(Salary) AS SecondHighest

FROM Employees

WHERE Salary < (SELECT MAX(Salary) FROM Employees);

Finds the salary just below the highest one.

Find Employees without Department

SELECT * FROM Employees

WHERE DepartmentID IS NULL;

Lists employees missing department info.

Calculate Total Revenue Per Product

SELECT [Link], SUM([Link] * [Link]) AS TotalRevenue


FROM Orders o

JOIN Products p ON [Link] = [Link]

GROUP BY [Link];

Multiplies price × quantity for each product.

Top 3 Highest Paid Employees

SELECT EmpName, Salary

FROM Employees

ORDER BY Salary DESC

LIMIT 3;

Returns top 3 employees by salary.

Customers Who Purchased but Never Returned

SELECT DISTINCT [Link]

FROM Customers c

JOIN Orders o ON [Link] = [Link]

WHERE [Link] = FALSE;

Customers with no returns.

Count of Orders per Customer

SELECT [Link], COUNT([Link]) AS OrderCount

FROM Customers c

LEFT JOIN Orders o ON [Link] = [Link]

GROUP BY [Link];

Counts how many orders each customer made.


Employees Who Joined in 2023

SELECT * FROM Employees

WHERE YEAR(JoiningDate) = 2023;

Filters employees based on year.

Average Order Value per Customer

SELECT [Link],

AVG([Link] * [Link]) AS AvgOrderValue

FROM Orders o

JOIN Products p ON [Link] = [Link]

JOIN Customers c ON [Link] = [Link]

GROUP BY [Link];

Calculates mean order amount.

Latest Order per Customer

SELECT [Link], MAX([Link]) AS LatestOrder

FROM Customers c

JOIN Orders o ON [Link] = [Link]

GROUP BY [Link];

Finds most recent purchase per customer.

1 Products Never Sold

SELECT ProductName

FROM Products
WHERE ProductID NOT IN (SELECT DISTINCT ProductID FROM Orders);

Detects unsold products.

1 Most Selling Product

SELECT [Link], SUM([Link]) AS TotalSold

FROM Orders o

JOIN Products p ON [Link] = [Link]

GROUP BY [Link]

ORDER BY TotalSold DESC

LIMIT 1;

Product with max total quantity sold.

1 Total Revenue and Orders per Region

SELECT [Link],

SUM([Link] * [Link]) AS TotalRevenue,

COUNT([Link]) AS OrderCount

FROM Orders o

JOIN Customers c ON [Link] = [Link]

JOIN Products p ON [Link] = [Link]

GROUP BY [Link];

Shows financial performance by region.

1 Customers with More Than 5 Orders

SELECT [Link], COUNT([Link]) AS TotalOrders

FROM Customers c
JOIN Orders o ON [Link] = [Link]

GROUP BY [Link]

HAVING COUNT([Link]) > 5;

Identifies highly active customers.

1 Customers with Orders Above Average Order Value

SELECT [Link], SUM([Link] * [Link]) AS CustomerTotal

FROM Customers c

JOIN Orders o ON [Link] = [Link]

JOIN Products p ON [Link] = [Link]

GROUP BY [Link]

HAVING CustomerTotal > (SELECT AVG([Link] * [Link]) FROM Orders o JOIN Products p ON
[Link] = [Link]);

Finds big spenders.

1 Employees Hired on Weekends

SELECT * FROM Employees

WHERE DAYOFWEEK(JoiningDate) IN (1,7);

1=Sunday, 7=Saturday.

1 Employees with Salary Between 5000–10000

SELECT * FROM Employees

WHERE Salary BETWEEN 5000 AND 10000;

1 Monthly Sales Revenue & Order Count

SELECT DATE_FORMAT(OrderDate, '%Y-%m') AS Month,


SUM([Link] * [Link]) AS Revenue,

COUNT([Link]) AS Orders

FROM Orders o

JOIN Products p ON [Link] = [Link]

GROUP BY Month;

1 Rank Employees by Salary Within Each Department

SELECT EmpName, DepartmentID, Salary,

RANK() OVER (PARTITION BY DepartmentID ORDER BY Salary DESC) AS SalaryRank

FROM Employees;

2 Customers Who Ordered Every Month in 2025

SELECT CustomerID

FROM Orders

WHERE YEAR(OrderDate) = 2025

GROUP BY CustomerID

HAVING COUNT(DISTINCT MONTH(OrderDate)) = 12;

2 Moving Average of Sales (Last 3 Days)

SELECT OrderDate,

AVG(SUM([Link] * [Link])) OVER (ORDER BY OrderDate ROWS 2 PRECEDING) AS


MovingAvg

FROM Orders o

JOIN Products p ON [Link] = [Link]

GROUP BY OrderDate;
2 First & Last Order Date per Customer

SELECT CustomerID,

MIN(OrderDate) AS FirstOrder,

MAX(OrderDate) AS LastOrder

FROM Orders

GROUP BY CustomerID;

2 Product Sales Distribution (% of Total)

SELECT [Link],

(SUM([Link] * [Link]) / (SELECT SUM([Link] * [Link]) FROM Orders o JOIN


Products p ON [Link]=[Link])) * 100 AS Percentage

FROM Orders o

JOIN Products p ON [Link] = [Link]

GROUP BY [Link];

2 Customers with Consecutive Purchases (2 days)

SELECT DISTINCT [Link]

FROM Orders o1

JOIN Orders o2 ON [Link] = [Link]

AND DATEDIFF([Link], [Link]) = 1;

2 Churned Customers (No Orders in Last 6 Months)

SELECT [Link]

FROM Customers c

LEFT JOIN Orders o ON [Link] = [Link]

GROUP BY [Link]
HAVING MAX([Link]) < DATE_SUB(CURDATE(), INTERVAL 6 MONTH);

2 Cumulative Revenue by Day

SELECT OrderDate,

SUM(SUM([Link] * [Link])) OVER (ORDER BY OrderDate) AS CumulativeRevenue

FROM Orders o

JOIN Products p ON [Link] = [Link]

GROUP BY OrderDate;

2 Top Performing Departments by Average Salary

SELECT [Link], AVG([Link]) AS AvgSalary

FROM Employees e

JOIN Departments d ON [Link] = [Link]

GROUP BY [Link]

ORDER BY AvgSalary DESC;

2 Customers Who Ordered More Than Avg Orders

SELECT [Link], COUNT([Link]) AS TotalOrders

FROM Customers c

JOIN Orders o ON [Link] = [Link]

GROUP BY [Link]

HAVING COUNT([Link]) > (SELECT AVG(OrderCount)

FROM (SELECT COUNT(OrderID) AS OrderCount FROM Orders GROUP BY


CustomerID) AS temp);

2 Revenue from New Customers (First Order Only)


SELECT [Link], ([Link] * [Link]) AS FirstOrderRevenue

FROM Orders o

JOIN Products p ON [Link] = [Link]

JOIN Customers c ON [Link] = [Link]

WHERE [Link] = (

SELECT MIN([Link]) FROM Orders o2 WHERE [Link] = [Link]

);

3 % of Employees in Each Department

SELECT [Link],

(COUNT([Link]) / (SELECT COUNT(*) FROM Employees)) * 100 AS Percentage

FROM Employees e

JOIN Departments d ON [Link] = [Link]

GROUP BY [Link];

3 Max Salary Difference per Department

SELECT [Link],

MAX([Link]) - MIN([Link]) AS SalaryDiff

FROM Employees e

JOIN Departments d ON [Link] = [Link]

GROUP BY [Link];

3 Products That Contribute to 80% of Revenue (Pareto)

SELECT ProductName, Revenue,

(SELECT SUM(Revenue) FROM (

SELECT SUM([Link] * [Link]) AS Revenue


FROM Orders o JOIN Products p ON [Link] = [Link]

) AS total) AS TotalRevenue

FROM (

SELECT [Link], SUM([Link] * [Link]) AS Revenue

FROM Orders o JOIN Products p ON [Link] = [Link]

GROUP BY [Link]

ORDER BY Revenue DESC

) ranked

WHERE (SELECT SUM(Revenue) FROM (

SELECT SUM([Link] * [Link]) AS Revenue

FROM Orders o JOIN Products p ON [Link] = [Link]

) AS sub) * 0.8 >= Revenue;

Complex: finds 20% products generating 80% revenue.

3 Last Purchase per Customer with Amount

SELECT [Link], [Link], ([Link] * [Link]) AS Amount

FROM Orders o

JOIN Products p ON [Link] = [Link]

JOIN Customers c ON [Link] = [Link]

WHERE [Link] = (SELECT MAX([Link]) FROM Orders o2 WHERE [Link] =


[Link]);

3 Average Time Between Purchases

SELECT CustomerID,

AVG(DATEDIFF(LEAD(OrderDate) OVER (PARTITION BY CustomerID ORDER BY OrderDate),


OrderDate)) AS AvgGapDays
FROM Orders

GROUP BY CustomerID;

3 Year-over-Year Growth in Revenue

SELECT YEAR(OrderDate) AS Year,

SUM([Link] * [Link]) AS Revenue,

(SUM([Link] * [Link]) - LAG(SUM([Link] * [Link])) OVER (ORDER BY


YEAR(OrderDate))) / LAG(SUM([Link] * [Link])) OVER (ORDER BY YEAR(OrderDate)) * 100
AS YoYGrowth

FROM Orders o

JOIN Products p ON [Link] = [Link]

GROUP BY YEAR(OrderDate);

3 Customers Whose Order > Historical 90th Percentile

SELECT [Link], [Link]

FROM Orders o

JOIN (

SELECT CustomerID, PERCENTILE_CONT(0.9) WITHIN GROUP (ORDER BY [Link] * [Link])


AS p90

FROM Orders o JOIN Products p ON [Link] = [Link]

GROUP BY CustomerID

) sub ON [Link] = [Link]

JOIN Products p ON [Link] = [Link]

WHERE ([Link] * [Link]) > sub.p90;

3 Longest Gap Between Orders per Customer

SELECT CustomerID,
MAX(DATEDIFF(LEAD(OrderDate) OVER (PARTITION BY CustomerID ORDER BY OrderDate),
OrderDate)) AS MaxGap

FROM Orders

GROUP BY CustomerID;

3 Customers with Revenue Below 10th Percentile

SELECT [Link]

FROM Customers c

JOIN (

SELECT CustomerID, SUM([Link] * [Link]) AS Revenue

FROM Orders o JOIN Products p ON [Link] = [Link]

GROUP BY CustomerID

) r ON [Link] = [Link]

WHERE [Link] < (

SELECT PERCENTILE_CONT(0.1) WITHIN GROUP (ORDER BY Revenue)

FROM (

SELECT SUM([Link] * [Link]) AS Revenue

FROM Orders o JOIN Products p ON [Link] = [Link]

GROUP BY CustomerID

) AS sub

);

That’s a complete professional MySQL practice script (38 use-cases)

Would you like me to convert this entire MySQL tutorial into a formatted PDF with syntax +
explanation for each query (ideal for quick interview revision)?

You said:
give me some more thoery questions with answers

ChatGPT said:

Sure! Here are 20 important MySQL theory questions and answers — these cover both
beginner and intermediate concepts, useful for interviews or exams

1. What is MySQL?

Answer:
MySQL is an open-source Relational Database Management System (RDBMS) that uses
Structured Query Language (SQL) to store, retrieve, and manage data efficiently.

2. What is the difference between SQL and MySQL?

Answer:

• SQL is a language for managing relational databases.

• MySQL is a software (RDBMS) that uses SQL to manage databases.

3. What are the different types of SQL commands?

Answer:

1. DDL (Data Definition Language): CREATE, ALTER, DROP

2. DML (Data Manipulation Language): SELECT, INSERT, UPDATE, DELETE

3. DCL (Data Control Language): GRANT, REVOKE

4. TCL (Transaction Control Language): COMMIT, ROLLBACK, SAVEPOINT

4. What is a Primary Key?

Answer:
A Primary Key uniquely identifies each record in a table. It cannot contain NULL values and must
be unique.
5. What is a Foreign Key?

Answer:
A Foreign Key links two tables together. It is a field in one table that refers to the Primary Key in
another table.

6. What is the difference between CHAR and VARCHAR?

Answer:

• CHAR(n): Fixed length. Always stores exactly n characters.

• VARCHAR(n): Variable length. Stores only the number of characters entered.

7. What is a JOIN in MySQL?

Answer:
A JOIN is used to combine data from two or more tables based on a related column.
Types include INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN.

8. What is the difference between INNER JOIN and LEFT JOIN?

Answer:

• INNER JOIN: Returns records that have matching values in both tables.

• LEFT JOIN: Returns all records from the left table and matched records from the right
table.

9. What is a VIEW in MySQL?

Answer:
A VIEW is a virtual table based on the result of a SELECT query. It doesn’t store data but displays
it from underlying tables.

10. What is normalization?


Answer:
Normalization is the process of organizing data to reduce redundancy and improve data
integrity.
Common normal forms: 1NF, 2NF, 3NF, BCNF.

11. What is a stored procedure?

Answer:
A stored procedure is a set of SQL statements stored in the database that can be executed as a
single unit.

12. What is indexing in MySQL?

Answer:
An index is used to speed up data retrieval operations on a database table. However, it slows
down data insertion and updates.

13. What is the difference between DELETE, TRUNCATE, and DROP?

Answer:

• DELETE: Removes specific rows; can use WHERE clause; can be rolled back.

• TRUNCATE: Removes all rows; cannot use WHERE; faster; can’t be rolled back.

• DROP: Deletes the entire table structure and data.

14. What is a transaction?

Answer:
A transaction is a sequence of SQL statements that are executed as a single unit of work. It
ensures ACID properties: Atomicity, Consistency, Isolation, Durability.

15. What is the difference between HAVING and WHERE?

Answer:

• WHERE: Filters rows before aggregation.


• HAVING: Filters aggregated data (after GROUP BY).

16. What is the use of GROUP BY in MySQL?

Answer:
GROUP BY groups rows with the same values in specified columns, often used with aggregate
functions like COUNT(), SUM(), AVG().

17. What is the difference between UNION and UNION ALL?

Answer:

• UNION: Combines results from two queries and removes duplicates.

• UNION ALL: Combines results but keeps duplicates.

18. What is a subquery?

Answer:
A subquery is a query inside another query. It can be used in SELECT, INSERT, UPDATE, or DELETE
statements.

19. What is AUTO_INCREMENT in MySQL?

Answer:
AUTO_INCREMENT automatically generates a unique number for a column whenever a new
record is inserted.

20. What are MySQL constraints?

Answer:
Constraints are rules enforced on data columns to maintain accuracy and integrity.
Examples: PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL, CHECK, DEFAULT.

Cloud Computing Theory Questions and Answers


1. What is Cloud Computing?

Answer:
Cloud computing is the delivery of computing services (servers, storage, databases, networking,
software, etc.) over the internet (“the cloud”) to offer faster innovation, flexible resources, and
scalability.

2. What are the three main types of cloud computing services?

Answer:

1. IaaS (Infrastructure as a Service): Provides virtualized computing resources (e.g., AWS


EC2, RapidCompute VM).

2. PaaS (Platform as a Service): Provides platform and tools for developers (e.g., Google
App Engine, Azure App Service).

3. SaaS (Software as a Service): Provides software over the internet (e.g., Gmail,
Salesforce).

3. What are the deployment models in cloud computing?

Answer:

1. Public Cloud: Shared infrastructure for multiple organizations (e.g., AWS, Azure).

2. Private Cloud: Dedicated infrastructure for one organization (e.g., RapidCompute Cloud).

3. Hybrid Cloud: Combination of public and private clouds.

4. Community Cloud: Shared by organizations with common concerns.

4. What are the main benefits of using cloud platforms?

Answer:

• Scalability

• Cost efficiency (pay-as-you-go)

• High availability
• Automatic updates

• Disaster recovery

• Global access

5. What is the difference between scalability and elasticity in cloud?

Answer:

• Scalability: Ability to handle increased workload by adding resources.

• Elasticity: Automatically adds or removes resources based on real-time demand.

6. What is a Virtual Machine (VM)?

Answer:
A Virtual Machine is a software-based emulation of a physical computer that runs in a cloud
environment.

7. What is a Cloud Database?

Answer:
A Cloud Database is a database that runs on a cloud platform and is accessed via the internet.
Examples:

• AWS RDS (Relational Database Service)

• Azure SQL Database

• Google Cloud SQL

• RapidCompute Managed Database Service

8. What is the difference between traditional databases and cloud databases?

Answer:

Feature Traditional Cloud Database

Deployment On-premises On cloud


Cost Hardware + maintenance Pay-as-you-go

Scaling Manual Automatic

Backup Manual Automated

Access Local Global

9. What is High Availability (HA) in cloud databases?

Answer:
High Availability means a system remains operational with minimal downtime. Cloud providers
achieve this through replication, load balancing, and failover mechanisms.

10. What is Data Replication in cloud?

Answer:
Replication means maintaining copies of data in multiple servers or regions to ensure reliability,
fault tolerance, and disaster recovery.

11. What is a Managed Database Service?

Answer:
A Managed Database Service is a cloud-based database offering where the provider handles
installation, patching, backups, and scaling — allowing users to focus on data and applications.
Examples: AWS RDS, Azure Database, RapidCompute Managed Database.

12. What is Load Balancing in the cloud?

Answer:
Load Balancing distributes incoming network traffic across multiple servers to ensure no single
server becomes overwhelmed.

13. What is the purpose of Auto Scaling?


Answer:
Auto Scaling automatically adjusts the number of computing resources based on traffic or usage
patterns to maintain performance and cost-efficiency.

14. What are Security Groups in the cloud?

Answer:
Security Groups act as virtual firewalls controlling inbound and outbound traffic to cloud
resources.

15. What is Cloud Storage?

Answer:
Cloud storage allows data to be stored, managed, and accessed remotely via the internet (e.g.,
Amazon S3, Google Cloud Storage, RapidCompute Object Storage).

16. What is a Cloud Region and Availability Zone?

Answer:

• Region: A specific geographic location where cloud data centers exist (e.g., “Asia South
1”).

• Availability Zone: Independent data centers within a region that ensure redundancy.

17. What is Serverless Computing?

Answer:
Serverless computing allows you to run applications without managing servers. The cloud
provider automatically handles infrastructure and scaling (e.g., AWS Lambda, Azure Functions).

18. What is a Cloud Service Level Agreement (SLA)?

Answer:
An SLA is a contract that defines the guaranteed uptime and performance levels (e.g., 99.99%
availability).
19. What is Multi-tenancy in the cloud?

Answer:
Multi-tenancy allows multiple users (tenants) to share the same computing resources while
keeping their data isolated.

20. What are some security best practices in cloud computing?

Answer:

• Use encryption for data at rest and in transit.

• Enable Multi-Factor Authentication (MFA).

• Regularly update and patch systems.

• Use IAM (Identity and Access Management).

• Monitor logs and activity with cloud tools.

You might also like