Easy Exam
Easy Exam
|-----------|-------------|------------|----------------|-----------------|-------|
a. Identify the normal form the given table is in. Explain your reasoning.
b. Normalize the table to the *Third Normal Form (3NF)*. Show all
intermediate steps.
*Question (2):*
Select the correct answer for each question. (0.5 marks each)
a) SELECT
b) UNIQUE
c) DISTINCT
d) DIFFERENT
c) REMOVE table_name;
d) DESTROY TABLE table_name;
d) To sort data
a) MODIFY TABLE
b) ADD COLUMN
c) ALTER TABLE
d) CHANGE TABLE
(Add five more questions in this style, covering joins, constraints, functions,
etc.)
*Question (3):*
*Answer:* SELECT
*Answer:* DISTINCT
*Answer:* JOIN
1. Create a table named "Employees" with columns ID, Name, Position, and
Salary.
---
1. *Student Table*:
3. *Enrollment Table*:
1. *Instructor Table*:
2. *Course Table*:
1. *Student Table*:
2. *Instructor Table*:
3. *Course Table*:
---
*Answer:* c) DISTINCT
*Additional Questions:*
6. *Which join returns only matching rows from both tables?*
*Answer:* b) GETDATE()
---
*Answer:* SELECT
3. *To remove duplicate entries from a query result, we use...*
*Answer:* DISTINCT
*Answer:* JOIN
*Answer:* AVG
*Answer:* COUNT
*Answer:* WHERE
*Answer:* LIMIT
*Answer:* UNION
---
#### *Part B: Write SQL Commands [5 Marks]*
sql
Name VARCHAR(255),
Position VARCHAR(255),
Salary DECIMAL(10, 2)
);
sql
sql
sql
sql
*Additional Scenarios:*
sql
sql
FROM Employees
GROUP BY Department;
sql
FROM Employees
GROUP BY Department;
9. *Find all employees whose name contains 'John':*
sql
sql