🔑 KEYS TO SUCCESS
⚡ SQL SHOWDOWN
🧮 FUNCTION FRENZY
🤝 JOIN FORCES
👑 BOSS BATTLE
100

This uniquely identifies each record in a table.

What is a Primary Key?

100

Which SQL statement retrieves data from a database?

What is SELECT?

100

Which function counts the number of rows?

What is COUNT()?

100

Which JOIN returns only the matching records from both tables?

What is INNER JOIN?

100

Write an SQL query to display all customer names.

SELECT CustomerName FROM customer_list;

200

This key creates a relationship between two tables.

What is a Foreign Key?

200

Which clause filters rows based on a condition?

What is WHERE?

200

Which function returns the highest value?

What is MAX()?

200

You have two tables: Students (StudentID, Name) and  Enrollments (EnrollmentID, StudentID, Course).  Which column should be used to join these tables?

What is StudentID?

200

Write an SQL query to display the Customer Name and Account Type of every customer.

SELECT c.CustomerName, a.AccountType FROM customer_list c INNER JOIN accounts a ON c.CustomerID = a.CustomerID;

300

Name the four basic components of a relational database table.

What are tables, records, fields, and keys?

300

Which SQL command adds a new row to a table?

What is INSERT INTO?

300

Which clause is used with aggregate functions to organize rows into groups?

What is GROUP BY?

300

A teacher wants to display all students, including those who have not enrolled in any course. Which JOIN should be used?

What is LEFT JOIN?

300

Write an SQL query to display Customer Name, Branch Name, Account Type

SELECT c.CustomerName, b.BranchName, a.AccountType 

FROM customer_list c INNER JOIN accounts a 

ON c.CustomerID = a.CustomerID 

INNER JOIN branches b 

ON a.BranchID = b.BranchID;

400

This database rule ensures that every foreign key value must exist in the referenced primary key

What is Referential Integrity?

400

Which SQL statement modifies the structure of an existing table?

What is ALTER TABLE?

400

Which clause filters grouped results after GROUP BY?

What is HAVING?

400

What is missing in this query?

SELECT s.Name, c.CourseName
FROM Students s
INNER JOIN Courses c

What os ON clause?

400

Display each branch and the number of accounts opened in that branch.

SELECT b.BranchName, COUNT(a.AccountID) AS TotalAccounts 

FROM branches b 

INNER JOIN accounts a 

ON b.BranchID = a.BranchID 

GROUP BY b.BranchName;

500

A STUDENTS table has StudentID as its primary key. An ENROLLMENT table contains StudentID. What type of key is StudentID in the ENROLLMENT table?

What is a Foreign Key?

500

Identify the error.

SELECT name age FROM students;

What is the missing comma between name and age?

500

Which category of functions includes String, Date, and Numeric functions?

What are Scalar Functions?

500

A LEFT JOIN returns 100 students, but only 80 have enrolled in a subject. How many students will have NULL values in the course columns?

What 20 students?

500

Display each customer, the number of transactions they made, and the total transaction amount.

SELECT c.CustomerName, COUNT(t.TransactionID) AS TotalTransactions,       SUM(t.Amount) AS TotalAmount 

FROM customer_list c 

INNER JOIN accounts a ON c.CustomerID = a.CustomerID 

INNER JOIN transactions t ON a.AccountID = t.AccountID 

GROUP BY c.CustomerName;

M
e
n
u