schema

What database schema can I use to save different types of billing data?

I have a system that creates an order and that order can be billed to a house account, sent Cash on Delivery (COD), or charged to a credit card. I've created the following tables: ORDERS order_id billingoption_id BILLINGOPTIONS billingoption_id I'm unsure of how the next table should be built for the billing data. Should I build a s...

rename schema in SQL server 2005

How can I rename a schema in SQL Server 2005? ...

Attribute/element co-occurrence constraint in XML Schema

Is it possible to create an XML Schema which imposes a co-occurrence constraint to an attribute/element pair? <primitive-list> <primitive name="P1"> <definition><!-- primitive specification --></definition> </primitive> <primitive name="P2"> <definition><!-- primitive specification --></definition> </primitive>...

Found unexpected <Submission> inside <<<<ROOT>>>>. This is not a valid child element

I am trying to validate xml file against schema using XML::Validator::Schema. But it gives me this error: Found unexpected <Submission> inside <<<<ROOT>>>>. This is not a valid child element. [Ln: 2, Col:119] Note: <Submission> is the very first element I have after <xml version="1.0" encoding="UTF-8"?> I can't figure out what it ...

Is there a Perl module that validates an XML against a schema?

I need to validate an XML agaist a schema. I tried XML::SAX::ParserFactory; XML::Validator::Schema and related modules but looks like they are limited. Limited in the sense that it didn't recognize schema elements such as xsd:unique, xsd:group, xsd:keyref, xsd:union and xsd:key. Are these xsd:unique, etc. new additions? Appreciate...

Typed DataSets with XML data sources and schemas

I've written an XML Schema file by hand (not using the DataSet Designer in VS) and a corresponding XML file containing structured data to be read in. I ran the xsd.exe program to generate a Typed DataSet class; on the whole it looks fine to begin with (ignoring how it uses lowercase for public class members), but when it comes to using ...

Can I atomically rename/replace 2 or more tables and views?

Given a table X and a view Y (that has the same structure as X) is there a way to rename X to Z and Y to X atomically so that no query will ever see nothing named X? Renaming X and creating the view would also be valid. The point would be to, as part of a schema migration plan, replace the old tables with views that simulate the old ver...

Creating XML with namespaces and schemas from an XElement

A longwinded question - please bear with me! I want to programatically create an XML document with namespaces and schemas. Something like <myroot xmlns="http://www.someurl.com/ns/myroot" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.someurl.com/ns/myroot http://www.someurl.com/xml/...

Creating an Information Systems Map

I am in the process of documenting the high level view of the information systems that we have. They aren't all 'silo' applications and components, and I the goal here is to highlight which components rely on which other components. My end goal is to have a 'map' or schema of the components in the company (apps, utility assemblies, data...

XML schema contruct for a type with both enumerations and attributes

I'm trying to create a type in an XML schema to enforce an element with both: A single attribute; and Simple content matching an enumeration. In an XML document, the element might look like: <Operator Permutation="true"> Equals </Operator> Where "Equals" would be one of the enumerations. Is this possible? If so, how? I've trie...

External library or mini-language for reading database schema?

I am considering writing a simple database application for my wife, but I'm hung up on good programming practice, and want to have a human readable source for storing the database schema. Only, I don't know of any tools for the job, and I can't believe that they don't exist---probably I just don't know what to ask google, but I'm not f...

How do you store a trie in a relational database?

I have a prefix trie. What is the recommended schema for representing this structure in a relational database? I need substring matching to remain efficient. ...

Database Schema - Booking/Availability System

I was recently asked an interview question on a hypothetical web based booking system and how I would design the database schema to minimize duplication and maximize flexibility. The use case is that a admin would enter the availability of a property into the system. There could be multiple time period set. For example, 1st of April 200...

XML Schema Case Insensitive Enumeration of Simple Type String

I am in need of a case insensitive string enumeration type in my XML schema (.xsd) file. I can get case insensitive by doing the following. <xs:simpleType name="setDigitalPointType"> <xs:restriction base="xs:string"> <xs:pattern value="[Oo][Nn]" /> <xs:pattern value="[Oo][Ff][Ff]" /> </xs:restriction> </xs:simpleType> The only p...

How to update database table schemas with NHibernate schema generation?

I'm trying to figure out how to use NHibernate configuration with mapping to update table schemas, rather than dropping and recreating them. Currently I'm using the NHibernate.Tool.hbm2ddl.SchemaExport obj with FluentNHibernate to generate the database schema for a mysql database. While I can't say it's a huge problem, whenever I call ...

How to design a database schema to support tagging with categories?

I am trying to so something like Database Design for Tagging, except each of my tags are grouped into categories. For example, let's say I have a database about vehicles. Let's say we actually don't know very much about vehicles, so we can't specify the columns all vehicles will have. Therefore we shall "tag" vehicles with information...

Looking for an XSD representing an 'Order' for a shopping cart

I am trying to create an XML schema representing an 'order' for a shopping cart I want this to completely abstract away my shopping cart's implementation -- and eventually support partners sending us orders using this schema. (yes i'm planning on integrating this schema into our existing cart) It will have original order items, repeat ...

authentication/ authorization schema

is there any best practice data model for authentication/ authorization schema ...

How to do mutually exclusive attributes in XML schema?

I'm trying to make two XML attributes to be mutually exclusive. How can one create an XSD schema to capture this kind of scenario? I would like to have one of these <elem value="1" /> <elem ref="something else" /> but not <elem value="1" ref="something else" /> ...

schema design

Let's say you are a GM dba and you have to design around the GM models Is it better to do this? table_model type {cadillac, saturn, chevrolet} Or this? table_cadillac_model table_saturn_model table_chevrolet_model Let's say that the business lines have the same columns for a model and that there are over a million records ...