database-design

DB Schema for Appointment Booking App: What is the correct relationship between Doctors, Appointments, TimeSlots, Patients?

不想你离开。 提交于 2019-12-21 06:29:25
问题 [ UPDATED SCHEMA: http://i.imgur.com/fX9CGNh.png ] I'm tasked with developing an appointment booking system that is designed for a small medical office. It is a Rails 3.2 app. I'm having difficulty designing a database schema that makes sense to me. Question: Given the following information, what is the correct relationship between doctors, patients, appointments, chairs and time_slots? Patients need to make appointments with a doctor's office. Depending on the type of appointment, each

Database schema that manages weekly timesheets

左心房为你撑大大i 提交于 2019-12-21 06:24:13
问题 I'm writing this post because I was wondering if somebody could help me to figure out how the best database schema for a simple timesheets app will be. I can't figure out how to diagram tables that help me to represent weeks of the year, where all the users will log their work week hours. Cheers, and many thanks for your help! :) Guillermo 回答1: I will share with you a typical model that we use, https://www.dropbox.com/s/3wo9qd2fdpe5yow/timesheet_model.png, and describe each of the tables:

Database schema that manages weekly timesheets

偶尔善良 提交于 2019-12-21 06:23:10
问题 I'm writing this post because I was wondering if somebody could help me to figure out how the best database schema for a simple timesheets app will be. I can't figure out how to diagram tables that help me to represent weeks of the year, where all the users will log their work week hours. Cheers, and many thanks for your help! :) Guillermo 回答1: I will share with you a typical model that we use, https://www.dropbox.com/s/3wo9qd2fdpe5yow/timesheet_model.png, and describe each of the tables:

Database Design (Inventory DB)

梦想的初衷 提交于 2019-12-21 06:18:40
问题 I'm looking to design an inventory database that tracks a snack bar. As this would be a single person/computer access and need to be easily movable to another system, I plan to use SQLite as the DB engine. The basic concept is to track inventory bought from a wholesale warehouse such as Sams Club, and then keep track of the inventory. The main obstacle I'm trying to overcome is how to track bulk vs individual items in the products database. For example if a bulk item is purchased, let us say

Should SQL Server transaction tables always have a surrogate primary key

我怕爱的太早我们不能终老 提交于 2019-12-21 05:51:32
问题 For a large table of transactions (100 million rows, 20 GB) that already has a primary key (a natural composite key of 4 columns), will it help performance to add an identity column and make that the primary key? The current primary key (the natural composite primary key of 4 columns) does the job, but I have been told that you should always have a surrogate key. So, could improve performance by creating an identity column and making that the primary key? I'm using SQL Server 2008 R2 database

Should SQL Server transaction tables always have a surrogate primary key

我只是一个虾纸丫 提交于 2019-12-21 05:51:06
问题 For a large table of transactions (100 million rows, 20 GB) that already has a primary key (a natural composite key of 4 columns), will it help performance to add an identity column and make that the primary key? The current primary key (the natural composite primary key of 4 columns) does the job, but I have been told that you should always have a surrogate key. So, could improve performance by creating an identity column and making that the primary key? I'm using SQL Server 2008 R2 database

Time availability comparison, using Ruby on Rails

点点圈 提交于 2019-12-21 05:31:04
问题 I want to have an availability table for multiple objects, and compare them. For example, a renter would search for a rental unit which is available from 1-3PM on Monday. To do this, I thought I would divide the week into 30-minute time slots and give each time slot an ID. Then the date range would search for corresponding timeslot IDs. However, then I'd need 5040 records to keep track of each timeslot, and I'm not too thrilled about maintaining this manually (and in Ruby I don't know how I

What database do online games like Farmville use? [closed]

徘徊边缘 提交于 2019-12-21 05:24:11
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Apart from graphical features, online games should have a simple Relational Database structure. I am curious what database do online

Hierarchical Data Structure Design (Nested Sets)

浪尽此生 提交于 2019-12-21 05:21:31
问题 I'm working on a design for a hierarchical database structure which models a catalogue containing products (this is similar to this question). The database platform is SQL Server 2005 and the catalogue is quite large (750,000 products, 8,500 catalogue sections over 4 levels) but is relatively static (reloaded once a day) and so we are only concerned about READ performance. The general structure of the catalogue hierarchy is:- Level 1 Section Level 2 Section Level 3 Section Level 4 Section

Design to represent employee check-in and check-out

旧城冷巷雨未停 提交于 2019-12-21 05:13:20
问题 I currently have a table which represents the start and stop work times of an employee: id_employee int check_in datetime check_out datetime It requires an update on check_out when the employee is finished. Would it be preferable to have a table as follows ? id_employee int date_event datetime event_type varchar, values can be CHECKIN or CHECKOUT. To determine if an employee has already checked in all I have to is check if the last record for a given employee has an event_type of CHECKIN.