Tag Info

New answers tagged

0

The order-invoice-payment pattern is one commonly seen in accounting. Those tables belong together in the "finance" part of your business model. It is well-established practice to be able to tie incoming money back to a customer request. Your financial auditors will expect to be able to follow that trail and reconcile the rows there with other records. ...


0

There is not enough information, but sadly I don't have enough reputation to post a comment so I'll do my best even when I'm making some assumptions. The term subscription suggests a periodic event. Maybe the monthly t-shirt. As it is periodic, it does not generate any order when it is created. When the periodic event is triggered (the monthly t-shirt is ...


1

You can easily find the subsequence when you cast the arrays to strings and replace the curly brackets with commas: translate(cast(sequence as varchar(10000)), '{}',',,') {1,3,17,25,377,424,242,1234} -> ',1,3,17,25,377,424,242,1234,' Do the same for the array you're searching for and add a leading and trailing %: '%' || translate(cast(searchedarray ...


0

The fact that you are finding it difficult to explain indicates that there is an issue with the design, the expectations, or the perceived requirements. Are Subscriptions automatically paid for, such as through a credit card? Is that why an Invoice seems unnecessary? Or some other reason. Your current state is: Customers can purchase your products in ...


1

I would handle this scenario by means of a (super)type-subtype relationship. You may find this answer of help as an introductory resource. If I understand your specifications well, the following assertions are relevant in your business context: A Party is either one Group or one User. A User can be member of one-to-many Groups or, put another way, a Group ...


0

The most relational way is adding a day table. You will be able to join room, availability and day to find out which rooms are available for a certain period.


1

No, ODBC cannot set the schema. ODBC is (in Wikipedia-speak) "a standard programming language middleware API for accessing database management systems (DBMS). The designers of ODBC aimed to make it independent of database systems and operating systems." If you want an array of schemas, they need to be created in the database before they are used. If you ...


2

It seems that you are involved in a scenario that requires the creation of an auditable database. You may find related information by searching for the terms temporal databases and database history tables. Yes, there are cases in which it is paramount to keep track of the updates that an entity suffers over time, and there are other cases in which changes ...


0

SQL should be present in $ORACLE_HOME/demo/schema/order_entry. This link -> http://docs.oracle.com/cd/B28359_01/server.111/b28328/installation.htm gives all the info. Adding this link where it can be downloaded as well: http://www.oracle.com/technetwork/developer-tools/datamodeler/sample-models-scripts-224531.html


2

I will use pseudo code to illustrate; you can adapt to your DBMS's specific syntax. Join availability to transaction on room.id and also on the overlapping intervals i.e. Availability.from <= TimePartOf(transaction.checkout) And availability.til >= TimePartOf(transaction.checkin) If, for example, a room had different rates in the morning and ...


2

I have done one structure that may help you. room. It's the main room configuration where you can add any value that refer to the rooms. room_status. It's the room status where you could know which is the room actual status. transaction. Its your main table, here you're going to storage all the activities of the rooms. user. Here you can delimit which ...


3

If I were you I would make sure to separate all of the data. Is this going to be completely controlled in the database, or is there going to be an application? If it is an application I would have a users table and permissions tables for the people using the application. I would do a separate a customers table for your customers. I agree with the ...


2

Off guess you are missing the connect permission. I'd always thought that was created with the user but there may be conditions where it isn't added. Try running USE [MyDatabase]; GO GRANT CONNECT TO [MyDomain\MyAccount]; You could also try changing the default schema of [MyDomain\MyAccount] ALTER USER [MyDomain\MyAccount] WITH DEFAULT_SCHEMA = ...


0

If the restaurant is that complicated I would use a simple solution. I would have an ingredients table and a entrée table to reference those ingredients. For example is you have a choice of pasta, sauce, cheese, and a meat on the side. I would have a table to store that information. I would then have a desserts and drink table that is separate. You can store ...


3

So what I am looking for is a way to store a large number of activities that have almost no fields in common in a way that makes reporting easier. Not enough rep to comment first, so here we go! If the primary purpose is reporting and you have a DW (even if it isn't star schema) I'd recommend attempting to get this into a star schema. The benefits ...


0

You cannot get around this with MySQL RDS, ... EVER !!! Can we disable binary logging for one specific session or user in AWS RDS MySQL Documentation says it requires SUPER even at the session level The Scale-Out Blog: Replicating from MySQL to Amazon RDS says We will take a recent replicator build that contains the RDS changes, which are documented ...


1

The answer to both of your questions is really the same. You are using a script generation tool. It does what it's told to do. Typically the second command is only needed if you are doing a WITH NOCHECK on the first one. However it's included because the settings for the script generation component of SSMS told it to include it. Here is a post I did on ...


3

This happens when not having USAGE privilege on any of the schemas of search_path. By default the pseudo-role public (all users) has this privilege on the publicschema, so this error happens only after revoking it explicitly with: revoke usage on schema public from public; This is required when it's not desirable that people peek into other people ...


0

Figured it out. A bad script granted database-wide SELECT permissions to the user. Found it using this script: WITH perms_cte as ( select USER_NAME(p.grantee_principal_id) AS principal_name, dp.principal_id, dp.type_desc AS principal_type_desc, p.class_desc, OBJECT_NAME(p.major_id) ...


1

This schema would make sense to me: tblCompany ( Company_ID PK Company_Name ) tblProduct ( Prod_No PK Company_ID FK_tblCompany_CompanyID Prod_Name Prod_Mark_No Prod_Catalogue Prod_Type Prod_Expiry_Date Prod_Verify_Date Prod_Comments ) You could have separate tables for product type and product catalogue to get to 3NF but that's a ...


1

An owner of a database object has full rights on it automatically and unrevokably. But of course you can give an user all rights to a schema without making him the owner.



Top 50 recent answers are included