Skills101
← SQL & DBMS — Beginner

SQL & DBMS Beginner — Test 1

15 questions15 minPass: 60%+20 XP on first passFree sample test

15 questions · 15 minutes · beginner level, with an explanation for every answer.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    What is the output of this SQL query?

    -- employees(id, name, dept, salary, manager_id)
    -- 1 Asha  IT    70000 NULL | 2 Ravi  IT 50000 1 | 3 Neha  HR    45000 NULL
    -- 4 Karan Sales 40000 3    | 5 Meera Sales 55000 3 | 6 Imran IT 50000 1
    -- departments(dept, city): IT Jaipur | HR Pune | Sales Delhi | Admin Noida
    SELECT COUNT(manager_id), COUNT(*) FROM employees;
    
  2. Question 2

    What is the output of this SQL query?

    -- employees(id, name, dept, salary, manager_id)
    -- 1 Asha  IT    70000 NULL | 2 Ravi  IT 50000 1 | 3 Neha  HR    45000 NULL
    -- 4 Karan Sales 40000 3    | 5 Meera Sales 55000 3 | 6 Imran IT 50000 1
    -- departments(dept, city): IT Jaipur | HR Pune | Sales Delhi | Admin Noida
    SELECT name, salary FROM employees ORDER BY salary DESC, name ASC LIMIT 2 OFFSET 2;
    
  3. Question 3

    What is a foreign key?

  4. Question 4

    What does a PRIMARY KEY guarantee?

  5. Question 5

    What is the output of this SQL query?

    -- employees(id, name, dept, salary, manager_id)
    -- 1 Asha  IT    70000 NULL | 2 Ravi  IT 50000 1 | 3 Neha  HR    45000 NULL
    -- 4 Karan Sales 40000 3    | 5 Meera Sales 55000 3 | 6 Imran IT 50000 1
    -- departments(dept, city): IT Jaipur | HR Pune | Sales Delhi | Admin Noida
    SELECT name FROM employees WHERE salary BETWEEN 45000 AND 50000 ORDER BY id;
    
  6. Question 6

    What is the output of this SQL query?

    -- employees(id, name, dept, salary, manager_id)
    -- 1 Asha  IT    70000 NULL | 2 Ravi  IT 50000 1 | 3 Neha  HR    45000 NULL
    -- 4 Karan Sales 40000 3    | 5 Meera Sales 55000 3 | 6 Imran IT 50000 1
    -- departments(dept, city): IT Jaipur | HR Pune | Sales Delhi | Admin Noida
    SELECT MAX(salary), MIN(salary) FROM employees;
    
  7. Question 7

    What is the output of this SQL query?

    -- employees(id, name, dept, salary, manager_id)
    -- 1 Asha  IT    70000 NULL | 2 Ravi  IT 50000 1 | 3 Neha  HR    45000 NULL
    -- 4 Karan Sales 40000 3    | 5 Meera Sales 55000 3 | 6 Imran IT 50000 1
    -- departments(dept, city): IT Jaipur | HR Pune | Sales Delhi | Admin Noida
    SELECT DISTINCT dept FROM employees ORDER BY dept;
    
  8. Question 8

    What is the output of this SQL query?

    -- employees(id, name, dept, salary, manager_id)
    -- 1 Asha  IT    70000 NULL | 2 Ravi  IT 50000 1 | 3 Neha  HR    45000 NULL
    -- 4 Karan Sales 40000 3    | 5 Meera Sales 55000 3 | 6 Imran IT 50000 1
    -- departments(dept, city): IT Jaipur | HR Pune | Sales Delhi | Admin Noida
    SELECT name FROM employees WHERE salary > 50000 ORDER BY salary DESC;
    
  9. Question 9

    Which SQL command removes ALL rows but keeps the table structure, and usually cannot be rolled back in MySQL?

  10. Question 10

    What is the output of this SQL query?

    -- employees(id, name, dept, salary, manager_id)
    -- 1 Asha  IT    70000 NULL | 2 Ravi  IT 50000 1 | 3 Neha  HR    45000 NULL
    -- 4 Karan Sales 40000 3    | 5 Meera Sales 55000 3 | 6 Imran IT 50000 1
    -- departments(dept, city): IT Jaipur | HR Pune | Sales Delhi | Admin Noida
    SELECT name FROM employees WHERE name LIKE '%a' ORDER BY name;
    
  11. Question 11

    What is a DBMS?

  12. Question 12

    Which clause filters rows BEFORE grouping?

  13. Question 13

    What is the output of this SQL query?

    -- employees(id, name, dept, salary, manager_id)
    -- 1 Asha  IT    70000 NULL | 2 Ravi  IT 50000 1 | 3 Neha  HR    45000 NULL
    -- 4 Karan Sales 40000 3    | 5 Meera Sales 55000 3 | 6 Imran IT 50000 1
    -- departments(dept, city): IT Jaipur | HR Pune | Sales Delhi | Admin Noida
    SELECT COUNT(*) FROM employees WHERE dept = 'IT';
    
  14. Question 14

    What is the output of this SQL query?

    -- employees(id, name, dept, salary, manager_id)
    -- 1 Asha  IT    70000 NULL | 2 Ravi  IT 50000 1 | 3 Neha  HR    45000 NULL
    -- 4 Karan Sales 40000 3    | 5 Meera Sales 55000 3 | 6 Imran IT 50000 1
    -- departments(dept, city): IT Jaipur | HR Pune | Sales Delhi | Admin Noida
    SELECT name FROM employees WHERE manager_id IS NULL ORDER BY name;
    
  15. Question 15

    Which category does CREATE TABLE belong to?

🎯 Today’s placement challenge — 10 questions, no login. Can you score 10/10?Take today’s challenge →