SIT103 Database and Information Retrieval Assignment 2: SQL Queries
VerifiedAdded on  2021/06/15
|22
|2447
|193
Homework Assignment
AI Summary
This document presents a comprehensive solution to a database assignment (SIT103) focusing on relational database concepts and SQL queries. It begins by defining a relational schema with tables for Department, Dept_Locations, Employee, Project, Dependent, and Works_On, outlining primary and foreign key relationships, and specifying NOT NULL constraints for each column. Following the schema, the solution provides the SQL CREATE TABLE statements for each table, defining data types and constraints. Subsequently, it includes INSERT statements to populate these tables with sample data, demonstrating the population of various attributes for each entity. The core of the solution lies in a series of SQL queries (Query a to Query l) designed to retrieve specific information from the database, such as employee details, supervisor relationships, project information, dependent counts, and department managers. Each query is presented with its corresponding SQL code, showcasing various SQL features like JOIN operations, aggregation, and filtering with WHERE and HAVING clauses. The queries cover a range of database operations, including selecting, joining, grouping, and filtering data, providing a practical demonstration of SQL usage in a relational database context. The solution is supported by references to Guru99 and Brombarg for database normalization concepts.
1 out of 22