database-schema

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 Design - “Push” Model, or Fan-out-on-write

元气小坏坏 提交于 2019-12-21 03:12:30
问题 Background Info : I'm trying to retrieve images from people I follow, sort by latest time. It's like a twitter news feed where they show the latest feed by your friends. Plans: Currently there is only 1 item i need to keep in consideration, which is the images. In future i'm planning to analyse user's behavior and add in other images they might like into their feed, etc. http://www.quora.com/What-are-best-practices-for-building-something-like-a-News-Feed I personally feel that "Pull" Model,

cassandra add column if not exists

夙愿已清 提交于 2019-12-20 17:39:59
问题 I need to insert a new column into an existing column family via a CQL script. I want to do something like: alter COLUMNFAMILY rules ADD rule_template text IF NOT EXISTS; How can I achieve this purely in CQL script? 回答1: There is no optional "if not exists" for altering column families (tables). As a workaround you could just execute the alter command and ignore the error if the column already exists. There shouldn't be any harm in it, other than the error message. 来源: https://stackoverflow

How do I set the default schema for a user in MySQL

一世执手 提交于 2019-12-20 10:59:12
问题 Is there a way to set a default schema for each user in MySQL and if so how? Where user x would default to schema y and user z would default to schema a. 回答1: There is no default database for user. There is default database for current session. You can get it using DATABASE() function - SELECT DATABASE(); And you can set it using USE statement - USE database1; You should set it manually - USE db_name , or in the connection string. 回答2: If your user has a local folder e.g. Linux, in your users

database schema for timesheet

社会主义新天地 提交于 2019-12-20 10:10:25
问题 Could someone help me with a rough database schema for a timesheet application where the i would be able to Store hours per day for a time period ( 2 weeks ) for different projects. Ex person A can put 3 hours for projectA and 4 hours for projectB on the same day Make it so that its is easy to get a reports on total hours put for a project, or to get total hours on all projects by a certain person EDIT: Another requirement would be that each timesheet for a particular time period for every

Database Design for storing Chat Messages between people

不羁的心 提交于 2019-12-20 09:55:08
问题 I am trying to build a messaging/chat system. which can store conversation between two people in a chronological order. Also if User A deletes the conversation User B still should have access the conversation until he wishes to delete them. Inbox - All the messages recieved by the user from various users will be displayed with the latest message from that particular thread. Conversation Screen - Chronological order of the conversation between the User A and User B This is the basic structure

Hierarchical database model

无人久伴 提交于 2019-12-20 06:49:08
问题 I'm designing a classifieds website about pets that will have 3 (main) categories of ads: A- Sale B- Breeding C- Jobs The problem I'm facing is that all 3 ad categories have some things in common, but they also have some differences. For example, categories A, B and C all have the following in common: category_id ad_id user_id location However, category B ads cannot be classified as "Looking For/For Sale", whereas B & C can. Furthermore, each category will have its own subcategories. For

How to identify system objects when viewing list of SQL Server database objects?

回眸只為那壹抹淺笑 提交于 2019-12-20 03:03:11
问题 I'm trying to list all the stored procedures from all the databases on my server, and I can't seem to filter out system objects reliably. I was using: SELECT * FROM sysobjects WHERE id > 100 Which seems to work fine in every database except MSDB, which is full of a ton of stored procs with normal-looking IDs, but they're system stored procs. As far as I can tell, there's no way for me to filter out system stored procs using any of the values in the sysobjects table - does anybody else know of

Should I make a foreign key that can be null or make a new table?

删除回忆录丶 提交于 2019-12-20 01:13:20
问题 I have a small question concerning with how I should design my database. I have a table dogs for an animal shelter and I have a table owners. In the table dogs all dogs that are and once were in the shelter are being put. Now I want to make a relation between the table dogs and the table owners. The problem is, in this example not all dogs have an owner, and since an owner can have more than one dog, a possible foreign key should be put in the table dogs (a dog can't have more than one owner,

Extendable Database Schema - How to store the extendable attribute values

浪尽此生 提交于 2019-12-19 10:28:17
问题 We are using SQL Server 2008 and one of the requirements is to have extendable user defined attributes on the entities that are defined for the system. For example, we might have a entity called Doctor, we want the admins of the system to be able to define extra attributes that normally are not in the system. These attributes will most likely be needed as query criteria linking parent or joiner tables. There will be tables that define the attributes (Name, description, type) and so forth, but