Sunday, May 7, 2023

SQL Learning - Part 4 - Checking your progress

 So after getting all the essentials ready for practice, only thing remaining was testing. How to check my progress against my assigned goals. So I asked my trusty Jarvis for a test on all the week's concepts. He (or he a she?!!) came up with this:

Week 1: SQL Basics and Database Design

1. What is SQL? Explain its purpose and usage.

2. Define the terms "database," "table," and "record" in the context of SQL.

3. Describe the difference between a primary key and a foreign key.

4. Write a SQL query to retrieve all records from a table named "Customers."

5. Explain the concept of normalization in database design.


Week 2: DML and DDL

1. Differentiate between DML and DDL. Provide examples of each.

2. Write a SQL statement to insert a new record into a table.

3. Explain the purpose of the SELECT statement in SQL and provide an example query.

4. Define and demonstrate the usage of the following SQL keywords: UPDATE, DELETE, ALTER, and CREATE.

5. Describe the role of constraints in database tables and provide examples of different types of constraints.


Week 3: Joins and Aggregation

1. What are table joins? Explain different types of table joins with examples.

2. Write a SQL query to retrieve data from two tables using an inner join.

3. Explain the difference between GROUP BY and HAVING clauses in SQL.

4. Write a SQL query to calculate the average, maximum, and minimum values of a numeric column.

5. Describe the purpose and usage of the COUNT, SUM, and AVG functions in SQL.


Week 4: Subqueries

1. Define a subquery and explain its purpose in SQL.

2. Write a SQL query that uses a subquery to retrieve data from a related table.

3. Explain the difference between a correlated and a non-correlated subquery.

4. Write a SQL query that uses a subquery to filter results based on a condition.

5. Discuss the advantages and potential performance considerations of using subqueries.


Week 5: Views

1. Define a view in SQL and explain its benefits in database management.

2. Write a SQL statement to create a view based on specific criteria.

3. Explain the concept of data abstraction and how views contribute to it.

4. Demonstrate the usage of views to simplify complex queries.

5. Discuss the limitations and considerations when working with views in SQL.

No comments:

Post a Comment