Access violation writing location 错误

qq_22722049 2016-07-06 03:19:53

#include <stdio.h>
#include <malloc.h>
double ****PsiDDiffj,
****PsiDDiffi,
****sDDiff,
r_h = 10;

int ****NorDiff,
numv = 100;
Generate_PsiDuopolyDiff() {
int aa, bb, cc, dd;
double vv_ja, vv_jb, vv_ia, vv_ib, deltav = r_h / numv, ll;
PsiDDiffj = (double ****)malloc((numv + 2) * sizeof(double***));
PsiDDiffi = (double ****)malloc((numv + 2) * sizeof(double***));
sDDiff = (double ****)malloc((numv + 2) * sizeof(double***));
NorDiff = (int ****)malloc((numv + 2) * sizeof(int***));
for (aa = 0; aa <= numv; aa++) {
PsiDDiffj[aa] = (double ***)malloc((numv + 2) * sizeof(double**));
PsiDDiffi[aa] = (double ***)malloc((numv + 2) * sizeof(double**));
sDDiff[aa] = (double ***)malloc((numv + 2) * sizeof(double**));
NorDiff[aa] = (int ***)malloc((numv + 2) * sizeof(int**));
for (bb = 0; bb <= numv; bb++) {
PsiDDiffj[aa][bb] = (double **)malloc((numv + 2) * sizeof(double*));
PsiDDiffi[aa][bb] = (double **)malloc((numv + 2) * sizeof(double*));
sDDiff[aa][bb] = (double **)malloc((numv + 2) * sizeof(double*));
NorDiff[aa][bb] = (int **)malloc((numv + 2) * sizeof(int*));
for (cc = 0; cc <= numv; cc++) {
PsiDDiffj[aa][bb][cc] = (double *)malloc((numv + 2) * sizeof(double )); //where the error happened
PsiDDiffi[aa][bb][cc] = (double *)malloc((numv + 2) * sizeof(double ));
sDDiff[aa][bb][cc] = (double *)malloc((numv + 2) * sizeof(double ));
NorDiff[aa][bb][cc] = (int *)malloc((numv + 2) * sizeof(int ));
}
}
}
}
void
main() {
Generate_PsiDuopolyDiff();
}


我现在要生成一个四维的数组,然后我是确定数组大小的。((numv + 2)*(numv + 2)*(numv + 2)*(numv + 2))但是编译的时候报错,显示Access violation writing location。 求问为什么?谢谢大家!
...全文
784 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2016-07-07
  • 打赏
  • 举报
回复
13楼正解!
flying_music 2016-07-07
  • 打赏
  • 举报
回复
引用 8 楼 qq_22722049 的回复:
[quote=引用 4 楼 qq423399099 的回复:] 调试了发现 某次循环中PsiDDiffj[aa][bb]为NULL,然后你 PsiDDiffj[aa][bb][cc]自然就崩溃了 (崩溃的时候a=66,b=28,VS下测试结果) 原因是你malloc的空间太大了,所以导致你malloc失败了。 你把numv换成小点的数字是OK的 楼主你自己算算看好了: 1.最内存的cc循环,每循环一次占用:102*8*3+102*4=2856字节 2.bb循环,每循环一次占用:(102*8*3+102*4)*100+102*4*4=287232字节 3.aa循环,每循环一次占用:((102*8*3+102*4)*100+102*4*4)*100+102*4*4=28724832字节=27.39M 所以a=66,b=28的时候,堆空间已经耗尽了 Linux虚拟地址空间内核占1GB,留给用户进程3GB,Windows是各占2GB,用户空间也是用户进程最大的堆申请数量了。但考虑到程序本身大小,动态库等因素,实际的堆申请数量是达不到最大值的,Linux小于3GB,Windows小于2GB。
求问一下那这种情况我要怎么编写程序会比较好呢?因为我要有一个4维的array,然后往每一个[aa][bb][cc][dd]里面填写值,之后还要调用里面的值。numv这里我设置的小了,后面运行的时候我需要numv = 1000.[/quote] 这么多数据程序不可能同时用到吧,动态分配的重要好处就是及时分配和回收,也就是需要的时候才分配,不需要了赶紧释放,这样才会有效利用内存,我建议你可以先把numv设小一点,让程序先跑起来,等你把整个程序弄懂了,知道程序先用哪些数据再用哪些数据了再改你的程序,也就是分步分配内存,而不是一下分配那么多,90%以上的程序Windows的内存系统肯定是可以满足的,如果不能满足那八成是你的程序有问题了,既然numv=100都不能满足,那numv=1000得用什么样的机器才能跑你的程序啊
paschen 版主 2016-07-07
  • 打赏
  • 举报
回复
出错时看断在哪,通过调用堆栈、变量窗口等来观察分析原因
qq_22722049 2016-07-06
  • 打赏
  • 举报
回复
引用 11 楼 qq423399099 的回复:
你一部分一部分处理不行? 处理完不再需要的数据就delete掉
因为我是编译一个动态规划问题,然后这个等于是我一期的code,我后面还有一部分code就是要调用里面的值
小灸舞 2016-07-06
  • 打赏
  • 举报
回复
你一部分一部分处理不行? 处理完不再需要的数据就delete掉
赵4老师 2016-07-06
  • 打赏
  • 举报
回复
在现实世界中,除时间和空间可能是无限的以外,其它任何事物都是有限的。
qq_22722049 2016-07-06
  • 打赏
  • 举报
回复
引用 6 楼 paschen 的回复:
楼主到底是在编译时还是运行时报错? 出错时定位到哪一行,具体分析一下原因
是运行(按F5)的时候
qq_22722049 2016-07-06
  • 打赏
  • 举报
回复
引用 4 楼 qq423399099 的回复:
调试了发现 某次循环中PsiDDiffj[aa][bb]为NULL,然后你 PsiDDiffj[aa][bb][cc]自然就崩溃了 (崩溃的时候a=66,b=28,VS下测试结果) 原因是你malloc的空间太大了,所以导致你malloc失败了。 你把numv换成小点的数字是OK的 楼主你自己算算看好了: 1.最内存的cc循环,每循环一次占用:102*8*3+102*4=2856字节 2.bb循环,每循环一次占用:(102*8*3+102*4)*100+102*4*4=287232字节 3.aa循环,每循环一次占用:((102*8*3+102*4)*100+102*4*4)*100+102*4*4=28724832字节=27.39M 所以a=66,b=28的时候,堆空间已经耗尽了 Linux虚拟地址空间内核占1GB,留给用户进程3GB,Windows是各占2GB,用户空间也是用户进程最大的堆申请数量了。但考虑到程序本身大小,动态库等因素,实际的堆申请数量是达不到最大值的,Linux小于3GB,Windows小于2GB。
求问一下那这种情况我要怎么编写程序会比较好呢?因为我要有一个4维的array,然后往每一个[aa][bb][cc][dd]里面填写值,之后还要调用里面的值。numv这里我设置的小了,后面运行的时候我需要numv = 1000.
qq_22722049 2016-07-06
  • 打赏
  • 举报
回复
不好意思,我是初学者。表达不是很好。应该是运行的时候显示Access violation writing location错误。
paschen 版主 2016-07-06
  • 打赏
  • 举报
回复
楼主到底是在编译时还是运行时报错? 出错时定位到哪一行,具体分析一下原因
paschen 版主 2016-07-06
  • 打赏
  • 举报
回复
楼主到底是在编译时还是运行时报错? 出错时定位到哪一行,具体分析一下原因
小灸舞 2016-07-06
  • 打赏
  • 举报
回复
调试了发现
某次循环中PsiDDiffj[aa][bb]为NULL,然后你 PsiDDiffj[aa][bb][cc]自然就崩溃了
(崩溃的时候a=66,b=28,VS下测试结果)
原因是你malloc的空间太大了,所以导致你malloc失败了。
你把numv换成小点的数字是OK的

楼主你自己算算看好了:
1.最内存的cc循环,每循环一次占用:102*8*3+102*4=2856字节
2.bb循环,每循环一次占用:(102*8*3+102*4)*100+102*4*4=287232字节
3.aa循环,每循环一次占用:((102*8*3+102*4)*100+102*4*4)*100+102*4*4=28724832字节=27.39M
所以a=66,b=28的时候,堆空间已经耗尽了
Linux虚拟地址空间内核占1GB,留给用户进程3GB,Windows是各占2GB,用户空间也是用户进程最大的堆申请数量了。但考虑到程序本身大小,动态库等因素,实际的堆申请数量是达不到最大值的,Linux小于3GB,Windows小于2GB。
wen_eric 2016-07-06
  • 打赏
  • 举报
回复
很可能是越界了
flying_music 2016-07-06
  • 打赏
  • 举报
回复
你电脑的配置的是多大内存啊,在我电脑上编译没错啊,就是运行时内存不够分配,把numv改小一点就可以了 Access violation writing location是访问内存错误,应该是运行时错误吧,怎么会出现在编译的时候呢
ri_aje 2016-07-06
  • 打赏
  • 举报
回复
改成用 vector 的
赵4老师 2016-07-06
  • 打赏
  • 举报
回复
用文件读写代替内存读写。 参考_fseeki64函数。
SOFTWARE LICENSE AGREEMENT This Software License Agreement (the “Agreement”) is entered into as of ___________________ (the “Effective Date”), by and between Broadcom Corporation, a California corporation with its principal office at 16215 Alton Parkway, Irvine, California 92619 (“Broadcom”), and __________________________, a _____________ corporation with a place of business at __________________________________________ (“Licensee”). The parties agree as follows: 1. DEFINITIONS. 1.1. “Authorized Location” shall mean the location set forth in the applicable Software Description Form, or if none is listed, then the address for Licensee set forth above. 1.2. “Authorized Licensee Product” means the specific product listed in the applicable Software Description Form, or if none is listed, then any system level product sold by Licensee, that incorporates the Broadcom Product and the Software and includes other hardware and software provided by Licensee. 1.3. “Broadcom Product” means any of the proprietary integrated circuit product(s) sold by Broadcom with which the Software was designed to be used, or their successors. 1.4. “Derivative Work” means any discrete modification to the Software made by Licensee pursuant to this agreement and any modified, altered, enhanced or adapted version of the Software, or derivative work thereof (as that term is defined under United States copyright law) based on the Software. 1.5. “End User Agreement” means a written, legally enforceable agreement that (i) stipulates that the Software is licensed, not sold, and that title to and ownership of the Software and any portion thereof remain with Broadcom or its licensors; (ii) disclaims all express and implied warranties on behalf of Broadcom, and exclude liability of Broadcom and its licensors for any special, indirect, exemplary, incidental or consequential damages; and (iii) prohibits the end user from (a) copying the Software, except as reasonably necessary for internal back-up purposes, (b) using and/or transferring the Software to any third party apart from a Authorized Licensee Product, (c) modifying the Software, (d) attempting to reverse engineer, decompile or disassemble any portion of the Software, or (e) exporting the Software or any underlying technology in contravention of any applicable U.S. or foreign export laws and regulations. 1.6. “Object Code” means those portions of the Software, if any, furnished to Licensee in object code or machine readable form, including, without limitation, any bit images or binary files for FPGAs. 1.7. “Software” shall mean that software which may be provided by Broadcom to Licensee from time to time and which is described in a Software Description Form executed by the parties that references this Agreement. 1.8. “Source Code” means those portions of the Software, if any, furnished to Licensee in source code or human readable form, including, without limitation, any C, C++, Java, Verilog, HDL or RTL code. 2. LICENSE GRANT; OWNERSHIP 2.1. License Grants. Subject to the terms and conditions of this Agreement, Broadcom hereby grants to Licensee, under all of Broadcom’s intellectual property rights in and to the Software, a non-exclusive, non-transferable, royalty-free license (i) to use, modify and create Derivative Works from the Source Code, and to use the Object Code, without right to sublicense, solely at the Authorized Location and (ii) to reproduce, distribute, in object code form only, copies of the Software or Derivative Works only as incorporated in Licensee’s manufacturing equipment used to produce Licensee Products for the sole purpose of debugging and testing. 2.2. Restriction on Modification. If and to the extent that the Software is designed to be compliant with any published communications standard (including, without limitation, DOCSIS, HomePNA, IEEE, and ITU standards), Licensee may not make any modifications to the Software that would cause the Software or the accompanying Broadcom Products to be incompatible with such standard. 2.3. Proprietary Notices. Licensee shall not remove, efface or obscure any copyright or trademark notices from the Software. Licensee shall include reproductions of the Broadcom copyright notice with each copy of the Software and any Derivative Work, except where such Software is embedded in a manner not readily accessible to the end user. Licensee acknowledges that any symbols, trademarks, BASLA v1.1 5/29/02 -1- tradenames, and service marks adopted by Broadcom to identify the Software belong to Broadcom and that Licensee shall have no rights therein. 2.4. Ownership. Broadcom shall retain all right, title and interest, including all intellectual property rights, in and to the Software. Licensee hereby covenants that it will not assert any claim that the Software or Derivative Works created by or for Broadcom infringe any intellectual property right owned or controlled by Licensee. Licensee shall own all right, title and interest in any Derivative Works to the Software made by Licensee, subject to Broadcom’s ownership of the underlying Software and the restrictions contained herein. 2.5. No Other Rights Granted. Apart from the license rights expressly set forth in this Agreement, Broadcom does not grant and Licensee does not receive any ownership right, title or interest nor any security interest or other interest in any intellectual property rights relating to the Software, nor in any copy of any part of the foregoing. Licensee shall not use, license, sell or otherwise distribute the Software or any Derivative Work except as provided in this Agreement, and shall not attempt to reverse engineer, decompile or disassemble any portion of the Object Code. 3. NO WARRANTY OR SUPPORT 3.1. No Warranty. THE SOFTWARE IS OFFERED “AS IS,” AND BROADCOM GRANTS AND LICENSEE RECEIVES NO WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR CONDUCT WITH LICENSEE, OR OTHERWISE. BROADCOM SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THE SOFTWARE OR ANY UPGRADES TO OR DOCUMENTATION FOR THE SOFTWARE. WITHOUT LIMITATION OF THE ABOVE, BROADCOM GRANTS NO WARRANTY THAT THE SOFTWARE IS ERROR-FREE OR WILL OPERATE WITHOUT INTERRUPTION, AND GRANTS NO WARRANTY REGARDING ITS USE OR THE RESULTS THEREFROM INCLUDING, WITHOUT LIMITATION, ITS CORRECTNESS, ACCURACY OR RELIABILITY. 3.2. No Support. Nothing in this agreement shall obligate Broadcom to provide any support for the Software. Broadcom may, but shall be under no obligation to, correct any defects in the Software and/or provide updates to licensees of the Software. Licensee shall make reasonable efforts to promptly report to Broadcom any defects it finds in the Software, as an aid to creating improved revisions of the Software. 3.3. End User Support. Licensee shall, at its own expense, be solely responsible for providing technical support and training to its customers for Authorized Licensee Products, and Broadcom shall have no obligation with respect thereto. Licensee shall be solely responsible for, and Broadcom shall have no obligation to honor, any warranties that Licensee provides to its customers or to end users with respect to the Software or Derivative Works. Licensee shall defend any claim against Broadcom arising in connection with any such warranties, express, implied, statutory, or otherwise, and shall pay any settlements or damages awarded against Broadcom that are based on any such warranties. 3.4. High Risk Applications. Licensee warrants that it will not use, or knowingly permit any of its direct or indirect customers, to use any Authorized Licensee Product, in any medical, nuclear, aviation, navigation, military, or other high risk application. Licensee agrees to indemnify, defend, and hold Broadcom harmless from any loss, liability, or damage of any kind that Broadcom incurs in connection with a breach of that warranty. 4. TERM AND TERMINATION 4.1. Term and Termination. This Agreement shall become effective on the date first set forth above and shall remain in effect perpetually unless terminated as provided below. If Licensee defaults in a material obligation under this Agreement, and if the default is curable, also fails to cure such default thirty (30) days after written notice of such default, Broadcom may immediately terminate and cancel this Agreement and the licenses granted hereunder upon written notice to Licensee. Licensee may terminate this Agreement at any time upon written notice to Broadcom and fulfillment of its obligations under Section 4.2 herein. 4.2. Effect Of Termination. Upon any termination of this Agreement, the rights and licenses granted to Licensee under this Agreement shall immediately terminate; provided, however, that sublicenses of the Software or Derivative Works in object code format, to the extent validly granted to end users pursuant to Section 2.1(ii) prior to termination of this Agreement, shall survive such termination subject to compliance BASLA v1.1 5/29/02 -2- with the obligations set forth herein. Upon termination, Licensee shall ship to Broadcom, within thirty (30) days, all tangible items in its possession or control which are proprietary to Broadcom; and Licensee shall destroy or return to Broadcom, at Broadcom’s option, all copies of the Software and Derivative Works (including, without limitation, Source Code) in its possession or control. 4.3. Survival. The provisions of Sections 1, 2.1, 2.2, 2.3, 2.4, 2.5, 3, 4, 5, 6, and 7 shall survive the termination of this Agreement. 5. CONFIDENTIALITY 5.1. Existing NDA (if Applicable). If Broadcom and Licensee already have put in place a non-disclosure agreement that would protect communications made under this Agreement (the “NDA”), then all such communications shall be subject to the terms and conditions of such NDA, which the parties acknowledge is in full force and effect. The parties agree that the Software and any accompanying documentation will be considered Confidential Information under the NDA. In the event of a conflict between the terms of this Agreement and the terms of the NDA, the terms of this Agreement will prevail. 5.2. Obligations if No NDA Exists. If no NDA exists, then the following terms shall apply: Licensee acknowledges and agrees that the Software, any documentation relating to the Software, and any other information (if such other information is identified as confidential or should be recognized as confidential under the circumstances) provided to Licensee by Broadcom hereunder (collectively, “Confidential Information”) constitute the confidential and proprietary information of Broadcom, and that Licensee’s protection thereof is an essential condition to Licensee’s use and possession of the Software. Licensee shall retain all Confidential Information in strict confidence and not disclose it to any third party or use it in any way except as permitted by this Agreement without Broadcom’s express written consent. Licensee will exercise at least the same amount of diligence in preserving the secrecy of the Confidential Information as it uses in preserving the secrecy of its own most valuable confidential information, but in no event less than reasonable diligence. The prohibitions contained in this Section 5.2 preclude dissemination of Confidential Information to Licensee’s subsidiaries, affiliates, contractors or subcontractors, except in the event of a permitted assignment pursuant to Section 7.1. Information shall not be considered Confidential Information if and to the extent that it: (i) was in the public domain at the time it was disclosed or has entered the public domain through no fault of Licensee; (ii) was known to Licensee, without restriction, at the time of disclosure as proven by the files of Licensee in existence at the time of disclosure; or (iii) becomes known to Licensee, without restriction, from a source other than Broadcom without breach of this Agreement by Licensee and otherwise not in violation of Broadcom’s rights. 5.3. Source Code Protection. Licensee shall not under any circumstances copy, duplicate or otherwise reproduce the Source Code in any manner except as provided herein. Licensee is granted the right to make one (1) archival or backup copy of the Source Code, which shall be marked as an archival copy and as the confidential and proprietary property of Broadcom to which access is restricted. Licensee agrees to inform all employees and contractors who are given access by Licensee to the Software, including the Source Code, the Object Code, or any accompanying documentation, that such materials are confidential and trade secrets of Broadcom licensed to Licensee as such. 6. LIMITATION OF LIABILITY EXCEPT FOR A BREACH BY LICENSEE OF SECTION 2 (LICENSE GRANT; OWNERSHIP) OR A BREACH BY EITHER PARTY OF SECTION 5 (CONFIDENTIALITY), IN NO EVENT SHALL LICENSEE, BROADCOM OR ANY OF BROADCOM’S LICENSORS HAVE ANY LIABILITY FOR ANY INDIRECT, INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER FOR BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE) OR OTHERWISE, ARISING OUT OF THIS AGREEMENT, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS, REVENUE, OR DATA, EVEN IF SUCH PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF ANY LIMITED REMEDY. 7. MISCELLANEOUS 7.1. Assignment. This Agreement shall be binding upon and inure to the benefit of the parties and their respective successors and assigns, provided, however that Licensee may not assign this Agreement or any rights or obligation hereunder, directly or indirectly, by operation of law or otherwise, without the prior BASLA v1.1 5/29/02 -3- written consent of Broadcom, and any such attempted assignment shall be void. Notwithstanding the foregoing, Licensee may assign this Agreement to a successor to all or substantially all of its business or assets that is not a competitor of Broadcom. 7.2. Notices. All notices between the parties shall be in writing and shall be deemed to have been given if personally delivered or sent by certified mail (return receipt requested), or telecopy, to the other party’s legal department at the address set forth in this Agreement, or such other address as is provided by notice as set forth herein. Notices shall be deemed effective upon receipt if personally delivered, three (3) business days after it was sent if by certified mail, or one (1) business day after it was sent if by telecopier. 7.3. Governing Law; Venue. This Agreement shall be governed by the laws of California without regard to any conflict-of-laws rules, and the United Nations Convention on Contracts for the International Sale of Goods is hereby excluded. The sole jurisdiction and venue for actions related to the subject matter hereof shall be the state and federal courts located in the County of Orange, California, and both parties hereby consent to such jurisdiction and venue. 7.4. Severability. All terms and provisions of this Agreement shall, if possible, be construed in a manner which makes them valid, but in the event any term or provision of this Agreement is found by a court of competent jurisdiction to be illegal or unenforceable, the validity or enforceability of the remainder of this Agreement shall not be affected if the illegal or unenforceable provision does not materially affect the intent of this Agreement. If the illegal or unenforceable provision materially affects the intent of the parties to this Agreement, this Agreement shall become terminated. 7.5. Equitable Relief. Licensee hereby acknowledges that its breach of this Agreement would cause irreparable harm and significant injury to Broadcom that may be difficult to ascertain and that a remedy at law would be inadequate. Accordingly, Licensee agrees that Broadcom shall have the right to seek and obtain immediate injunctive relief to enforce obligations under the Agreement in addition to any other rights and remedies it may have. 7.6. Export Regulations. Licensee agrees and warrants that it shall comply, at its own expense, with the U.S. Foreign Corrupt Practices Act and all export laws, restrictions, national security controls and regulations of the United States and any applicable foreign agency or authority. Licensee shall not export or re-export, or authorize the export or re-export of the Software or any other product, technology, or information that Licensee obtains or learns hereunder, or any copy or direct product thereof, in violation of any of such laws, restrictions, or regulations or without any license or approval required thereunder. Any and all obligations of Broadcom to provide Software or any media in which the Software is contained shall be subject in all respects to such laws, restrictions, and regulations. 7.7. Waiver. The waiver of, or failure to enforce, any breach or default hereunder shall not constitute the waiver of any other or subsequent breach or default. 7.8. Entire Agreement. This Agreement, along with any associated Software Description Forms, sets forth the entire Agreement between the parties and supersedes any and all prior proposals, agreements and representations between them, whether written or oral. This Agreement may be changed only by mutual agreement of the parties in writing. In the event of a conflict between the terms of this Agreement and the terms of a Software Description Form, the term of the Software Description Form will prevail. IN WITNESS WHEREOF, the parties hereto have caused this Agreement to be duly executed as of the Effective Date. BROADCOM CORPORATION LICENSEE By: By: Name: Name: Title: Title: BASLA v1.1 5/29/02 -4- SOFTWARE LICENSE AGREEMENT: SOFTWARE DESCRIPTION FORM Referenced Agreement: Licensee: Date: With respect to the Software identified below, the terms and conditions of the referenced Software License Agreement, as modified by any terms and conditions identified below, will apply: Software Being Licensed: BlueTool (Source and Object Code) Authorized Licensee Product Authorized Location: Additional Restrictions on Third Party Software: This Software Description Form and the referenced Software License Agreement are the complete and exclusive Agreement regarding the parties’ rights and obligations with respect to the Software hereunder. IN WITNESS WHEREOF, the parties hereto have caused this Software Description Form to be duly executed as of the later of the dates set forth below. BROADCOM CORPORATION (Licensee Name) By: By: Name: Name: Title: Title: Date: Date: BASLA v1.1 5/29/02 -5-
View Assessment Result: Multiple-Choice Quiz 2 Your performance was as follows: 1. The degree of a table is the number of _____ in the table. (a) keys (b) columns (c) rows (d) foreign keys Correct answer is (b) Your score on this question is: 10.00 Feedback: (b) -------------------------------------------------------------------------------- 2. The arity of a table is the number of _____ in the table. (a) keys (b) columns (c) foreign keys (d) rows Correct answer is (b) Your score on this question is: 10.00 Feedback: (b) -------------------------------------------------------------------------------- 3. What information is necessary when specifying the structure of a table? (a) the name of the table and the amount of storage space to be allocated to the table (b) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have (c) the name of the table and the names of the table's attributes (d) the name of the table, the names of the table's attributes, the data types of attributes, and the formats of attributes Correct answer is (d) Your score on this question is: 10.00 Feedback: (d) -------------------------------------------------------------------------------- 4. The foreign key in a table T1 _____ the same _____ as the corresponding primary key in table T2. must have, name need not have, name must have, domain (a) I, II, and III (b) I and II (c) I and III (d) II and III Correct answer is (d) Your score on this question is: 10.00 Feedback: (d) -------------------------------------------------------------------------------- 5. Which of the following SQL statements can be used to add a row to a table? (a) CREATE (b) INSERT (c) APPEND (d) ADD Correct answer is (b) Your score on this question is: 10.00 Feedback: (b) -------------------------------------------------------------------------------- 6. A difference operation can be applied to tables that (a) are union compatible (b) have the same column names (c) have the same name (d) are the same size Correct answer is (a) Your score on this question is: 10.00 Feedback: (a) -------------------------------------------------------------------------------- 7. Which of the following SQL statements can be used to create a relational table? (a) INSERT (b) ADD (c) CREATE (d) APPEND Correct answer is (c) Your score on this question is: 10.00 Feedback: (c) -------------------------------------------------------------------------------- 8. For two tables to be union compatible, the tables should be the same with respect to which of the following? (a) keys (b) cardinality (c) name (d) degree Correct answer is (d) Your score on this question is: 0.00 Feedback: (b) -------------------------------------------------------------------------------- 9. A deletion operation will _____ if the deletion leads to the violation of a referential integrity constraint. (a) fail (b) succeed with warning (c) succeed without warning (d) crash the system Correct answer is (a) Your score on this question is: 10.00 Feedback: (a) -------------------------------------------------------------------------------- 10. With Query By Example, a user enters a query by (a) filling in skeleton tables of the database with examples of what is to be retrieved (b) placing SQL keywords, such as select, under the column names they want to retrieve (c) typing a syntactically correct SQL query that uses column and table names similar to the correct column and table names in a database (d) writing an English description of the data that the user needs Correct answer is (a) Your score on this question is: 10.00 Feedback: See section 1.2.3 in the course notes. (a) -------------------------------------------------------------------------------- Go to top of assessment. Total score: 90.00 ? Copyright 2008 iCarnegie, Inc. All rights reserved. 1. In the Entity-Relationship model, the degree of a relationship specifies which of the following? (a) The cardinality ratio of the relationship (b) The number of integrity constraints required to implement the relationship (c) The number of attributes that characterize the relationship (d) The number of entities that participate in the relationship Correct answer is (d) 2. In an ER model, which of the following is true about a component attribute? (a) A component attribute is always atomic. (b) Component attributes must always be combined by an aggregation operation. (c) A component attribute can be a composite attribute. (d) A component attribute always contains other components. Correct answer is (c) 3. In the Entity-Relationship model, properties that characterize entities and relationships are modeled as (a) attributes (b) participation constraints (c) entity types (d) weak entities Correct answer is (a) 4. What is an identifying owner in an ER model? (a) The entity upon which a weak entity's existence depends (b) The relationship that identifies a weak entity's owner (c) The entity upon which a strong entity's existence depends (d) The relationship that identifies a strong entity's owner Correct answer is (a) 5. In an ER model, the cardinality ratio of a relationship type is (a) the number of instances of relationships of that relationship type (b) the number of entity types involved in that relationship type (c) the number of relationships of that relationship type in which an entity can participate (d) the minimum number of entities that can participate in that relationship type Correct answer is (c) 6. Which of the following is true about storage for derived attributes? (a) Derived attributes must not be stored. (b) Derived attributes are usually stored because storage improves retrieval performance. (c) Derived attributes must be stored. (d) Derived attributes are usually not stored because they can be computed. Correct answer is (d) 7. In an ER model, what is a recursive relationship type? (a) A never-ending type of relationship (b) The type of relationship that does not belong anywhere (c) The type of relationship between entities of one entity type (d) The relationship type where the related entities are one and the same Correct answer is (c) 8. In EER modeling, generalization is the process of generating (a) superclasses out of subclasses (b) subclasses out of superclasses (c) entities out of attributes (d) attributes out of entities Correct answer is (a) 9. When mapping from an ER model to a relational model, a strong entity is mapped into a (a) table (b) row (c) column (d) key Correct answer is (a) 10. Which of the following is true about attributes in a relational model? Attributes can be multi-valued. Attributes can be composite. (a) Both I and II (b) II only (c) Neither I nor II (d) I only Correct answer is (c) 1. In an ER model, what is a recursive relationship type? (a) The relationship type where the related entities are one and the same (b) The type of relationship that does not belong anywhere (c) The type of relationship between entities of one entity type (d) A never-ending type of relationship Correct answer is (c) 2. In an ER model, the cardinality ratio of a relationship type is (a) the number of relationships of that relationship type in which an entity can participate (b) the minimum number of entities that can participate in that relationship type (c) the number of entity types involved in that relationship type (d) the number of instances of relationships of that relationship type Correct answer is (a) 3. In the Entity-Relationship model, a derived attribute is one (a) that is composed of multiple atomic attributes (b) that characterizes a relationship instead of an entity (c) that may have multiple values simultaneously (d) whose value can be computed from the values of other attributes Correct answer is (d) 4. In the Entity-Relationship model, properties that characterize entities and relationships are modeled as (a) entity types (b) weak entities (c) attributes (d) participation constraints Correct answer is (c) 5. Which of the following is true about storage for derived attributes? (a) Derived attributes must be stored. (b) Derived attributes are usually stored because storage improves retrieval performance. (c) Derived attributes must not be stored. (d) Derived attributes are usually not stored because they can be computed. Correct answer is (d) 6. What is an identifying owner in an ER model? (a) The relationship that identifies a weak entity's owner (b) The relationship that identifies a strong entity's owner (c) The entity upon which a strong entity's existence depends (d) The entity upon which a weak entity's existence depends Correct answer is (d) 7. In an ER model, which of the following is true about a component attribute? (a) A component attribute always contains other components. (b) A component attribute can be a composite attribute. (c) A component attribute is always atomic. (d) Component attributes must always be combined by an aggregation operation. Correct answer is (b) 8. In EER modeling, generalization is the process of generating (a) attributes out of entities (b) superclasses out of subclasses (c) subclasses out of superclasses (d) entities out of attributes Correct answer is (b) 9. When mapping from an ER model to a relational model, a strong entity is mapped into a (a) key (b) row (c) column (d) table Correct answer is (d) 10. Which of the following is true about attributes in a relational model? Attributes can be multi-valued. Attributes can be composite. (a) I only (b) II only (c) Neither I nor II (d) Both I and II Correct answer is (c) 1. Through normalization, update anomalies (a) can be eliminated (b) is usually left unchanged (c) can be maximized (d) can be minimized but not eliminated Correct answer is (a) 2. Which of the following is a property (are properties) exhibited by good relational schemas? The use of null values in tuples The grouping of as many attributes as possible into one main table The elimination of data redundancy to avoid update anomalies (a) III only (b) None (c) I and II only (d) II and III only Correct answer is (a) 3. Which of the following statements concerning normal forms is true? (a) A relation that is in second normal form is also in first normal form. (b) The lower the normal form number, the better the schema design is. (c) Each normal form contains a state of independent properties, unrelated to other normal forms. (d) Schemas that are in second normal form are considered the best. Correct answer is (a) 4. Consider the following functional dependency. {A, B} -> {C} Regarding this dependency, which of the following statements is (are) true? The values of C are uniquely determined by the values of A. The values of A are uniquely determined by the values of C. (a) None (b) II only (c) I only (d) I and II Correct answer is (a) 5. Which of the following problems can be caused by data redundancy in a relational schema? Inefficient use of space Update anomalies and possible loss of data Inefficient use of processing time (a) I and II only (b) I and III only (c) I, II, and III (d) II only Correct answer is (c) 6. Consider a table with atomic attributes A, B, and C and the following functional dependencies. A -> B B -> C If the primary key of this table is attribute A, then this relation satisfies which of the following normal forms? First Second Third (a) None (b) I only (c) I, II and III (d) I and II only Correct answer is (d) 7. For a relation to be in 3NF, it should not contain _____ attribute that is transitively dependent on _____. (a) a non-primary key, a foreign key (b) a primary key, a non-primary key (c) a primary key, a foreign key (d) a non-primary key, the primary key Correct answer is (d) 8. The FD X -> Y is a full dependency in a relation R, if there is _____ attribute A that can be _____ X and the dependency still holds. (a) no, added to (b) no, removed from (c) at least one, removed from (d) at least one, added to Correct answer is (b) 9. For a relation to be in 2NF, _____ attribute must be fully functionally dependent on _____. (a) every non-primary-key, the primary key (b) every alternate key, the primary key (c) every non-key, every key (d) every non-key, at least one key Correct answer is (a) 10. The FD X -> Y is a partial dependency in a relation R, if there is _____ attribute A that can be _____ X and the dependency still holds. (a) at least one, removed from (b) at least one, added to (c) no, added to (d) no, removed from Correct answer is (a) 1. Through normalization, update anomalies (a) can be eliminated (b) is usually left unchanged (c) can be minimized but not eliminated (d) can be maximized Correct answer is (a) 2. Consider the following functional dependency. {A, B} -> {C} Regarding this dependency, which of the following statements is (are) true? The values of C are uniquely determined by the values of A. The values of A are uniquely determined by the values of C. (a) None (b) I and II (c) I only (d) II only Correct answer is (a) 3. Which of the following is a property (are properties) exhibited by good relational schemas? The use of null values in tuples The grouping of as many attributes as possible into one main table The elimination of data redundancy to avoid update anomalies (a) III only (b) None (c) II and III only (d) I and II only Correct answer is (a) 4. Through normalization, data redundancy (a) can be eliminated (b) can be maximized (c) can be minimized but not eliminated (d) are usually left unchanged Correct answer is (a) 5. Which of the following statements concerning normal forms is true? (a) A relation that is in second normal form is also in first normal form. (b) Each normal form contains a state of independent properties, unrelated to other normal forms. (c) Schemas that are in second normal form are considered the best. (d) The lower the normal form number, the better the schema design is. Correct answer is (a) 6. For a relation to be in 3NF, it should not contain _____ attribute that is transitively dependent on _____. (a) a primary key, a foreign key (b) a primary key, a non-primary key (c) a non-primary key, a foreign key (d) a non-primary key, the primary key Correct answer is (d) 7. The FD X -> Y is a full dependency in a relation R, if there is _____ attribute A that can be _____ X and the dependency still holds. (a) no, removed from (b) at least one, removed from (c) at least one, added to (d) no, added to Correct answer is (a) 8. Consider a table with atomic attributes A, B, and C and the following functional dependencies. A -> B B -> C If the primary key of this table is attribute A, then this relation satisfies which of the following normal forms? First Second Third (a) I, II and III (b) None (c) I and II only (d) I only Correct answer is (c) 9. For a relation to be in 2NF, _____ attribute must be fully functionally dependent on _____. (a) every alternate key, the primary key (b) every non-key, at least one key (c) every non-key, every key (d) every non-primary-key, the primary key Correct answer is (d) 10. The FD X -> Y is a partial dependency in a relation R, if there is _____ attribute A that can be _____ X and the dependency still holds. (a) no, added to (b) no, removed from (c) at least one, added to (d) at least one, removed from Correct answer is (d) 1. What is an identifying owner in an ER model? (a) The entity upon which a weak entity's existence depends (b) The relationship that identifies a weak entity's owner (c) The relationship that identifies a strong entity's owner (d) The entity upon which a strong entity's existence depends Correct answer is (a) 2. In an ER model, the cardinality ratio of a relationship type is (a) the minimum number of entities that can participate in that relationship type (b) the number of instances of relationships of that relationship type (c) the number of entity types involved in that relationship type (d) the number of relationships of that relationship type in which an entity can participate Correct answer is (d) 3. In the Entity-Relationship model, properties that characterize entities and relationships are modeled as (a) entity types (b) participation constraints (c) weak entities (d) attributes Correct answer is (d) 4. In an ER model, what is a recursive relationship type? (a) A never-ending type of relationship (b) The relationship type where the related entities are one and the same (c) The type of relationship between entities of one entity type (d) The type of relationship that does not belong anywhere Correct answer is (c) 5. In the Entity-Relationship model, a derived attribute is one (a) that characterizes a relationship instead of an entity (b) that may have multiple values simultaneously (c) whose value can be computed from the values of other attributes (d) that is composed of multiple atomic attributes Correct answer is (c) 6. In the Entity-Relationship model, the degree of a relationship specifies which of the following? (a) The number of attributes that characterize the relationship (b) The number of entities that participate in the relationship (c) The cardinality ratio of the relationship (d) The number of integrity constraints required to implement the relationship Correct answer is (b) 7. Which of the following is true about storage for derived attributes? (a) Derived attributes are usually not stored because they can be computed. (b) Derived attributes are usually stored because storage improves retrieval performance. (c) Derived attributes must be stored. (d) Derived attributes must not be stored. Correct answer is (a) 8. In EER modeling, generalization is the process of generating (a) superclasses out of subclasses (b) entities out of attributes (c) subclasses out of superclasses (d) attributes out of entities Correct answer is (a) 9. When mapping from an ER model to a relational model, a strong entity is mapped into a (a) key (b) table (c) row (d) column Correct answer is (b) 10. Which of the following is true about attributes in a relational model? Attributes can be multi-valued. Attributes can be composite. (a) II only (b) I only (c) Both I and II (d) Neither I nor II Correct answer is (d) 1. Which of the following is true about storage for derived attributes? (a) Derived attributes are usually stored because storage improves retrieval performance. (b) Derived attributes must be stored. (c) Derived attributes are usually not stored because they can be computed. (d) Derived attributes must not be stored. Correct answer is (c) 2. In an ER model, the cardinality ratio of a relationship type is (a) the minimum number of entities that can participate in that relationship type (b) the number of entity types involved in that relationship type (c) the number of relationships of that relationship type in which an entity can participate (d) the number of instances of relationships of that relationship type Correct answer is (c) 3. In the Entity-Relationship model, the degree of a relationship specifies which of the following? (a) The number of attributes that characterize the relationship (b) The number of integrity constraints required to implement the relationship (c) The cardinality ratio of the relationship (d) The number of entities that participate in the relationship Correct answer is (d) 4. In the Entity-Relationship model, properties that characterize entities and relationships are modeled as (a) weak entities (b) participation constraints (c) attributes (d) entity types Correct answer is (c) Your score on this question is: 0.00 5. A weak entity type implies a (a) weak relationship type (b) relationship with total participation constraint (c) strong relationship type (d) relationship with partial participation constraint Correct answer is (b) 6. In an ER model, which of the following is true about a component attribute? (a) A component attribute can be a composite attribute. (b) Component attributes must always be combined by an aggregation operation. (c) A component attribute always contains other components. (d) A component attribute is always atomic. Correct answer is (a) 7. In the Entity-Relationship model, a derived attribute is one (a) that characterizes a relationship instead of an entity (b) that is composed of multiple atomic attributes (c) whose value can be computed from the values of other attributes (d) that may have multiple values simultaneously Correct answer is (c) 1. Through normalization, update anomalies (a) is usually left unchanged (b) can be minimized but not eliminated (c) can be maximized (d) can be eliminated Correct answer is (d) 2. Which of the following problems can be caused by data redundancy in a relational schema? Inefficient use of space Update anomalies and possible loss of data Inefficient use of processing time (a) I and II only (b) I and III only (c) II only (d) I, II, and III Correct answer is (d) 3. Consider the following functional dependency. {A, B} -> {C} Regarding this dependency, which of the following statements is (are) true? The values of C are uniquely determined by the values of A. The values of A are uniquely determined by the values of C. (a) I only (b) I and II (c) II only (d) None Correct answer is (d) 4. Which of the following is a property (are properties) exhibited by good relational schemas? The use of null values in tuples The grouping of as many attributes as possible into one main table The elimination of data redundancy to avoid update anomalies (a) III only (b) II and III only (c) I and II only (d) None Correct answer is (a) 5. Which of the following statements concerning normal forms is true? (a) Schemas that are in second normal form are considered the best. (b) Each normal form contains a state of independent properties, unrelated to other normal forms. (c) A relation that is in second normal form is also in first normal form. (d) The lower the normal form number, the better the schema design is. Correct answer is (c) 6. The FD X -> Y is a partial dependency in a relation R, if there is _____ attribute A that can be _____ X and the dependency still holds. (a) at least one, added to (b) at least one, removed from (c) no, removed from (d) no, added to Correct answer is (b) 7. For a relation to be in 2NF, _____ attribute must be fully functionally dependent on _____. (a) every non-primary-key, the primary key (b) every non-key, at least one key (c) every non-key, every key (d) every alternate key, the primary key Correct answer is (a) 8. Consider a table with atomic attributes A, B, and C and the following functional dependencies. A -> B B -> C If the primary key of this table is attribute A, then this relation satisfies which of the following normal forms? First Second Third (a) I only (b) None (c) I and II only (d) I, II and III Correct answer is (c) 9. The FD X -> Y is a full dependency in a relation R, if there is _____ attribute A that can be _____ X and the dependency still holds. (a) no, removed from (b) at least one, removed from (c) at least one, added to (d) no, added to Correct answer is (a) 10. For a relation to be in 3NF, it should not contain _____ attribute that is transitively dependent on _____. (a) a primary key, a foreign key (b) a non-primary key, a foreign key (c) a non-primary key, the primary key (d) a primary key, a non-primary key Correct answer is (c) 1. Which of the following statements concerning normal forms is true? (a) The lower the normal form number, the better the schema design is. (b) A relation that is in second normal form is also in first normal form. (c) Schemas that are in second normal form are considered the best. (d) Each normal form contains a state of independent properties, unrelated to other normal forms. Correct answer is (b) 2. Consider the following functional dependency. {A, B} -> {C} Regarding this dependency, which of the following statements is (are) true? The values of C are uniquely determined by the values of A. The values of A are uniquely determined by the values of C. (a) I only (b) II only (c) I and II (d) None Correct answer is (d) 3. Which of the following problems can be caused by data redundancy in a relational schema? Inefficient use of space Update anomalies and possible loss of data Inefficient use of processing time (a) I, II, and III (b) I and II only (c) I and III only (d) II only Correct answer is (a) Y 4. Through normalization, update anomalies (a) can be eliminated (b) can be maximized (c) is usually left unchanged (d) can be minimized but not eliminated Correct answer is (a) 5. Which of the following is a property (are properties) exhibited by good relational schemas? The use of null values in tuples The grouping of as many attributes as possible into one main table The elimination of data redundancy to avoid update anomalies (a) I and II only (b) III only (c) None (d) II and III only Correct answer is (b) 6. Consider a table with atomic attributes A, B, and C and the following functional dependencies. A -> B B -> C If the primary key of this table is attribute A, then this relation satisfies which of the following normal forms? First Second Third (a) I and II only (b) I only (c) I, II and III (d) None Correct answer is (a) 7. For a relation to be in 3NF, it should not contain _____ attribute that is transitively dependent on _____. (a) a non-primary key, a foreign key (b) a primary key, a foreign key (c) a primary key, a non-primary key (d) a non-primary key, the primary key Correct answer is (d) 8. The FD X -> Y is a partial dependency in a relation R, if there is _____ attribute A that can be _____ X and the dependency still holds. (a) at least one, added to (b) no, removed from (c) no, added to (d) at least one, removed from Correct answer is (d) 9. For a relation to be in 2NF, _____ attribute must be fully functionally dependent on _____. (a) every non-primary-key, the primary key (b) every alternate key, the primary key (c) every non-key, every key (d) every non-key, at least one key Correct answer is (a) 10. The FD X -> Y is a full dependency in a relation R, if there is _____ attribute A that can be _____ X and the dependency still holds. (a) no, added to (b) at least one, removed from (c) at least one, added to (d) no, removed from Correct answer is (d) 1. In an ER model, which of the following is true about a composite attribute? (a) A composite attribute can have a method attached to it. (b) A composite attribute cannot be broken into more basic attributes. (c) A composite attribute can be broken into more basic attributes. (d) A composite attribute can only be designed by users with special privileges. Correct answer is (c) 2. The term physical data independence refers to the ability to change (a) the physical layout of the data without changing the external schemas, the conceptual schemas, or the application programs (b) the data without physically relocating the tables (c) the conceptual schema without changing the application programs (d) the application programs without changing the conceptual schema Correct answer is (a) 3. What attributes does a subclass have? (a) None of the attributes of its superclass (b) All the attributes of its superclass, and possibly more (c) Just the attributes from the superclass (d) A subset of the attributes of its superclass Correct answer is (b) 4. If X -> Y, which of the following would make Y fully dependent on X? (a) Y is a single attribute (b) X is a single attribute (c) X consists of multiple attributes (d) Y consists of multiple attributes Correct answer is (b) 5. In an ER model, what is the degree of a relationship type? (a) The validity of the relationship type (b) The strength of the relationship type (c) The number of entity types participating in the relationship type (d) The number of instances of the relationship type Correct answer is (c) 6. Database design typically consists of which of the following phases? Conceptual design Logical design Physical design (a) II only (b) I, II, and III (c) II and III only (d) I only Correct answer is (b) 7. A relational schema is in first normal form, if the domain of all of its (a) primary keys are not multi-valued (b) primary keys and alternate keys are not multi-valued (c) primary keys are not composite (d) attributes can take on only atomic values Correct answer is (d) 8. In an ER model, a derived attribute is one whose values (a) have been derived at some time in the past (b) can be derived from the values of some other attributes (c) can be derived from the system tables (d) can be derived from another table Correct answer is (b) 9. Y is transitively dependent on X, if (a) X -> Y and A -> Y (b) X -> A, B and A -> Y (c) X -> Y and Y -> A (d) X -> A, B and Y -> A, B Correct answer is (b) 10. Relationships in an ER model are primarily translated to which of the following in a relational model? (a) relationships (b) primary keys and foreign keys (c) three-way tables (d) dummy relationship tables Correct answer is (b) View Assessment Result With Query By Example, a user enters a query by (a) filling in skeleton tables of the database with examples of what is to be retrieved (b) placing SQL keywords, such as select, under the column names they want to retrieve (c) writing an English description of the data that the user needs (d) typing a syntactically correct SQL query that uses column and table names similar to the correct column and table names in a database F Your performance was as follows: You took 2 minutes on this assessment from Tue Mar 17 05:22:13 UTC+0800 2009 to Tue Mar 17 05:24:13 UTC+0800 2009. Total score: 100.00 1. An E-Commerce system consists of the following components. Which of the same components must be included in a database management system? 1 The data, such as information about the goods available for sale, customers, orders placed, shipping information, etc. 2 A collection of programs must be included that control the data, such as programs to create, maintain, and manipulate the data. These programs can be easily used to create, maintain, and manipulate data in other domains, such as in a library information system. 3 A collection of programs that operate on the data, but are specific to the E-commerce system. These programs enable users to browse through the store-items, place orders, track shipping, etc. (a) II only (b) I, II, and III (c) I only (d) II and III only Correct answer is (a) Your score on this question is: 14.29 Feedback: A DBMS refers to just the set of general-purpose programs to control data. (a) 2. An E-Commerce system consists of the following components. Which of these same components will constitute a database system? 4 The data, such as information about the goods available for sale, customers, orders placed, shipping information, etc. 5 A collection of programs that control the data, such as programs to create, maintain, and manipulate the data constitutes a database system. These programs can be easily used to create, maintain, and manipulate data in other domains such as in a library information system. 6 A collection of programs that operate on the data, but are specific to the E-commerce system, constitutes a database system. These programs enable users to browse through the store-items, place orders, track shipping, etc. (a) I only (b) I, II, and III (c) I and II only (d) II only Correct answer is (b) Your score on this question is: 14.29 Feedback: A database system includes the data, the DBMS, and the application-specific programs that operate on that data. (b) 3. An E-Commerce system consists of the following components. Which of these same components must be included in a database? 7 The data, such as information about the goods available for sale, customers, orders placed, shipping information, etc. 8 A database must include a collection of programs that control the data, such as programs to create, maintain, and manipulate the data. These programs can be easily used to create, maintain, and manipulate data in other domains. 9 A database must include a collection of programs that operate on the data, but are specific to the E-commerce system. These programs enable users to browse through the store-items, place orders, track shipping, etc. (a) I and II only (b) I only (c) II only (d) I, II, and III Correct answer is (b) Your score on this question is: 14.29 Feedback: Database refers to just the data (b) 4. An E-Commerce database contains data about customers, products, orders, system response times, etc. Which of the following can be specified as integrity constraints in an E-Commerce database system? 10 No two products can have the same product ID. 11 The DBMS response time for all Web requests should be at most 2 seconds. 12 A customer order cannot have more than one shipping address. (a) I and III only (b) I and II only (c) I only (d) I, II, and III Correct answer is (a) Your score on this question is: 14.29 Feedback: The constraints I, II and III specify the application semantics of the data captured in the E-Commerce database. Constraint II, although it seems contrary to common sense, is not something that can be prohibited by the DBMS because the DBMS is general purpose. The response time of the DBMS cannot be enforced by the DBMS. It depends on factors such the processor speed, memory available, etc. (a) 5. In a database system, whose responsibility is it to provide data consistency? (a) the user's (b) the application programmer's (c) the DBMS's (d) the database administrator's Correct answer is (c) Your score on this question is: 14.29 Feedback: (c) 6. A database is needed for which of the following application scenarios? 13 A video store that needs to keep track of data about members, about videos carried by the store, about videos rented by members, as well as data concerning borrow-date, return-date, and payment information. 14 In the human resources department of a company, information about employees, their titles, their salaries and sick days, and about vacation days taken by each employee. 15 A computer-simulated video game which needs to calculate and display, the physical (x, y) location of each actor in the game, the speed with which they are moving at the current instant, the direction in which they are moving, the action they are performing, the angle at which the game-player is viewing the scene. (a) I only (b) I, II, and III (c) I and II only (d) I and III only Correct answer is (c) Your score on this question is: 14.29 Feedback: (c) 7. The physical storage structure will be _____ to the application programmer in a database approach, and will be _____ to the application programmer in a file system approach. (a) hidden, hidden (b) hidden, visible (c) visible, visible (d) visible, hidden Correct answer is (b) Your score on this question is: 14.29 Feedback: The layer of abstraction offered by a DBMS hides the physical storage structure from the application programmer. (b) Go to top of assessment. Total score: 100.00 Your performance was as follows: You took 3 minutes on this assessment from Tue Mar 17 04:27:27 UTC+0800 2009 to Tue Mar 17 04:30:02 UTC+0800 2009. Total score: 85.71 1. An E-Commerce system consists of the following components. Which of these same components must be included in a database? 1 The data, such as information about the goods available for sale, customers, orders placed, shipping information, etc. 2 A database must include a collection of programs that control the data, such as programs to create, maintain, and manipulate the data. These programs can be easily used to create, maintain, and manipulate data in other domains. 3 A database must include a collection of programs that operate on the data, but are specific to the E-commerce system. These programs enable users to browse through the store-items, place orders, track shipping, etc. (a) II only (b) I and II only (c) I only (d) I, II, and III Correct answer is (c) Your score on this question is: 14.29 Feedback: Database refers to just the data (c) 2. In a database system, whose responsibility is it to provide data consistency? (a) the database administrator's (b) the user's (c) the application programmer's (d) the DBMS's Correct answer is (d) Your score on this question is: 14.29 Feedback: (d) 3. An E-Commerce system consists of the following components. Which of these same components will constitute a database system? 4 The data, such as information about the goods available for sale, customers, orders placed, shipping information, etc. 5 A collection of programs that control the data, such as programs to create, maintain, and manipulate the data constitutes a database system. These programs can be easily used to create, maintain, and manipulate data in other domains such as in a library information system. 6 A collection of programs that operate on the data, but are specific to the E-commerce system, constitutes a database system. These programs enable users to browse through the store-items, place orders, track shipping, etc. (a) I, II, and III (b) I only (c) I and II only (d) II only Correct answer is (a) Your score on this question is: 14.29 Feedback: A database system includes the data, the DBMS, and the application-specific programs that operate on that data. (a) 4. An E-Commerce system consists of the following components. Which of the same components must be included in a database management system? 7 The data, such as information about the goods available for sale, customers, orders placed, shipping information, etc. 8 A collection of programs must be included that control the data, such as programs to create, maintain, and manipulate the data. These programs can be easily used to create, maintain, and manipulate data in other domains, such as in a library information system. 9 A collection of programs that operate on the data, but are specific to the E-commerce system. These programs enable users to browse through the store-items, place orders, track shipping, etc. (a) I only (b) I, II, and III (c) II only (d) II and III only Correct answer is (c) Your score on this question is: 0.00 Feedback: A DBMS refers to just the set of general-purpose programs to control data. (d) 5. An E-Commerce database contains data about customers, products, orders, system response times, etc. Which of the following can be specified as integrity constraints in an E-Commerce database system? 10 No two products can have the same product ID. 11 The DBMS response time for all Web requests should be at most 2 seconds. 12 A customer order cannot have more than one shipping address. (a) I, II, and III (b) I only (c) I and II only (d) I and III only Correct answer is (d) Your score on this question is: 14.29 Feedback: The constraints I, II and III specify the application semantics of the data captured in the E-Commerce database. Constraint II, although it seems contrary to common sense, is not something that can be prohibited by the DBMS because the DBMS is general purpose. The response time of the DBMS cannot be enforced by the DBMS. It depends on factors such the processor speed, memory available, etc. (d) 6. A database is needed for which of the following application scenarios? 13 A video store that needs to keep track of data about members, about videos carried by the store, about videos rented by members, as well as data concerning borrow-date, return-date, and payment information. 14 In the human resources department of a company, information about employees, their titles, their salaries and sick days, and about vacation days taken by each employee. 15 A computer-simulated video game which needs to calculate and display, the physical (x, y) location of each actor in the game, the speed with which they are moving at the current instant, the direction in which they are moving, the action they are performing, the angle at which the game-player is viewing the scene. (a) I and II only (b) I only (c) I, II, and III (d) I and III only Correct answer is (a) Your score on this question is: 14.29 Feedback: (a) 7. The physical storage structure will be _____ to the application programmer in a database approach, and will be _____ to the application programmer in a file system approach. (a) visible, hidden (b) hidden, hidden (c) hidden, visible (d) visible, visible Correct answer is (c) Your score on this question is: 14.29 Feedback: The layer of abstraction offered by a DBMS hides the physical storage structure from the application programmer. (c) Go to top of assessment. Total score: 85.71 Total score: 42.86 1. An E-Commerce system consists of the following components. Which of these same components must be included in a database? 1 The data, such as information about the goods available for sale, customers, orders placed, shipping information, etc. 2 A database must include a collection of programs that control the data, such as programs to create, maintain, and manipulate the data. These programs can be easily used to create, maintain, and manipulate data in other domains. 3 A database must include a collection of programs that operate on the data, but are specific to the E-commerce system. These programs enable users to browse through the store-items, place orders, track shipping, etc. (a) I and II only (b) I only (c) II only (d) I, II, and III Correct answer is (b) Your score on this question is: 14.29 Feedback: Database refers to just the data (b) 2. In a database system, whose responsibility is it to provide data consistency? (a) the DBMS's (b) the user's (c) the application programmer's (d) the database administrator's Correct answer is (a) Your score on this question is: 0.00 Feedback: (d) 3. An E-Commerce system consists of the following components. Which of these same components will constitute a database system? 4 The data, such as information about the goods available for sale, customers, orders placed, shipping information, etc. 5 A collection of programs that control the data, such as programs to create, maintain, and manipulate the data constitutes a database system. These programs can be easily used to create, maintain, and manipulate data in other domains such as in a library information system. 6 A collection of programs that operate on the data, but are specific to the E-commerce system, constitutes a database system. These programs enable users to browse through the store-items, place orders, track shipping, etc. (a) II only (b) I and II only (c) I, II, and III (d) I only Correct answer is (c) Your score on this question is: 0.00 Feedback: A database system includes the data, the DBMS, and the application-specific programs that operate on that data. (a) 4. An E-Commerce system consists of the following components. Which of the same components must be included in a database management system? 7 The data, such as information about the goods available for sale, customers, orders placed, shipping information, etc. 8 A collection of programs must be included that control the data, such as programs to create, maintain, and manipulate the data. These programs can be easily used to create, maintain, and manipulate data in other domains, such as in a library information system. 9 A collection of programs that operate on the data, but are specific to the E-commerce system. These programs enable users to browse through the store-items, place orders, track shipping, etc. (a) I, II, and III (b) II only (c) I only (d) II and III only Correct answer is (b) Your score on this question is: 0.00 Feedback: A DBMS refers to just the set of general-purpose programs to control data. (d) 5. An E-Commerce database contains data about customers, products, orders, system response times, etc. Which of the following can be specified as integrity constraints in an E-Commerce database system? 10 No two products can have the same product ID. 11 The DBMS response time for all Web requests should be at most 2 seconds. 12 A customer order cannot have more than one shipping address. (a) I only (b) I and III only (c) I and II only (d) I, II, and III Correct answer is (b) Your score on this question is: 0.00 Feedback: The constraints I, II and III specify the application semantics of the data captured in the E-Commerce database. Constraint II, although it seems contrary to common sense, is not something that can be prohibited by the DBMS because the DBMS is general purpose. The response time of the DBMS cannot be enforced by the DBMS. It depends on factors such the processor speed, memory available, etc. (d) 6. A database is needed for which of the following application scenarios? 13 A video store that needs to keep track of data about members, about videos carried by the store, about videos rented by members, as well as data concerning borrow-date, return-date, and payment information. 14 In the human resources department of a company, information about employees, their titles, their salaries and sick days, and about vacation days taken by each employee. 15 A computer-simulated video game which needs to calculate and display, the physical (x, y) location of each actor in the game, the speed with which they are moving at the current instant, the direction in which they are moving, the action they are performing, the angle at which the game-player is viewing the scene. (a) I only (b) I and II only (c) I, II, and III (d) I and III only Correct answer is (b) Your score on this question is: 14.29 Feedback: (b) 7. The physical storage structure will be _____ to the application programmer in a database approach, and will be _____ to the application programmer in a file system approach. (a) visible, visible (b) visible, hidden (c) hidden, visible (d) hidden, hidden Correct answer is (c) Your score on this question is: 14.29 Feedback: The layer of abstraction offered by a DBMS hides the physical storage structure from the application programmer. (c) Go to top of assessment. The arity of a table is the number of _____ in the table. (a) rows (b) columns (c) keys (d) foreign keys Correct answer is (b) Your score on this question is: 10.00 Feedback: 2. The cardinality of a table is the number of _____ in the table. (a) rows (b) foreign keys (c) keys (d) columns Correct answer is (a) Your score on this question is: 10.00 Feedback: 3. The degree of a table is the number of _____ in the table. (a) rows (b) columns (c) foreign keys (d) keys Correct answer is (b) Your score on this question is: 10.00 Feedback: 4. The foreign key in a table T1 _____ the same _____ as the corresponding primary key in table T2. 1 must have, name 2 need not have, name 3 must have, domain (a) I and III (b) II and III (c) I, II, and III (d) I and II Correct answer is (b) Your score on this question is: 10.00 Feedback: 5. The SQL clause to perform a set UNION operation is (a) MELD (b) UNITE (c) UNION (d) COMBINE Correct answer is (c) Your score on this question is: 10.00 Feedback: 6. DML is used to (a) manipulate the structure of database applications. (b) add/modify/delete data in the database. (c) specify the structure of a database. (d) add and delete tables. Correct answer is (b) Your score on this question is: 10.00 Feedback: 7. DDL is used to (a) specify the structure of a database. (b) add contents to tables. (c) access the contents of tables. (d) define the structure of database applications. Correct answer is (a) Your score on this question is: 10.00 Feedback: 8. Which of the following SQL statements can be used to create a relational table? (a) APPEND (b) CREATE (c) ADD (d) INSERT Correct answer is (b) Your score on this question is: 10.00 Feedback: 9. Which of the following SQL statements can be used to modify just one row (out of many rows) in a table? (a) CHANGE (b) UPDATE (c) ALTER (d) MODIFY Correct answer is (b) Your score on this question is: 0.00 Feedback: 10. The term query by example refers to (a) a visual query language developed by IBM (b) a query for SQL examples (c) example SQL queries provided by the DBMS that users can modify to suit their current needs (d) example SQL queries provided by other users that can be modified to suit current needs Correct answer is (a) Your score on this question is: 10.00 Feedback: See section 1.2.3 in the course notes. Your performance was as follows: You took 4 minutes on this assessment from Wed Mar 29 08:46:41 UTC+0800 2006 to Wed Mar 29 08:50:36 UTC+0800 2006. Total score: 90.00 1. What information is necessary when specifying the structure of a table? (a) the name of the table, the names of the table's attributes, the data types of attributes, and the formats of attributes (b) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have (c) the name of the table and the names of the table's attributes (d) the name of the table and the amount of storage space to be allocated to the table Correct answer is (a) Your score on this question is: 0.00 Feedback: 2. The cardinality of a table is the number of _____ in the table. (a) columns (b) foreign keys (c) rows (d) keys Correct answer is (c) Your score on this question is: 10.00 Feedback: 3. The arity of a table is the number of _____ in the table. (a) foreign keys (b) keys (c) rows (d) columns Correct answer is (d) Your score on this question is: 10.00 Feedback: 4. The degree of a table is the number of _____ in the table. (a) rows (b) foreign keys (c) columns (d) keys Correct answer is (c) Your score on this question is: 10.00 Feedback: 5. A difference operation can be applied to tables that (a) are union compatible (b) have the same name (c) are the same size (d) have the same column names Correct answer is (a) Your score on this question is: 10.00 Feedback: 6. Which of the following SQL statements can be used to remove a row from a table? (a) DESTROY (b) DELETE (c) ERASE (d) REMOVE Correct answer is (b) Your score on this question is: 10.00 Feedback: 7. DML is used to (a) add/modify/delete data in the database. (b) add and delete tables. (c) manipulate the structure of database applications. (d) specify the structure of a database. Correct answer is (a) Your score on this question is: 10.00 Feedback: 8. A deletion operation will _____ if the deletion leads to the violation of a referential integrity constraint. (a) fail (b) succeed with warning (c) succeed without warning (d) crash the system Correct answer is (a) Your score on this question is: 10.00 Feedback: 9. DDL is used to (a) access the contents of tables. (b) add contents to tables. (c) define the structure of database applications. (d) specify the structure of a database. Correct answer is (d) Your score on this question is: 10.00 Feedback: 10. With Query By Example, a user enters a query by (a) writing an English description of the data that the user needs (b) typing a syntactically correct SQL query that uses column and table names similar to the correct column and table names in a database (c) filling in skeleton tables of the database with examples of what is to be retrieved (d) placing SQL keywords, such as select, under the column names they want to retrieve Correct answer is (c) Your score on this question is: 10.00 1. What information is necessary when specifying the structure of a table? (a) the name of the table, the names of the table's attributes, the data types of attributes, and the formats of attributes (b) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have (c) the name of the table and the names of the table's attributes (d) the name of the table and the amount of storage space to be allocated to the table Correct answer is (a) Your score on this question is: 0.00 Feedback: 2. The cardinality of a table is the number of _____ in the table. (a) columns (b) foreign keys (c) rows (d) keys Correct answer is (c) Your score on this question is: 10.00 Feedback: 3. The arity of a table is the number of _____ in the table. (a) foreign keys (b) keys (c) rows (d) columns Correct answer is (d) Your score on this question is: 10.00 Feedback: 4. The degree of a table is the number of _____ in the table. (a) rows (b) foreign keys (c) columns (d) keys Correct answer is (c) Your score on this question is: 10.00 Feedback: 5. A difference operation can be applied to tables that (a) are union compatible (b) have the same name (c) are the same size (d) have the same column names Correct answer is (a) Your score on this question is: 10.00 Feedback: 6. Which of the following SQL statements can be used to remove a row from a table? (a) DESTROY (b) DELETE (c) ERASE (d) REMOVE Correct answer is (b) Your score on this question is: 10.00 Feedback: 7. DML is used to (a) add/modify/delete data in the database. (b) add and delete tables. (c) manipulate the structure of database applications. (d) specify the structure of a database. Correct answer is (a) Your score on this question is: 10.00 Feedback: 8. A deletion operation will _____ if the deletion leads to the violation of a referential integrity constraint. (a) fail (b) succeed with warning (c) succeed without warning (d) crash the system Correct answer is (a) Your score on this question is: 10.00 Feedback: 9. DDL is used to (a) access the contents of tables. (b) add contents to tables. (c) define the structure of database applications. (d) specify the structure of a database. Correct answer is (d) Your score on this question is: 10.00 Feedback: 10. With Query By Example, a user enters a query by (a) writing an English description of the data that the user needs (b) typing a syntactically correct SQL query that uses column and table names similar to the correct column and table names in a database (c) filling in skeleton tables of the database with examples of what is to be retrieved (d) placing SQL keywords, such as select, under the column names they want to retrieve Correct answer is (c) The cardinality of a table is the number of _____ in the table. (a) rows (b) keys (c) foreign keys (d) columns Correct answer is (a) Your score on this question is: 10.00 Feedback: 2. The foreign key in a table T1 _____ the same _____ as the corresponding primary key in table T2. 1 must have, name 2 need not have, name 3 must have, domain (a) I and II (b) I, II, and III (c) II and III (d) I and III Correct answer is (c) Your score on this question is: 10.00 Feedback: 3. What information is necessary when specifying the structure of a table? (a) the name of the table and the names of the table's attributes (b) the name of the table, the names of the table's attributes, the data types of attributes, and the formats of attributes (c) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have (d) the name of the table and the amount of storage space to be allocated to the table Correct answer is (b) Your score on this question is: 10.00 Feedback: 4. The arity of a table is the number of _____ in the table. (a) columns (b) foreign keys (c) keys (d) rows Correct answer is (a) Your score on this question is: 10.00 Feedback: 5. A difference operation can be applied to tables that (a) are union compatible (b) are the same size (c) have the same name (d) have the same column names Correct answer is (a) Your score on this question is: 10.00 Feedback: 6. What can be specified in the selection condition of a SELECT statement? (a) a Boolean operation (b) an arithmetic operation (c) the conditions under which the statement should be executed (d) the time at which the selection should be performed Correct answer is (a) Your score on this question is: 0.00 Feedback: 7. The SQL clause to perform a set UNION operation is (a) MELD (b) UNION (c) UNITE (d) COMBINE Correct answer is (b) Your score on this question is: 10.00 Feedback: 8. Which of the following SQL statements can be used to add a row to a table? (a) APPEND (b) CREATE (c) ADD (d) INSERT Correct answer is (d) Your score on this question is: 10.00 Feedback: 9. A join operation joins _____ tables into _____. (a) two, one (b) four, two (c) three, one (d) three, two Correct answer is (a) Your score on this question is: 10.00 Feedback: 10. With Query By Example, a user enters a query by (a) placing SQL keywords, such as select, under the column names they want to retrieve (b) writing an English description of the data that the user needs (c) typing a syntactically correct SQL query that uses column and table names similar to the correct column and table names in a database (d) filling in skeleton tables of the database with examples of what is to be retrieved Correct answer is (d) Your score on this question is: 10.00 The degree of a table is the number of _____ in the table. (a) foreign keys (b) columns (c) rows (d) keys Correct answer is (b) Your score on this question is: 10.00 Feedback: 2. The arity of a table is the number of _____ in the table. (a) rows (b) keys (c) columns (d) foreign keys Correct answer is (c) Your score on this question is: 10.00 Feedback: 3. What information is necessary when specifying the structure of a table? (a) the name of the table and the amount of storage space to be allocated to the table (b) the name of the table and the names of the table's attributes (c) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have (d) the name of the table, the names of the table's attributes, the data types of attributes, and the formats of attributes Correct answer is (d) Your score on this question is: 10.00 Feedback: 4. The cardinality of a table is the number of _____ in the table. (a) foreign keys (b) columns (c) keys (d) rows Correct answer is (d) Your score on this question is: 10.00 Feedback: 5. DML is used to (a) specify the structure of a database. (b) add and delete tables. (c) manipulate the structure of database applications. (d) add/modify/delete data in the database. Correct answer is (d) Your score on this question is: 10.00 Feedback: 6. The SQL clause to perform a set UNION operation is (a) COMBINE (b) UNION (c) UNITE (d) MELD Correct answer is (b) Your score on this question is: 10.00 Feedback: 7. Which of the following SQL statements can be used to create a relational table? (a) ADD (b) APPEND (c) CREATE (d) INSERT Correct answer is (c) Your score on this question is: 10.00 Feedback: 8. DDL is used to (a) access the contents of tables. (b) specify the structure of a database. (c) add contents to tables. (d) define the structure of database applications. Correct answer is (b) Your score on this question is: 10.00 Feedback: 9. What can be specified in the selection condition of a SELECT statement? (a) the time at which the selection should be performed (b) an arithmetic operation (c) the conditions under which the statement should be executed (d) a Boolean operation Correct answer is (d) Your score on this question is: 10.00 Feedback: 10. The term query by example refers to (a) a query for SQL examples (b) example SQL queries provided by other users that can be modified to suit current needs (c) a visual query language developed by IBM (d) example SQL queries provided by the DBMS that users can modify to suit their current needs Correct answer is (c) Your score on this question is: 10.00 Feedback: See section 1.2.3 in the course notes. Go to top of assessment. Your performance was as follows: 1. What information is necessary when specifying the structure of a table? (a) the name of the table, the names of the table's attributes, the data types of attributes, and the formats of attributes (b) the name of the table and the amount of storage space to be allocated to the table (c) the name of the table and the names of the table's attributes (d) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have Correct answer is (a) Your score on this question is: 10.00 Feedback: (a) 2. The foreign key in a table T1 _____ the same _____ as the corresponding primary key in table T2. 1 must have, name 2 need not have, name 3 must have, domain (a) I and II (b) II and III (c) I and III (d) I, II, and III Correct answer is (b) Your score on this question is: 10.00 Feedback: (b) 3. The arity of a table is the number of _____ in the table. (a) foreign keys (b) rows (c) keys (d) columns Correct answer is (d) Your score on this question is: 10.00 Feedback: (d) 4. The cardinality of a table is the number of _____ in the table. (a) keys (b) columns (c) rows (d) foreign keys Correct answer is (c) Your score on this question is: 10.00 Feedback: (c) 5. Which of the following SQL statements can be used to create a relational table? (a) INSERT (b) ADD (c) CREATE (d) APPEND Correct answer is (c) Your score on this question is: 10.00 Feedback: (c) 6. The SQL clause to perform a set difference operation is (a) EXCEPT (b) OMIT (c) DIFFER (d) REJECT Correct answer is (a) Your score on this question is: 10.00 Feedback: (a) 7. Which of the following SQL statements can be used to remove a row from a table? (a) ERASE (b) REMOVE (c) DESTROY (d) DELETE Correct answer is (d) Your score on this question is: 10.00 Feedback: (d) 8. Which of the following SQL statements can be used to add a row to a table? (a) ADD (b) APPEND (c) CREATE (d) INSERT Correct answer is (d) Your score on this question is: 10.00 Feedback: (d) 9. What can be specified in the selection condition of a SELECT statement? (a) the time at which the selection should be performed (b) a Boolean operation (c) an arithmetic operat

64,654

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧