|
1 | | -# SQL Database Management Labs |
2 | | - |
3 | | -## In-Class SQL Labs |
4 | | - |
5 | | -| Topic | Resource | |
6 | | -|----------|------------------| |
7 | | -| Create Database & One table Queries | [Lab 1](inclass/InClassExercises) & [Lab 2](inclass/Lecture_Example_1) | |
8 | | -| Foreign Keys | [Foreign Keys](inclass/Foreign_Keys) | |
9 | | -| Join | [Multi Table Queries](inclass/Multi_Tables) | |
10 | | -| Set | [Lab 2](inclass/Lab2) | |
11 | | -| Nested Queries | [Lab 2](inclass/Lab2) | |
12 | | -| Aggregates | [Lab 2](inclass/Lab2) | |
13 | | -| SQL Examples (+ OuterJoin) | [Lab 2](inclass/Lab2) | |
14 | | -| Division | [Lab 2](inclass/Lab2) | |
15 | | -| Views | [Lab 3](labs/Lab5_views.md) | |
16 | | -| Interface with Python | [Lab 4](inclass/Lab_Python) | |
17 | | -| Interface with Jupyter | [Lab 4.1](https://nbviewer.org/urls/teachingow.github.io/DBMS-SQL-Labs/inclass/Mysql-Jupyter.ipynb) | |
18 | | -| Window Function | [Lab 5](inclass/Lab4) | |
19 | | -| Normal Forms | [Normal Forms](labs/Lab3_Normal_forms.md) | |
20 | | -| Roll up | [Rollup](https://nbviewer.org/urls/teachingow.github.io/DBMS-SQL-Labs/inclass/Rollup.ipynb) | |
21 | | -| Triggers | [Triggers](https://nbviewer.org/urls/teachingow.github.io/DBMS-SQL-Labs/inclass/Triggers.ipynb) | |
22 | | -| Transactions | [Transactions](inclass/Transactions) | |
23 | | -| Isolation Levels | [MySQL Testing Isolation Levels](https://medium.com/@huynhquangthao/mysql-testing-isolation-levels-650a0d0fae75) | |
24 | | -| JSON | [JSON/XML Lab](labs/Lab_JSON-XML.md) | |
25 | | -| MongoDB | [MongoDB Lab](labs/Lab10_mongoDB.md) | |
26 | | -| Neo4j | [Neo4j Lab](other/Lab11_neo4j) | |
27 | | - |
28 | | -## Data Sets |
29 | | - |
30 | | -The data sets used in these labs are available in the [data directory](https://github.com/TeachingOW/DBMS-SQL-Labs/tree/main/data). |
31 | | - |
32 | | -## Project Website |
33 | | - |
34 | | -Visit the project website at [https://teachingow.github.io/DBMS-SQL-Labs/](https://teachingow.github.io/DBMS-SQL-Labs/) |
35 | | - |
36 | | -## Additional Tutorials |
37 | | - |
38 | | -* [SQLZoo](https://sqlzoo.net/wiki/SQL_Tutorial) - Interactive SQL tutorial with exercises |
| 1 | +# Database Management System (DBMS) SQL Labs |
| 2 | + |
| 3 | +A comprehensive collection of hands-on SQL laboratories designed to teach database concepts from basic queries to advanced database management techniques. These labs provide practical experience with SQL, database design, and modern database technologies. |
| 4 | + |
| 5 | +## 🎯 Learning Objectives |
| 6 | + |
| 7 | +By completing these labs, students will: |
| 8 | +- Master fundamental SQL operations (SELECT, INSERT, UPDATE, DELETE) |
| 9 | +- Understand database design principles and normalization |
| 10 | +- Learn advanced SQL concepts (joins, subqueries, window functions) |
| 11 | +- Gain experience with database programming and interfaces |
| 12 | +- Explore modern database technologies (NoSQL, Graph databases) |
| 13 | +- Understand transaction management and concurrency control |
| 14 | + |
| 15 | +## 📚 Lab Structure |
| 16 | + |
| 17 | +### Foundational Labs (SQL Basics) |
| 18 | + |
| 19 | +| Lab | Topic | Description | Resource | |
| 20 | +|-----|-------|-------------|----------| |
| 21 | +| 1 | Database Creation & Basic Queries | Learn to create databases, tables, and perform simple SELECT operations | [Lab 1](inclass/InClassExercises.md) | |
| 22 | +| 2 | Advanced Queries & Joins | Master multi-table queries, joins, and complex WHERE clauses | [Lab 2](inclass/Lab2.md) | |
| 23 | +| 3 | Foreign Keys & Relationships | Understand referential integrity and table relationships | [Foreign Keys](inclass/Foreign_Keys.md) | |
| 24 | +| 4 | Multi-Table Operations | Practice complex joins and relationship queries | [Multi Tables](inclass/Multi_Tables.md) | |
| 25 | + |
| 26 | +### Intermediate Labs (Advanced SQL) |
| 27 | + |
| 28 | +| Lab | Topic | Description | Resource | |
| 29 | +|-----|-------|-------------|----------| |
| 30 | +| 5 | Set Operations & Nested Queries | Learn UNION, INTERSECT, and subquery techniques | [Lab 2 Advanced](inclass/Lab2.md) | |
| 31 | +| 6 | Aggregate Functions & Grouping | Master COUNT, SUM, AVG, GROUP BY, and HAVING clauses | [Lab 2 Aggregates](inclass/Lab2.md) | |
| 32 | +| 7 | Window Functions | Learn advanced analytical functions and partitioning | [Window Functions](inclass/Lab4.md) | |
| 33 | +| 8 | Views & Virtual Tables | Create and manage database views for data abstraction | [Views Lab](labs/Lab5_views.md) | |
| 34 | + |
| 35 | +### Database Design Labs |
| 36 | + |
| 37 | +| Lab | Topic | Description | Resource | |
| 38 | +|-----|-------|-------------|----------| |
| 39 | +| 9 | Database Normalization | Learn 1NF, 2NF, 3NF and database design principles | [Normal Forms](labs/Lab3_Normal_forms.md) | |
| 40 | +| 10 | Advanced SQL Techniques | Practice complex queries and optimization | [Advanced SQL](labs/Lab4_sql.md) | |
| 41 | + |
| 42 | +### Programming Integration Labs |
| 43 | + |
| 44 | +| Lab | Topic | Description | Resource | |
| 45 | +|-----|-------|-------------|----------| |
| 46 | +| 11 | Python Database Interface | Connect Python applications to databases using connectors | [Python Lab](inclass/Lab_Python.md) | |
| 47 | +| 12 | Jupyter Notebook Integration | Interactive database analysis with Jupyter notebooks | [Jupyter Lab](https://nbviewer.org/urls/teachingow.github.io/DBMS-SQL-Labs/inclass/Mysql-Jupyter.ipynb) | |
| 48 | + |
| 49 | +### Advanced Database Concepts |
| 50 | + |
| 51 | +| Lab | Topic | Description | Resource | |
| 52 | +|-----|-------|-------------|----------| |
| 53 | +| 13 | Analytical Functions | Master ROLLUP, CUBE, and advanced grouping operations | [Rollup Lab](https://nbviewer.org/urls/teachingow.github.io/DBMS-SQL-Labs/inclass/Rollup.ipynb) | |
| 54 | +| 14 | Triggers & Stored Procedures | Implement database automation and business logic | [Triggers Lab](https://nbviewer.org/urls/teachingow.github.io/DBMS-SQL-Labs/inclass/Triggers.ipynb) | |
| 55 | +| 15 | Transaction Management | Understand ACID properties and concurrency control | [Transactions](inclass/Transactions.md) | |
| 56 | +| 16 | Isolation Levels | Learn about database isolation and consistency | [Isolation Levels](inclass/Isolation_Levels.md) | |
| 57 | + |
| 58 | +### Modern Database Technologies |
| 59 | + |
| 60 | +| Lab | Topic | Description | Resource | |
| 61 | +|-----|-------|-------------|----------| |
| 62 | +| 17 | JSON & XML Processing | Handle semi-structured data in relational databases | [JSON/XML Lab](labs/Lab_JSON-XML.md) | |
| 63 | +| 18 | MongoDB (NoSQL) | Introduction to document-based databases | [MongoDB Lab](labs/Lab10_mongoDB.md) | |
| 64 | +| 19 | Neo4j (Graph Database) | Explore graph database concepts and Cypher queries | [Neo4j Lab](other/Lab11_neo4j.md) | |
| 65 | + |
| 66 | +## 🗃️ Data Sets |
| 67 | + |
| 68 | +The repository includes several real-world datasets for hands-on practice: |
| 69 | + |
| 70 | +| Dataset | Description | Use Cases | |
| 71 | +|---------|-------------|-----------| |
| 72 | +| [IMDB Movie Data](data/IMDB-Movie-Data.csv) | Movie information including ratings, genres, and revenue | Complex queries, aggregations, data analysis | |
| 73 | +| [Air Travel Data](data/airtravel.csv) | Flight and passenger information | Time-series analysis, grouping operations | |
| 74 | +| [Cities Data](data/cities.csv) | Geographic and demographic information | Joins, geographic queries | |
| 75 | +| [Employee Data](data/employees.csv) | HR database with employee information | Relationship modeling, hierarchical queries | |
| 76 | +| [Student Grades](data/grades.csv) | Academic performance data | Statistical analysis, ranking functions | |
| 77 | +| [Drivers Database](data/drivers.sql) | Complete database schema with sample data | Full database operations, complex relationships | |
| 78 | + |
| 79 | +## 🚀 Getting Started |
| 80 | + |
| 81 | +### Prerequisites |
| 82 | +- MySQL or MariaDB server installed |
| 83 | +- Basic understanding of relational database concepts |
| 84 | +- Text editor or SQL client (MySQL Workbench, phpMyAdmin, etc.) |
| 85 | + |
| 86 | +### Quick Start Guide |
| 87 | +1. **Clone the repository** |
| 88 | + ```bash |
| 89 | + git clone https://github.com/TeachingOW/DBMS-SQL-Labs.git |
| 90 | + cd DBMS-SQL-Labs |
| 91 | + ``` |
| 92 | + |
| 93 | +2. **Set up your database** |
| 94 | + ```sql |
| 95 | + CREATE DATABASE dbms_labs; |
| 96 | + USE dbms_labs; |
| 97 | + ``` |
| 98 | + |
| 99 | +3. **Start with Lab 1** |
| 100 | + - Navigate to [InClass Exercises](inclass/InClassExercises.md) |
| 101 | + - Follow the step-by-step instructions |
| 102 | + - Practice with the provided examples |
| 103 | + |
| 104 | +### Lab Progression |
| 105 | +- **Beginners**: Start with Labs 1-4 (Foundational Labs) |
| 106 | +- **Intermediate**: Continue with Labs 5-8 (Advanced SQL) |
| 107 | +- **Advanced**: Explore Labs 9+ (Database Design & Modern Technologies) |
| 108 | + |
| 109 | +## 🛠️ Tools and Technologies |
| 110 | + |
| 111 | +### Database Systems |
| 112 | +- **MySQL/MariaDB**: Primary database system for most labs |
| 113 | +- **MongoDB**: NoSQL document database (Lab 18) |
| 114 | +- **Neo4j**: Graph database system (Lab 19) |
| 115 | + |
| 116 | +### Programming Languages |
| 117 | +- **SQL**: Standard query language for relational databases |
| 118 | +- **Python**: Database connectivity and data analysis |
| 119 | +- **Cypher**: Query language for Neo4j graph database |
| 120 | + |
| 121 | +### Development Environment |
| 122 | +- **Jupyter Notebooks**: Interactive data analysis and visualization |
| 123 | +- **Command Line Tools**: Direct database interaction |
| 124 | +- **Database Clients**: GUI tools for database management |
| 125 | + |
| 126 | +## 📖 Additional Learning Resources |
| 127 | + |
| 128 | +### Interactive Tutorials |
| 129 | +- [SQLZoo](https://sqlzoo.net/wiki/SQL_Tutorial) - Interactive SQL tutorial with exercises |
| 130 | +- [W3Schools SQL Tutorial](https://www.w3schools.com/sql/) - Comprehensive SQL reference |
| 131 | +- [MySQL Tutorial](https://dev.mysql.com/doc/mysql-tutorial-excerpt/8.0/en/) - Official MySQL documentation |
| 132 | + |
| 133 | +### Advanced Topics |
| 134 | +- [Database Design Principles](https://www.lucidchart.com/pages/database-diagram/database-design) - ER modeling and normalization |
| 135 | +- [SQL Performance Tuning](https://use-the-index-luke.com/) - Query optimization techniques |
| 136 | +- [NoSQL Databases](https://www.mongodb.com/nosql-explained) - Understanding document and graph databases |
| 137 | + |
| 138 | +### Practice Platforms |
| 139 | +- [HackerRank SQL](https://www.hackerrank.com/domains/sql) - SQL coding challenges |
| 140 | +- [LeetCode Database](https://leetcode.com/problemset/database/) - Database problem solving |
| 141 | +- [SQLBolt](https://sqlbolt.com/) - Interactive SQL lessons |
| 142 | + |
| 143 | +## 🤝 Contributing |
| 144 | + |
| 145 | +We welcome contributions to improve these labs! Please: |
| 146 | +1. Fork the repository |
| 147 | +2. Create a feature branch |
| 148 | +3. Make your improvements |
| 149 | +4. Submit a pull request |
| 150 | + |
| 151 | +### Areas for Contribution |
| 152 | +- Additional practice exercises |
| 153 | +- New dataset examples |
| 154 | +- Improved explanations and documentation |
| 155 | +- Bug fixes and corrections |
| 156 | +- Translation to other languages |
| 157 | + |
| 158 | +## 📄 License |
| 159 | + |
| 160 | +This project is licensed under the MIT License - see the LICENSE file for details. |
| 161 | + |
| 162 | +## 🌐 Project Website |
| 163 | + |
| 164 | +Visit the project website at [https://teachingow.github.io/DBMS-SQL-Labs/](https://teachingow.github.io/DBMS-SQL-Labs/) for additional resources and updates. |
0 commit comments