INF2603/101/3/2019 Tutorial Letter 101/3/2019 Databases 1 INF2603 Semesters 1 & 2 School of Computing IMPORTANT INFORMATION: This tutorial letter contains important information about your module. CONTENTS Page 1 INTRODUCTION .......................................................................................................................... 3 2 PURPOSE OF AND OUTCOMES FOR THE MODULE................................................................ 4 2.1 Purpose ........................................................................................................................................ 4 2.2 Outcomes ..................................................................................................................................... 4 3 LECTURER(S) AND CONTACT DETAILS................................................................................... 4 3.1 Lecturer(s) .................................................................................................................................... 4 3.2 Department ................................................................................................................................... 4 3.3 University ...................................................................................................................................... 4 4 RESOURCES ............................................................................................................................... 4 4.1 Prescribed book ............................................................................................................................ 4 4.1.1 Syllabus ........................................................................................................................................ 5 4.2 Recommended books ................................................................................................................... 5 4.3 Electronic reserves (e-reserves) ................................................................................................... 5 5 STUDENT SUPPORT SERVICES ................................................................................................ 5 5.1 E-tutors ......................................................................................................................................... 5 5.2 Free computer and internet access (telecentres) .......................................................................... 5 6 STUDY PLAN ............................................................................................................................... 6 7 PRACTICAL WORK AND WORK-INTEGRATED LEARNING ..................................................... 6 8 ASSESSMENT ............................................................................................................................. 6 8.1 Assessment plan .......................................................................................................................... 6 8.2 General assignment numbers ....................................................................................................... 7 8.3 Submission of assignments .......................................................................................................... 7 8.4 Semester 1: Assignments ............................................................................................................. 9 8.5 Semester 2: Assignments ........................................................................................................... 21 9 EXAMINATION ........................................................................................................................... 31 10 FREQUENTLY ASKED QUESTIONS ........................................................................................ 31 11 SOURCE CONSULTED ............................................................................................................. 31 2 INF2603/101 1 INTRODUCTION Dear Student Welcome to Databases I for semesters 1 and 2 in 2019. Please read this document in its entirety as it contains very important information about the module. It contains all the information about the module assignments. More details can be found online (myUnisa portal). Databases I is a fully online module. This means all communication, tutorial matter and submissions related to the module will be done through myUnisa (my.unisa.ac.za). There is no study guide for this module and the prescribed book for the module is mentioned in section 4.1. No tutorial matter (tutorial letters) will be sent to you through the post. All registered students have access to this website. Please refer to the Study @ Unisa brochure (www.unisa.ac.za) on how to access myUnisa and activate your myLife student account. It is therefore compulsory that you visit myUnisa on a regular basis and check your Unisa (myLife) e-mail regularly for the duration of your studies. We will be sending regular announcements and it is your responsibility to read them and take appropriate action afterwards. Please refer to Tutorial Letter 301 for the contact details of the lecturers and the School of Computing. Alternatively, send an e-mail to the module mailbox. The following are the approximate dates for the beginning of both semesters in 2019: Semester 1: 28 January 2019 Semester 2: 15 July 2019 Therefore, plan your registration accordingly and visit myUnisa to begin your studies and to check all due dates for online assignments. Please note that no extensions will be granted for late submission of any assignments in this module. We are looking forward to seeing you online in 2019. 3 2 PURPOSE OF AND OUTCOMES FOR THE MODULE 2.1 Purpose This module serves as a fundamental building block in equipping students with the knowledge and competencies to understand and use databases. The module provides fundamental and required knowledge, skills and values which will support further studies in the field of database management design and implementation systems as required for studies in Information Systems and Computer Science. 2.2 Outcomes to demonstrate a well-rounded and systematic knowledge of the fundamentals of database management systems to be able to apply fundamental principles and techniques relevant to database management to design databases using the notations and strategies identified to demonstrate a well-rounded and systematic knowledge of the fundamentals of the Standard Query Language (SQL) 3 LECTURER(S) AND CONTACT DETAILS 3.1 Lecturer(s) Please refer to Tutorial Letter 301 for contact details of the lecturers and the School. 3.2 Department School of Computing 3.3 University University of South Africa 4 RESOURCES 4.1 Prescribed book Title Authors Publisher Edition Year of publication ISBN 4 DATABASE SYSTEMS: Design, Implementation, and Management Carlos Coronel & Stephen Morris Cengage Learning EMEA 13 2019 13: 978-1-337-62790-0 / 9781337627900 10:1-337-62790-9 INF2603/101 4.1.1 Syllabus Chapter Topics in CMRC Study instructions 1 Database Systems Study in depth 2 Data Models Study in depth 3 The Relational Database Model Study in depth 4 Entity Relationship (ER) Modelling Study in depth 5 Advanced Data Modelling Study in depth 6 Normalisation of Database Tables Study in depth 7 Introduction to Structured Query Language (SQL) Study in depth 4.2 Recommended books None 4.3 Electronic reserves (e-reserves) There is a selection of YouTube videos for relational database concepts under Learning Units, “Unit 0.3 YouTube Videos” and Discussion Forum “3. YouTube Videos”. We recommend you watch the videos and discuss their content in the discussion forum. 5 STUDENT SUPPORT SERVICES 5.1 E-tutors This module has e-tutors. Once you have been registered, you will be allocated to a group of students with whom you will be interacting during the tuition period as well as an e-tutor who will be your tutorial facilitator. Thereafter, you will receive an SMS informing you about your group, the name of your e-tutor and instructions on how to log onto myUnisa in order to receive further information on the e-tutoring process. Additional important information appears in your Study @ Unisa brochure. 5.2 Free computer and internet access (Telecentres) Unisa has entered into partnerships with establishments (referred to as telecentres) in various locations across South Africa to afford you (as a Unisa student) free access to computers and the internet. This access enables you to conduct the following academic activities: registration; online submission of assignments; engaging in e-tutoring activities and signature courses; and so on. Please note that any other activity except these is for your own account such as printing and photocopying. For more information on the telecentre nearest to you, please visit www.unisa.ac.za/telecentres. 5 6 STUDY PLAN Use your Study @ Unisa brochure for general time management and planning skills. A module-specific weekly schedule for the module is provided on myUnisa under Additional Resources. 7 PRACTICAL WORK AND WORK-INTEGRATED LEARNING None 8 ASSESSMENT 8.1 Assessment plan 8.1.1 Formative assessment (YM) 1. Assignment 01 (MCQ) – 20% 2. Assignment 02 (WRITTEN) – 35% 3. Introduce yourself and welcome at least TWO classmates – 5% (Assignment 03) 4. Discussion contribution on each of the posted topics – 5% (Assignment 04) 5. Seven (7) self-assessments – one for each chapter (MCQ) Assignment numbers 05 – 11 7 x 5% each = 35% All seven SAs have stipulated due dates (see below). 8.1.2 Summative assessment 1. Final examination: MCQ (20%) and WRITTEN (80%) 8.1.3 Assessment marks ratio 1. Year mark: 30% 2. Exam mark: 70% ALL assignments MUST be submitted electronically through myUnisa! 8.1.4 Self-assessment The module is comprised of SEVEN (7) self-assessments (SAs), one for each of the chapters in the syllabus, as well as FOUR assignments. The self-assessments contribute 35% (5% each) towards the year mark. ALL self-assessments of Semester 1 are available for submission from 11 February 2019. ALL self-assessments of Semester 2 are available for submission from 29 July 2019. NO EXTENSIONS will be granted of the due dates. If you do not submit the SA on or before the due date, you will forfeit the marks. Each SA has an allocated time of TWO (2) HOURS, after which automatic grading will be calculated when the time has elapsed. It is your responsibility to find TWO hours to complete an assessment. Students have only TWO ATTEMPTS to complete a self-assessment during the period it is open and the highest mark will be recorded. Make sure that you attempt the SA after you have completed reading the particular chapter. 6 INF2603/101 NO SPECIAL ARRANGEMENTS WILL BE MADE FOR MISSING A SUBMISSION DEADLINE IN THE ALLOCATED TWO SUBMISSIONS. 8.2 General assignment numbers Assignments are numbered consecutively per module, starting from 01. IMPORTANT NOTE: Examination admission is determined by submission of Assignment 01, which is compulsory. All ELEVEN (11) assignments contribute to the calculation of the year mark; therefore, it is recommended that you submit all of them to improve your final year mark. It is also good preparation for the final examination. 8.2.1 First Semester Assignment Type 01 MCQ 02 Written 03 Discussions: Introduce Yourself 04 Discussions: Topics 05 SA – Ch1 06 SA – Ch2 07 SA – Ch3 08 SA – Ch4 09 SA – Ch5 10 SA – Ch6 11 SA – Ch7 TOTAL Unique No 847979 777594 607336 653466 823031 620972 731840 671241 730896 653688 673534 Second Semester Assignment Type 01 MCQ 02 Written 03 Discussions: Introduce Yourself 04 Discussions: Topics 05 SA – Ch1 06 SA – Ch2 07 SA – Ch3 08 SA – Ch4 09 SA – Ch5 10 SA – Ch6 11 SA – Ch7 TOTAL Unique No 593516 842182 819294 885701 886737 642921 622240 667409 721441 649519 781147 8.3 8.3.1 Unique assignment numbers and due dates Due Date 2019 15 Mar 11 Apr 8 Mar 5 Apr 01 Apr 01 Apr 15 Apr 15 Apr 22 Apr 22 Apr 22 Apr Due Date 2019 03 Sep 20 Sep 29 Aug 13 Sep 09 Sep 09 Sep 17 Sep 17 Sep 27 Sep 27 Sep 27 Sep Weight 20% 35% 5% 5% 5% 5% 5% 5% 5% 5% 5% 100% Weight 20% 35% 5% 5% 5% 5% 5% 5% 5% 5% 5% 100% Submission of assignments Electronic submission of Assignment 01: Multiple-choice Assignment 01 Connect to the URL: https://my.unisa.ac.za 7 Register to become a user. Once you are a registered user, click on the code for which you are registered, for example, INF2603 – Assignment. Select the multiple-choice assignment you wish to submit. Proceed to fill in the electronic sheet. Submit the assignment after you have electronically made your selections. Retain proof of submission. 8.3.2 Electronic submission of written Assignment 02 Connect to the URL: https://my.unisa.ac.za Once you are a registered user, click on the code for which you are registered, for example, INF2603 – Assignment. Upload your Assignment 02 document ONLY in PDF format. 8.3.3 Electronic submission of discussions assignments (Assignments 03 and 04) Connect to the URL: https://my.unisa.ac.za Register to become a user. Once you are a registered user, click on the code for which you are registered, for example, INF2603. Click on Discussions. Click on Introduce Yourself for Assignment 03. Click on Discussions Topics for Assignment 04. 8.3.4 Electronic submission of self-assessments (Assignments 05–11) Connect to the URL: https://my.unisa.ac.za Register to become a user. Once you are a registered user, click on the code for which you are registered, for example, INF2603. Click on the Self-assessments link and a list of all active assignments will be displayed. Click on the assignment you want to submit and answer the questions. Then submit for grading. DO NOT POST, FAX OR E-MAIL ASSIGNMENTS TO UNISA OR LECTURERS. SUCH SUBMISSIONS WILL NOT BE MARKED! 8 INF2603/101 8.4 Semester 1: Assignments SEMESTER 1 ASSIGNMENT 01 Due date Tutorial matter covered in prescribed book 15 March 2019 Chapter 1: Database Systems TOTAL MARKS: 100 Chapter 2: Data Models Chapter 3: The Relational Database Model Unique number: 847979 Select the most appropriate option: For questions 1 to 4: Indicate whether the statement is true or false. 1 = True 2 = False 1. Database programming languages receive all application requests and translate them into the complex operations required to fulfil those requests. 2. Even when a good database blueprint is available, an applications programmer’s view of the data should match that of the manager and the end user. 3. The practical significance of taking the logical view of a database is that it serves as a reminder of the simple file concept of data storage. 4. Depending on the sophistication of the application development software, nulls can create problems when functions such as COUNT, AVERAGE, and SUM are used. For questions 5-25: Identify the choice that best completes the statement or answers the question. 5. An XML database supports the storage and management of _____ XML data. 1. structured 2. unstructured 3. semistructured 4. multistructured 9 6. Accurate, relevant, and timely information is the key to ____. 1. data management 2. good decision-making 3. understanding 4. knowledge 7. The database structure in a DBMS is stored as a _____. 8. 9. 10. 1. single file 2. collection of files 3. collection of queries 4. set of key/value pairs The response of the DBMS to a query is the ___________. 1. ad hoc query 2. ad hoc response 3. query result set 4. integrated view of the data A desktop database is a _____ database. 1. single-user 2. multi-user 3. workgroup 4. distributed Which of the following refers to the situation where different versions of the same data are stored at different places because they weren’t updated consistently? 11. 1. Data query 2. Data integrity 3. Data dictionary 4. Data redundancy Which one of the following database management systems does not support analytical data usage? 1. MS Access 2. Oracle RDBS 10 INF2603/101 3. SAP HANA 4. IBM DB2 12. A(n) _____ is bidirectional. 1. attribute 2. entity 3. relationship 4. constraint 13. 14. 15. 16. Students and classes have a _____ relationship. 1. one-to-one 2. one-to-many 3. many-to-one 4. many-to-many A noun in a business rule translates to a(n) _____ in the data model. 1. attribute 2. entity 3. relationship 4. constraint Oracle 12c, MS SQL Server, and Tamino are examples of _____ data models. 1. hierarchical 2. file system 3. relational 4. XML Hybrid Which of the following is true of NoSQL databases? 1. They do not support distributed database architectures. 2. They are not based on the relational model. 3. They are geared toward transaction consistency rather than performance. 4. They do not support very large amounts of sparse data. 11 17. 18. A(n) _____ enables a database administrator to describe schema components. 1. extensible markup language (XML) 2. unified modelling language (UML) 3. data definition language (DDL) 4. query language Referential _____ dictates that the foreign key must either contain values that match the primary key in the related table or must contain null. 19. 1. integrity 2. uniqueness 3. model 4. attribute A _____ contains at least all of the attribute names and characteristics for each table in the system. 20. 1. data dictionary 2. relational schema 3. logical schema 4. database The _____ relationship is the “relational model ideal”. 1. 1:1 2. 1..M 3. M:1 4. M:N 21. In a database context, the word _____ indicates the use of the same attribute name to label different attributes. 12 1. redundancy 2. homonym 3. duplicate 4. synonym INF2603/101 22. A(n) _____ is an orderly arrangement used to logically access rows in a table. 1. primary key 2. relationship 3. superkey 4. index 23. According to Codd’s _____ rule of relational databases, application programs and ad hoc facilities are logically unaffected when changes are made to the table structures that preserve the original table values (changing the order of columns or inserting columns). 1. distribution independence 2. logical data independence 3. comprehensive data sublanguage 4. integrity independence 24. Which of the following refers to the activities that focus on the design of the database structure that will be used to store and manage end-user data? 1. data quality 2. data warehouse 3. data management 4. data design 25. Which of the following returns all tuples in one relation that are not found in the other relation? 1. INTERSECT 2. RESTRICT 3. PROJECTION 4. DIFFERENCE 13 Semester 1 Assignment 02 Due date Tutorial matter covered in prescribed book 11 April 2019 All chapters in the syllabus TOTAL MARKS: 100 Unique number: 777594 Question 1: a. [14] What does it mean to say that a database displays both entity integrity and referential integrity? (2) What is a strong (or identifying) relationship and how is it depicted in a Crow’s Foot b. ERD? (2) c. What is an entity cluster and what advantages are derived from its use? (3) d. What is a surrogate primary key and when would you use one? (3) e. When implementing a 1:1 relationship, where should you place the foreign key if one side is mandatory and one side is optional? Should the foreign key be mandatory or optional? (4) Question 2 [5] Suppose you are working within the framework of the conceptual model shown in ERD diagram below. The ERD 14 INF2603/101 a. Write the ten cardinalities that are appropriate for this ERD. (5) 15 Question 3 [60] 3.1. The manager of a consulting firm has asked you to evaluate a database that contains the table structure shown in the table below. Table: Sample CLIENT Records Attribute Name Sample Value Sample Value Sample Value CLIENT_NUM 298 289 289 CLIENT_NAME Marianne R. James D. Smith James D. Smith Brown CLIENT_REGION Midwest Southeast Southeast CONTRACT_DATE 10-Feb-2018 15-Feb-2018 12-Mar-2018 CONTRACT_NUMBER 5841 5842 5843 CONTRACT_AMOUNT R22,985,00.00 R1,670,300.00 R11,250,000.00 CONSULT_CLASS_1 Database Internet Services Database Design Administration CONSULT_CLASS_2 Web Applications Database Administration CONSULT_CLASS_3 Network Installation CONSULT_CLASS_4 CONSULTANT_NUM_1 29 34 CONSULTANT_NAME_1 Rachel G. Carson Gerald K. Ricardo Angela M. Jamison CONSULTANT_REGION_1 Midwest Southeast Southeast CONSULTANT_NUM_2 56 38 34 CONSULTANT_NAME_2 Karl M. Spenser Anne T. Zuma Gerald K. Jele CONSULTANT_REGION_2 Midwest Southeast Southeast CONSULTANT_NUM_3 22 45 CONSULTANT_NAME_3 Julian H. Geraldo J. Rivera 25 Donatello CONSULTANT_REGION_3 Midwest Southeast CONSULTANT_NUM_4 18 CONSULTANT_NAME_4 Donald Tau CONSULTANT_REGION_4 West The table was created to enable the manager to match clients with consultants. The objective is to match a client within a given region with a consultant in that region, and to 16 INF2603/101 make sure that the client’s need for specific consulting services is properly matched to the consultant’s expertise. For example, if the client needs help with database design and is located in the south-east, the objective is to make a match with a consultant who is located in the south-east and whose expertise is in database design. (Although the consulting company manager tries to match consultant and client locations to minimise travel expense, it is not always possible to do so.) The following basic business rules are maintained: Each client is located in one region A region can contain many clients. Each consultant can work on many contracts Each contract might require the services of many consultants. A client can sign more than one contract but each contract is signed by only one client. Each contract might cover multiple consulting classifications. (For example, a contract may list consulting services in database and networking.) Each consultant is located in one region. A region can contain many consultants. Each consultant has one or more areas of expertise (class). For example, a consultant might be classified as an expert in both database design and networking. Each area of expertise (class) can have many consultants in it. For example, the consulting company might employ many consultants who are networking experts. a. Given that brief description of the requirements and the business rules, write the relational schema and draw the dependency diagram for the preceding (and very poor) table structure. Label all transitive and/or partial dependencies. (15) b. Break up the dependency diagram you drew in Problem 3a to produce dependency diagrams that are in 3NF and write the relational schema. (Hint: You might have to create a few new attributes. Also make sure that the new dependency diagrams contain attributes that meet proper design criteria; that is, make sure that there are no multivalued attributes, that the naming conventions are met, and so on.) (15) c. Using the results of Problem 3b, draw the Crow’s Foot ERD. (30) Question 4 [8] 17 a. What is a CROSS JOIN? Give an example of its syntax. (4) b. Explain why the two following commands produce different results. (2) SELECT DISTINCT COUNT (V_CODE) FROM PRODUCT; SELECT COUNT (DISTINCT V_CODE) FROM PRODUCT; c. What MS Access/SQL Server function should you use to calculate the number of days between the current date and 25 January 1999? (2) Question 5 [13] The CIS Department at the UNIVERSITY OF SOWETO maintains the Free Acess to Current Technology (FACT) library of e-books. The two relational schemas below are part of a database held in a relational DBMS for the library of e-books. BOOK (Book_Num, Book_Title, Book_Year, Book_Cost, Book_Subject, Pat_ID) PATRON (Pat_ID, Pat_FName, Pat_LName, Pat_Type) Given the structure and contents of the database shown in tables above, use SQL commands to answer questions 5a–e . NOTE: All SQL syntax must be correct; you will be penalised for missing characters! a. Write the SQL query to display the book number, title and cost for all books that cost R599.95 sorted by book number as in the table below. BOOK_NUM b. BOOK_COST 5235 Beginners, Guide to JAVA 599.95 5236 Database in the Cloud 599.95 5241 ITIL for Dummies 599.95 5243 DATABASES in Theory 599.95 Write the SQL code to enter the FIRST TWO rows for the table below. BOOK_NUM 18 BOOK_TITLE (3) BOOK_TITLE BOOK_COST 5235 Beginners, Guide to JAVA 599.95 5236 Database in the Cloud 599.95 5241 ITIL for Dummies 599.95 5443 DATABASES in Theory 599.95 (2) INF2603/101 c. Write a query to display the highest book cost in the system as in the table below. (2) Most Expensive 1265.95 d. Write a query to display the total value of all books in the library as in the table below. (3) Library Value 192655.95 e. Write a query to display the book, title with year, and subject for each book. Sort the results by the book number as in the table below. (3) BOOK_NUM BOOK 5235 Beginners, Guide to JAVA (2014) 5236 Database in the Cloud (2016) 5237 Mastering Research Proposal (2017) 5238 J++ in Mobile Apps (2015) Programming 5239 iOS Programming (2017) Programming 5240 Advanced Project Management (2018) 5341 ITIL for Dummies (2018) SEMESTER 1 BOOK_SUBJECT ASSIGNMENT 03 Programming Cloud Research Project Management Models TOTAL MARKS: 100 Due date Introduce Yourself Assignment 08 March 2019 Instructions: You are required to first post an introduction of yourself and then welcome at least TWO classmates from the forum 19 “1. Introduce Yourself” (Ice-Breaker Activity) (see unit 0.2 Getting Started under Learning Units). (Full instructions are given under section 9.3.3 above.) This assignment contributes 5% towards your year mark. Unique number: 607336 SEMESTER 1 ASSIGNMENT 04 TOTAL MARKS: 100 Due date Discussions Topics Assignment 05 April 2019 Instructions: This assignment involves your participation in online discussions topics posted for specific module concepts. You are required to respond to ALL topics posted in the forum “2. Discussions Topics” under Discussions. (Full instructions are given under section 9.3.3 above.) This task contributes 5% towards your year mark. Unique number: 653466 SEMESTER 1 ASSIGNMENTS 05 – 12 TOTAL MARKS EACH: 100 SEVEN (7) self-assessments for each chapter in the syllabus Instructions: Log onto myUnisa and navigate to Self-assessments (SA). Consult section 9.1.4 for information on when a self-assessment is open for submission. (Full instructions on how to access Self-assessments are given under section 9.3.4 above.) Assignment 05 06 07 08 09 10 11 20 Type SA – Ch1 SA – Ch2 SA – Ch3 SA – Ch4 SA – Ch5 SA – Ch6 SA – Ch7 Year Mark Contribution Unique No 823031 620972 731840 671241 730896 653688 673534 Due Date 2019 01 Apr 01 Apr 15 Apr 15 Apr 22 Apr 22 Apr 22 Apr Weight 5% 5% 5% 5% 5% 5% 5% 35% INF2603/101 8.5 Semester 2: Assignments SEMESTER 2 ASSIGNMENT 01 TOTAL MARKS: 100 Due date Tutorial matter covered in prescribed book 03 September 2019 Chapter 1: Database Systems Chapter 2: Data Models Chapter 3: The Relational Database Model Unique number: 593516 For questions 1 to 4: Indicate whether the statement is true or false. 1 = True 2 = False 1. The DBMS reveals much of the database’s internal complexity to the application programs and users. 2. A disadvantage of the relational database management system (RDBMS) is its inability to hide the complexities of the relational model from the user. 3. The idea of determination is unique to the database environment. 4. The DIVIDE operation uses one single-column table (eg, column “a”) as the divisor and one two-column table (eg, columns “a” and “b”) as the dividend. 21 For questions 5 to 25: Identify the choice that best completes the statement or answers the question. 5. End user data is _____. 1. knowledge about end users 2. raw facts of interest to the end user 3. information about a specific subject 4. accurate, relevant and timely information 6. Which one of the following database management system products does not support Enterprise database? 1. Microsoft Access 2. Oracle RDBS 3. IBM DB2 4. SAP HANA 7. A(n) _____ might be written by a programmer or it might be created through a DBMS utility program. 8. 1. query 2. operating system 3. database management system 4. application A(n) _____ database supports a relatively small number of users (usually fewer than 50) or a specific department within an organisation. 9. 22 1. desktop 2. workgroup 3. enterprise 4. transactional A data warehouse contains historical data obtained from the _____. 1. operational databases 2. desktop databases 3. enterprise databases 4. workgroup databases INF2603/101 10. 11. 12. 13. 14. The organisation of data within folders in a manual file system is determined by _______. 1. its date of creation 2. its expected use 3. the data processing specialist 4. the title of the documents in the folder Which of the following is true of spreadsheet applications? 1. They are a better alternative to databases. 2. They do not allow manipulation of data once entered. 3. They provide enhanced security and robust data sharing features. 4. They enhance the user's ability to understand the data. A(n) _____ represents a particular type of object in the real world. 1. attribute 2. entity 3. relationship 4. node Which of the following is true of business rules? 1. They can serve as a communication tool between the users and designers. 2. They allow the designer to set company policies with regard to data. 3. They provide a framework for the company’s self-actualisation. 4. They allow the designer to develop business processes. Within the relational model, tables are known as ____, columns of tables are referred to as ____, and rows of tables are called ____. 1. tuples, attributes, entities 2. relations, attributes, tuples 3. relations, tuples, attributes 4. relation, attributes, tuples 23 15. A verb associating two nouns in a business rule translates to a(n) _____ in the data model. 16. 1. entity 2. attribute 3. relationship 4. constraint Which one of the following types of HDFS nodes stores all the metadata about a file system? 17. 18. 1. client node 2. data node 3. map node 4. name node A(n) _____ enables a database administrator to describe schema components. 1. extensible markup language (XML) 2. data definition language (DDL) 3. unified modelling language (UML) 4. query language MySQL is an example of the _____. 1. hierarchical model 2. file system data model 3. relational data model 4. XML data model 19. The CUSTOMER table’s primary key is CUST_CODE. The CUSTOMER primary key column has no null entries, and all entries are unique. This is an example of _____ integrity. 24 1. null 2. entity 3. relational 4. referential INF2603/101 20. The _____ is actually a system-created database whose tables store the user/designercreated database characteristics and contents. 21. 1. unique index 2. database tuple 3. system catalogue 4. systematic database The _____ relationship should be rare in any relational database design. 1. 1:1 2. 1..M 3. M:1 4. M..N 22. In a database context, a(n) _____ indicates the use of different names to describe the same attribute. 1. entity 2. duplicate 3. homonym 4. synonym 23. When you define a table’s primary key, the DBMS automatically creates a(n) _____ index on the primary key column(s) you declared. 1. key 2. composite 3. unique 4. primary 24. According to Codd's _____ rule of relational databases, if the system supports low-level access to the data, users must not be allowed to bypass the integrity rules of the database. 1. non-subversion 2. information 3. guaranteed access 4. view updating 25 25. Which of the following returns all tuples in one relation that are not found in the other relation? 1. PRODUCT 2. SELECT 3. PROJECT 4. DIFFERENCE SEMESTER 2 ASSIGNMENT 02 TOTAL MARKS: 100 Due date Tutorial matter covered in prescribed book 20 September 2019 All chapters in the syllabus Unique number: 842182 Question 1 [18] a. What is a subtype discriminator? Given an example of its use. (3) b. Under what circumstances are composite primary keys appropriate? (4) c. What are time-variant data and how would you deal with such data from a database design point of view? (2) d. Why are entity integrity and referential integrity important in a database? e. What two conditions must be met before an entity can be classified as a weak entity? Give an example of a weak entity. f. (3) Explain briefly but precisely the difference between single-valued attributes and simple attributes. Give an example of each. 26 (2) (4) INF2603/101 Question 2 [10] Suppose you are working within the framework of the conceptual model shown in ERD diagram below. The ERD FIGURE b. Write the business rules reflected in this ERD. Question 3 [46] Suppose that you have been given the table structure and data shown in the table below, which was imported from an Excel spreadsheet. The data reflect that a professor can have multiple advisees, can serve on multiple committees, and can edit more than one journal. Table: Sample PROFESSOR Records Attribute Name Sample Value Sample Value Sample Value EMP_NUM PROF_RANK EMP_NAME DEPT_CODE DEPT_NAME 123 Professor Ghee CIS Computer Info. Systems KDD-567 1215, 2312, 3233, 2218, 2098 104 Asst. Professor Rankin CHEM Chemistry PROMO, TRAF APPL, DEV JMIS, QED, JMGT DEV 118 Assoc. Professor Ortega CIS Computer Info. Systems KDD-562 2134, 2789, 3456, 2002, 2046, 2018, 2764 SPR, TRAF PROF_OFFICE ADVISEE COMMITTEE_CODE JOURNAL_CODE BLF-119 3102, 2782, 3311, 2008, 2876, 2222, 3745, 1783, 2378 Sample Value Assoc. Professor Smith ENG English PRT-345 2873, 2765, 2238, 2901, 2308 PROMO, SPR DEV JCIS, JMGT Given the information in the table: a. Draw the dependency diagram. (6) 27 b. Identify the multivalued dependencies. (3) c. (4) Create the dependency diagrams to yield a set of table structures in 3NF. d. Eliminate the multivalued dependencies by converting the affected table structures to 4NF. (7) e. Draw the Crow’s Foot ERD to reflect the dependency diagrams you drew in part C. (Note: You might have to create additional attributes to define the proper PKs and FKs. Make sure that all of your attributes conform to the naming conventions.) (26) Question 4 [7] a. What three join types are included in the OUTER JOIN classification? (3) b. What is the difference between the COUNT aggregate function and the SUM aggregate function? c. (2) What Oracle function should you use to calculate the number of days between your birthday and the current date? (2) Question 5 [19] Consider the contents of the ASSIGNMENT table and use SQL commands to answer questions 5a–e . ASSIGNMENT Table ASSIGN_NUM 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 28 ASSIGN_DATE 22-May-18 22-May-18 22-May-18 22-May-18 22-May-18 22-May-18 22-May-18 22-May-18 23-May-18 23-May-18 23-May-18 23-May-18 23-May-18 23-May-18 23-May-18 23-May-18 23-May-18 PROJ_NUM EMP_NUM ASSIGN_JOB 18 22 18 18 25 22 25 18 15 15 25 18 25 22 15 22 18 103 117 117 103 108 104 113 103 115 117 105 108 115 104 103 105 117 503 509 509 503 501 501 508 503 501 509 502 501 501 501 503 502 509 ASSIGN_CHG_HR ASSIGN_HOURS ASSIGN_CHARGE 84.5 34.55 34.55 84.5 96.75 96.75 50.75 84.5 96.75 34.55 105 96.75 96.75 96.75 84.5 105 34.55 3.5 4.2 2 5.9 2.2 4.2 3.8 0.9 5.6 2.4 4.3 3.4 2 2.8 6.1 4.7 3.8 295.75 145.11 69.1 498.55 212.85 406.35 192.85 76.05 541.8 82.92 451.5 328.95 193.5 270.9 515.45 493.5 131.29 INF2603/101 1018 1019 1020 1021 1022 1023 1024 1025 23-May-18 24-May-18 24-May-18 24-May-18 24-May-18 24-May-18 24-May-18 24-May-18 25 25 15 22 22 22 15 18 117 104 101 108 115 105 103 117 509 501 502 501 501 502 503 509 34.55 110.5 125 110.5 110.5 125 84.5 34.55 2.2 4.9 3.1 2.7 4.9 3.5 3.3 4.2 76.01 541.45 387.5 298.35 541.45 437.5 278.85 145.11 NOTE: All SQL syntax must be correct; you will be penalised for missing characters! a. Write the SQL query to list the assignment number, project number, employee number and assignment charge per hour for all the projects that were assigned after the 24 th of March 2018. Sort the results by employee number. b. (3) Write the SQL code that will list only the distinct project numbers in the ASSIGNMENT table, sorted by project number. c. (4) Write the SQL code to validate the ASSIGN_CHARGE values in the ASSIGNMENT table. Your query should retrieve the assignment number, employee number, project number, the stored assignment charge (ASSIGN_CHARGE), and the calculated assignment charge (calculated by multiplying ASSIGN_CHG_HR by ASSIGN_HOURS). Sort the results by the assignment number. d. (5) Write the SQL query to display the book number, title and cost for all books that cost R599,95 sorted by book number as in the table below. e. (2) Write a query to produce the total number of hours and charges for each of the projects represented in the ASSIGNMENT table, sorted by project number. The output is shown below: PROJ_NUM (5) SumOfASSIGN_HOURS SumOfASSIGN_CHARGE 15 20.5 1806.52 18 23.7 1544.80 22 27.0 2593.16 25 19.4 1668.16 29 SEMESTER 2 ASSIGNMENT 03 TOTAL MARKS: 100 Due date Introduce Yourself Assignment 29 Aug 2019 Instructions: You are required to first post an introduction of yourself and then welcome at least TWO classmates from the forum “1. Introduce Yourself” (Ice-Breaker Activity) (see unit 0.2 Getting Started under Learning Units). (Full instructions are given under section 9.3.3 above.) This assignment contributes 5% towards your year mark. Unique number: 819294 SEMESTER 2 ASSIGNMENT 04 TOTAL MARKS: 100 Due date Discussions Topics Assignment 13 Sep 2019 Instructions: T01his assignment involves your participation in online discussions 45topics posted for specific module concepts. You are required to respond to ALL topics posted in the forum “2. Discussions Topics” under Discussions. (Full instructions are given under section 9.3.3 above.) This task contributes 5% towards your year mark. Unique number: 885701 SEMESTER 2 ASSIGNMENTS 05–11 TOTAL MARKS 100 SEVEN (7) Self-assessments for each chapter in the syllabus Instructions: Log onto to myUnisa and navigate to Self-assessments (SA). Refer to section 9.1.4 for information on when a self-assessment is open for submission. (Full instructions on how to access self-assessments are given under section 9.3.4 above.) Assignment 05 06 07 08 09 30 Type SA – Ch1 SA – Ch2 SA – Ch3 SA – Ch4 SA – Ch5 Unique No. 886737 642921 622240 667409 721441 Due Date 2019 09 Sep 09 Sep 17 Sep 17 Sep 27 Sep Weight 5% 5% 5% 5% 5% EACH: INF2603/101 10 11 SA – Ch6 SA – Ch7 Year Mark Contribution 649519 781147 27 Sep 27 Sep 5% 5% 35% 9 EXAMINATION Use your Study @ Unisa brochure for general examination guidelines and examination preparation guidelines. Module-specific examination guidelines will be posted through myUnisa. 10 FREQUENTLY ASKED QUESTIONS The Study @ Unisa brochure contains an A–Z guide of the most relevant study information. 11 SOURCE CONSULTED Coronel, C & Morris, S. 2019. Database systems: Design, implementation, and management. 13th edition. Cengage Learning EMEA, 13: 978-1-337-62790-0 / 9781337627900 10:1-33762790-9. © 2018 Unisa 31