database-schema

is there a general accounting system database schema which i can use ?

i require a generic accounting system database schema is there any sites which provide this ? ...

Database design - table relationship question

I am designing schema for a simple quiz application. It has 2 tables - "Question" and "Answer Choices". Question table has 'question ID', 'question text' and 'answer id' columns. "Answer Choices" table has 'question ID', 'answer ID' and 'answer text' columns. With this simple schema it is obvious that a question can have multiple answer ...

which is better, creating a materialized view or a new table?

I have some demanding mysql queries that have to select same frequently updated datasets from 5-7 mysql tables. 'Select' operation would be a bit more than CUD. I am thinking of creating a table or materialized view to gather all demanding columns from other tables, so as to reduce overall query times to different tables and thus incre...

Sync LINQ-to-SQL DBML schema with SQL Server database

After creating a SQL Server 2008 database, I made a Linq-to-SQL schema in Visual Studio. Next, in the .dbml visual editor (in Visual Studio 2010), I added PK-to-FK and PK-to-PK associations to the schema. How do I copy those associations that I created in Visual Studio over to the database? In other words, how do I sync with the DB? ...

Marking deleted records in DB tables

Sometimes you want to mark a DB table record as deleted instead of deleting it permanently, right? How do you do that? So far I've been using a boolean "deleted" field but I'm not sure if it's a good apprach. ...

How update in a Multi Tenant app all schema of all tenants?

I am development a app multi tenant. I chose the approach Shared Database/ Separeted Schema. My idea is has a schema default (dbo) and when deploy this schema, do update schema of outhers tenants (tanantA, tenantB, tenantC). In other words, make sincronization schemas. How can sincronized this schemas of tenants with schema default? ...

SQL Server 2008 - Document storage schema's

Hey, I'm looking to make a hopefully rather simple document storage system in sql 2008. We have a general idea of the elements we need, some meta data storage, filesteam, etc, but there are a few things we aren't quite sure of. Specifically, we would like to implement a fake folder structure, as well as some (flexible) permissions. P...

How to create schema that have an access as that of dbo and can be accessed by sa user

I am new to schema, roles and user management part in sql server. Till now I used to work with simple dbo schema but now after reading few articles I am intrested in creating schema for managing my tables in a folder fashion. At present, I want to create a schema where i want to keep my tables that have same kind of functionality. When ...

Database migrations with Qt4 (schema changes)

From Ruby on Rails I've learned about a comfortable and very manageable way to do database migrations. How would one handle such cases in Qt4? It does not need to be that elaborated as Rails' solution. I'd be fine with running SQL and code snippets to go up or down the version list of my data. I googled a little bit but there seems to ...

Java library for reading database schema

I'm looking for a lightweight, open source, more or less cross-database Java library that would allow me to read off metainformation on columns, tables and integrity constraints given a DataSource. ...

How do I get an Oracle SCHEMA as DDL scripts with DBMS_METADATA (and SCHEMA_EXPORT)

I am having troubles to extract the DDL for a given schema with DBMS_METADATA, probably because my understanding of it is wrong. Here's what I basically do: set termout off create table copy_dml_schema(c clob, i number); declare m number; t number; e number; c clob; i number := 0; begin e := dbms_meta...

Database design: Is there a way to improve on this design?

Simple question- Below is the database design to hold the following records account TransactionType TransactionName Amount FeeTransactionId TransactionId RefTransactionId Alex [Deposit from] [Credit Card x-1234] [-100.00] b a Alex [Deposit from] ...

Database: how to share data between schema's?

Suppose I would like to have a common table for two schema's, is that possible? A table has it's schema in it's fully qualified name, e.g. [dev].[product] so it looks like this is not possible. How could I make the data in table [common].[types] (and not a copy) available to schema [dev]? A view perhaps? One more question: how about r...

How should I handle when a friend ignores someone in a PHP/MySQL app?

I have a table like friends(friendship_id, fid1, fid2, ENUM('pending', 'accepted', 'ignored'). When a user ignores someone's friend request, I want to make sure that they don't get a message saying, "You've been ignored!", but I also want that data logged. Any suggestions on how to approach this? ...

User Messages Database Schema?

This is probably very subjective and I have my own thoughts on this, but how would one go about constructing a database that supports user to user messages (one to one or one to many). My original thought was to have a MESSAGE table and MESSAGE_PARTIES table MESSAGE would include the following fields: -ID, Subject, Body, Create...

database schema for timesheet

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 pro...

Tool to generate data dictionary from SQL file

Ok, so I got duped into doing some database design for an Oracle database where I work. The problem is, I'm not much of a DB guy :-). I'm currently using Rational Application Developer (RAD) to do the modeling of my database schema. What I'd ideally like to do is generate a series of Word documents, containing information from my DB sche...

SQL schema Table compare

I'm looking for an app that will compare the layout of 2 SQL tables. When developing in a DEV environment, I need a tool that will make the production tables exactly like the DEV tables (the layout). ...

Optimizing query and/or data model for calendar app

Our calendar application represents an appointment domain as: Appointment ID (PK) StartDateTime EndDateTime ... AppointmentRole AppointmentID (FK) PersonOrGroupID (FK) /* joins to a person/group, outside the scope of this question */ Role ... Appointment has a 1 to many relationship with AppointmentRoles. Ea...

Polls database schema

Hello friends, I wanna create a poll system with possibilty to have many answers on my website but im thinking whats the best way. Im not so pro. Im thinking this schema: polls ------------------------------------- id | question | start_time | end_time poll_answers --------------------- id | poll_id | answer poll_votes -------------...