These are SQL questions of the kind Infosys actually asks — the patterns that keep coming back in Infosys's online tests and technical interview rounds for freshers. My advice: treat this page as a mock test. Attempt every question on paper first, then reveal. If any answer surprises you, the lesson it comes from is linked right below — go read it, then come back.
Infosys SQL concept questions
What does ALTER TABLE do? Give three examples of structural changes you can make with it.
Asked in


Infosys SQL query questions
The 'class_schedule_flat' table below has primary key (student_id, course_id). course_id determines dept_id, and dept_id determines dept_building — so dept_id and dept_building depend only on part of the key (course_id) and, transitively, on a non-key column, violating both 2NF and 3NF. Write CREATE TABLE statements that fully normalize this into 3NF.
Asked in


class_schedule_flat4 rows
| student_id | course_id | dept_id | dept_building |
|---|---|---|---|
| 1 | 101 | 10 | Block A |
| 1 | 102 | 20 | Block B |
| 2 | 101 | 10 | Block A |
| 3 | 102 | 20 | Block B |
The students table has a hostel_block column holding only 'A' or 'B'. A data-entry mistake swapped them for everyone. Write a single UPDATE that converts every 'A' to 'B' and every 'B' to 'A' at once.
Asked in
students4 rows
| student_id | name | hostel_block |
|---|---|---|
| 1 | Ravi | A |
| 2 | Priya | B |
| 3 | Aman | A |
| 4 | Neha | B |
How to use this page: Infosys rarely asks a question you've never seen — they ask standard patterns with a twist. Master the pattern in the SQL course lessons, and the twist stops mattering.
Keep practising: SQL Basics, Joins, GROUP BY & HAVING and Subqueries cover what most Infosys SQL rounds test — and the Infosys exam guide covers the rest of their selection process.

