emmnunes / DEI-OD1

Database for Design Workshop I / FCTUC

Home Page:http://emmnunes.github.io/DEI-OD1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DEI-OD1

SQL database for the second Oficina de Design I (Digital Workshop I) project @ FCTUC.

  1. Tables
  2. Rooms
  3. Services
  4. Teachers
  5. Offices
  6. Service Rooms
  7. Contributing
  8. Instructions
  9. Installation
  10. Running SQL Queries

Tables

Rooms

Lists all rooms in the building, by their official designation (E4.1)

  • id (Auto Incremented INT)
  • room (VARCHAR — e.g. F1.1)
  • floor (INT — e.g. 1)
  • tower (VARCHAR — e.g. F)
  • typology (VARCHAR — e.g. services)
  • name (VARCHAR — e.g. Bar)

Teachers

Lists all of the department teachers

Columns:

  • id (Auto Incremented INT)
  • name (VARCHAR — e.g. Alberto Jorge Lebre Cardoso)

Offices

Defines teacher offices, by establishing relations between the rooms and teachers tables

Columns:

  • id (Auto Incremented INT)
  • roomID (INT)
  • teacherID (INT)

Service Hours

Defines opening and closing times for services

Columns:

  • id (Auto Incremented INT)
  • roomID (INT)
  • open_time (TIME)
  • close_time (TIME)

Contributing

Students should fork this project and work on top of the original table structure, by adding any information that's relevant to the project, e.g.

  • adding teacher offices, by creating a table which makes use of the teachers and rooms tables
  • establishing relations between services and rooms
  • adding office hours for teachers
  • adding spatial information to rooms (e.g. floor, tower, etc.)
  • adding faculty facilities (e.g. bathrooms)
  • adding typology information to the rooms (e.g. meeting room, classroom, study room, etc.)
  • adding capacity information to rooms
  • flagging private or inacessible rooms
  • translating all tables to English

All changes considered useful for the entire class will be merged to the main repository. Pull requests should include at least one .sql file, with no database creation or editing instructions.

Note: You may want to check the latest phone listing of the department here.

Instructions

Installation

To build the tables, run phpMyAdmin from a local or remote server, or use the demo version available from the phpMyAdmin website.

Create a new database and import the od1.sql file or copy and paste its contents into the new database.

Running SQL Queries

You can use the following SQL snippets to quickly query any bit of data form the database.

Query all teachers

SELECT * FROM teachers

Query rooms starting with E

SELECT * FROM rooms
WHERE room LIKE 'E%'

Query service names and respective rooms

SELECT services.name, rooms.room
FROM service_rooms, rooms, services
WHERE service_rooms.roomID = rooms.id AND service_rooms.serviceID = services.id

Query teacher offices

SELECT rooms.room, teachers.name
FROM offices, rooms, teachers
WHERE offices.roomID = rooms.id AND offices.teacherID = teachers.id

If you have additional examples you'd like to share, please add them to the wiki.

About

Database for Design Workshop I / FCTUC

http://emmnunes.github.io/DEI-OD1