|
Вопрос из 70-229
|
|||
---|---|---|---|
#18+
You are designing a database that will contain customer orders. Customers will be able to order multiple products each time they place an order. You review the database design, which is show below: Customers <----- Orders <------> Products CustomerID OrderID ProductID CompanyName ProductID Description Address OrderDate UnitPrice City Quantity State CustomerID You want to promote quick response times for queries and minimize redundant data. What should you do? (Each correct answer presents part of the solution. Choose two) A. Create a new order table named OrdersDetail. Add OrderID, ProductID, and Quantity columns to this table. B. Create a composite PRIMARY KEY constraint on the OrderID and ProductID columns of the Orders table C. Remove the ProductID and Quantity columns from the Orders table D. Create a UNIQUE constraint on the OrderID column of the Orders table. E. Move the UnitPrice column from the Products table to the Orders table. Ответ дан A,C. Только я не пойму зачем создавать дополнительнйю таблицу OrdersDetail? Получается две таблицы OrdersDetail и Orders с информацией, которая как мне кажеться должна быть в одной таблице. Если это правильный ответ, поясните мне почему? Спасибо. ... |
|||
:
Нравится:
Не нравится:
|
|||
14.01.2003, 10:02 |
|
Вопрос из 70-229
|
|||
---|---|---|---|
#18+
Orders <------> Products : отношение многие ко многим. MS SQL не поддерживает такие конструкции, так что разрешаем эту ситуацию - добавляем сущность OrdersDetail. В принципе вопрос из области концептуальных схем базы данных. ... |
|||
:
Нравится:
Не нравится:
|
|||
14.01.2003, 10:21 |
|
Вопрос из 70-229
|
|||
---|---|---|---|
#18+
Там в таблице Orders есть поле OrderDate которое будет дублироваться для всех строк заказа. Для того чтобы нормализовать данные необходимо создать еще одну таблицу orderdetail ... |
|||
:
Нравится:
Не нравится:
|
|||
14.01.2003, 12:07 |
|
Вопрос из 70-229
|
|||
---|---|---|---|
#18+
отношение многие ко многим. MS SQL не поддерживает такие конструкции да неужели? не вижу связи с MS SQL. Для того чтобы нормализовать данные необходимо создать еще одну таблицу orderdetail то есть 2 таблицы orderdetail?! Таблицу следует создать: 1. Чтобы обеспечить условие множественности (multiple products) 2. Чтобы быстрее получать статистику: за такой-то период такой-то кастомер сделал столько-то заказов. Что типично для многих систем. ... |
|||
:
Нравится:
Не нравится:
|
|||
14.01.2003, 19:30 |
|
Вопрос из 70-229
|
|||
---|---|---|---|
#18+
да неужели? не вижу связи с MS SQL. Т.е. Вы хотите сказать что сиквел в состоянии такие связи обеспечить? Интересно на это посмотреть. Вот ответ на этот вопрос, буквально BOL: Many-to-Many Relationships In a many-to-many relationship, a row in table A can have many matching rows in table B, and vice versa. You create such a relationship by defining a third table, called a junction table, whose primary key consists of the foreign keys from both table A and table B. For example, the authors table and the titles table have a many-to-many relationship that is defined by a one-to-many relationship from each of these tables to the titleauthors table. The primary key of the titleauthors table is the combination of the au_id column (the authors table's primary key) and the title_id column (the titles table's primary key). ... |
|||
:
Нравится:
Не нравится:
|
|||
15.01.2003, 06:15 |
|
Вопрос из 70-229
|
|||
---|---|---|---|
#18+
2AVL: Я к тому, что тут Microsoft SQL Server ни при чем. То, что Вы привели - это вообще по реляционным СУБД и никакой специфики для сиквела я тут не усмотрел. Или я не прав? ... |
|||
:
Нравится:
Не нравится:
|
|||
15.01.2003, 12:01 |
|
|
start [/forum/topic.php?fid=34&msg=32090146&tid=1552125]: |
0ms |
get settings: |
10ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
48ms |
get topic data: |
13ms |
get forum data: |
3ms |
get page messages: |
55ms |
get tp. blocked users: |
2ms |
others: | 243ms |
total: | 396ms |
0 / 0 |