relational-database

What is the difference between Views and Materialized Views in Oracle?

試著忘記壹切 提交于 2019-11-27 09:56:48
What is the difference between Views and Materialized Views in Oracle? dacracot Materialized views are disk based and are updated periodically based upon the query definition. Views are virtual only and run the query definition each time they are accessed. Mike Williamson Views They evaluate the data in the tables underlying the view definition at the time the view is queried . It is a logical view of your tables, with no data stored anywhere else. The upside of a view is that it will always return the latest data to you . The downside of a view is that its performance depends on how good a

Using a Relational Database for Schemaless Data - Best Practices

余生长醉 提交于 2019-11-27 09:53:14
问题 After reading a shocking article written by Bret Taylor (co-creator of FriendFeed; current CTO of Facebook), How FriendFeed uses MySQL to store schema-less data, I began to wonder if there are best practices for using a RDBMS such as Oracle, MySQL, or PostgreSQL for storing and querying schemaless data? Few people like to admit they're using a relational database when NoSQL is the new hotness, which makes it difficult to find good articles on the topic. How do I implement a schemaless (or

Database design: 3 types of users, separate or one table?

青春壹個敷衍的年華 提交于 2019-11-27 09:40:11
问题 I have 3 types of users: Admins Suppliers Employees Each user type will have different user interface and access different types of data. Their only similarity is they are using one web application but they access totally different things. Is it better to put them all in one user table like tbl_users or is it better to create tbl_admins, tbl_suppliers, tbl_employees? 回答1: What you need to consider when designing tables is not necessarily what they'll have access to and how that is similar

Does an empty SQL table have a superkey? Does every SQL table?

大憨熊 提交于 2019-11-27 09:39:36
I know what the term "SuperKey" in SQL stands for, but I cannot understand a specific thing and I would like some help. In a table with no data , is there a superkey? In any table, will there always exists one? TL;DR "Superkey" is a RM (Relational Model of Data) term. There's no standard use in SQL. The superkeys of an SQL table might reasonably informally be said to be the column sets that you could declare primary key or unique not null , plus maybe {} when a table holds at most one row (although you can't declare it). "Reasonably informally" because SQL tables are not RM relations. But if a

What Kind of Relationship is Between These Tables?

倾然丶 夕夏残阳落幕 提交于 2019-11-27 09:38:48
I have two tables that have foreign keys to each other's primary key. This DB is in French. I will translate the two tables that I want to you to understand. Atelier Cuisine ==> Kitchen Cuisinier == > Cooking chef So in this picture we see that in the Kitchen table we have a PK referenced by the FK from the Cooking chef table; in the Cooking chef table we have a PK referenced by the FK from the Kitchen table. So I am confused. I don't understand this kind of relationship between these tables. And I hope to check my query that I did to create these two tables if its correct CREATE TABLE

Proper database model for a user feedback system (an interesting case)

*爱你&永不变心* 提交于 2019-11-27 09:36:51
I am developing an application using PHP and Yii Framework. I've been thinking about the most suitable database structure for the given functionality and here's what I've come up with. Yet I'm not 100% positive that's how it should be done so I've decided to ask the community. App Description: Registered users may participate in an event. Every event can have an unlimited number of users, called "participants of the event"). Once the event is over, every participant can leave a feedback about every other participant of the same event. Database structure: Since every event can have an unlimited

Modeling Product Variants

心不动则不痛 提交于 2019-11-27 08:59:58
问题 I've been trying to model product variants and thought that I might need to use EAV. I might have been able to do it without EAV, but I'm concerned that I might have missed something. Here's my design: Here's what I am trying to represent: A product can have 0 or more product variants (e.g. a t-shirt product may have size and color variants). A product variant can have 1 or more product variant options (e.g. the size variant can be small, medium, large). An SKU is comprised of 1 or more

Using a Single Row configuration table in SQL Server database. Bad idea?

醉酒当歌 提交于 2019-11-27 08:58:45
问题 In developing a shopping cart application I've found that I needed to save settings and configurations based on the administrator's preferences and requirements. This information can be anything from company information, Shipping account IDs, PayPal API keys, notification preferences, etc. It seems highly inappropriate to create a table to store a single row in a relational database system. What is the appropriate way to store this information? Note: my DBMS is SQL Server 2008 and programming

What is the minimal proof that a database relation is not in BCNF?

我的未来我决定 提交于 2019-11-27 07:18:51
问题 I have the following functional dependencies (they represent all the functional dependencies on my relation): (1) BrokerName -> Office (2) StockName -> Dividend (3) InvestorId -> BrokerName (4) InvestorId, Stockname -> Quantity (5) InvestorId, Stockname -> Office I know from using the techniques in this YouTube video that (InvestorId, Stockname) is my one and only candidate key. According to @nvogel's solution in this SO thread: A relation, R, is in BCNF iff for every nontrivial FD (X->A)

relationships between 3 entities in ER diagram--is a ternary enough or are 2 binaries also needed?

 ̄綄美尐妖づ 提交于 2019-11-27 07:00:56
问题 I'm trying to draw an ER diagram for my project management software describing the following. It contains these entities: project - software projects tasks - software projects that can be broken into a number of tasks employees - employees that belong to this software And: A project can be divided into tasks. (Tasks can be created by the admin user, who can assign those tasks to selected projects. Here there is only assignment of tasks to projects, not assignment of employees to projects.)