INF3707. Tutorial Letter 201/02/2018. Database Design and Implementation. Semesters 2: Assignment 01 solutions. School of Computing

Similar documents
Database Design and Implementation

CHAPTER4 CONSTRAINTS

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

Creating and Managing Tables Schedule: Timing Topic

Lab # 2. Data Definition Language (DDL) Eng. Alaa O Shama

SQL: Concepts. Todd Bacastow IST 210: Organization of Data 2/17/ IST 210

SQL Functionality SQL. Creating Relation Schemas. Creating Relation Schemas

Oracle Academy Amazing Books Part 1: Building Tables and Adding Constraints

SQL Data Definition and Data Manipulation Languages (DDL and DML)

IMPORTANT INFORMATION: This tutorial letter contains the assignments for 2018, semesters 1 and 2.

BraindumpsVCE. Best vce braindumps-exam vce pdf free download

Introduction to Computer Science and Business

Lab # 4. Data Definition Language (DDL)

Solved MCQ on fundamental of DBMS. Set-1

ITCertMaster. Safe, simple and fast. 100% Pass guarantee! IT Certification Guaranteed, The Easy Way!

Oracle Database 10g: Introduction to SQL

CSC Web Programming. Introduction to SQL

Database Management Systems,

Oracle 1Z Oracle Database 12c SQL. Download Full Version :

Course Outline Faculty of Computing and Information Technology

Course Outline and Objectives: Database Programming with SQL

The University of Nottingham

SQL Interview Questions

ICT3621. Tutorial Letter 101/3/2018. Database Design. Semesters 1 and 2. School of Computing ICT3621/101/3/2018

Chapter 1 SQL and Data

SQL language. Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c)

Table of Contents. PDF created with FinePrint pdffactory Pro trial version

SQL Fundamentals. Chapter 3. Class 03: SQL Fundamentals 1

Database Foundations. 3-9 Validating Data Using Normalization. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

user specifies what is wanted, not how to find it

Concepts of Database Management Seventh Edition. Chapter 4 The Relational Model 3: Advanced Topics

CS 327E Lecture 2. Shirley Cohen. January 27, 2016

Oracle Database 12c SQL Fundamentals

normalization are being violated o Apply the rule of Third Normal Form to resolve a violation in the model

Oracle User Administration

Fundamentals of Database Systems

BCS THE CHARTERED INSTITUTE FOR IT BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT DATABASE SYSTEMS

Database Management Systems by Hanh Pham GOALS

Database Processing. Fundamentals, Design, and Implementation. Global Edition

Exam Actual. Higher Quality. Better Service! QUESTION & ANSWER

CHAPTER 11. Data Normalization

1z Oracle Database SQL Expert

Database Foundations. 5-1 Mapping Entities and Attributes. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

ADD TEXTBOOK COPIES IN DESTINY

Oracle Database 10g Express

CS317 File and Database Systems

Oracle Syllabus Course code-r10605 SQL

Module 3 MySQL Database. Database Management System

GeODin 8.2: Customising databases

5. Single-row function

CS1100: Data, Databases, and Queries QUERY CONSTRUCTION. CS1100 Microsoft Access 1

Structured Query Language. ALTERing and SELECTing

Relational Data Structure and Concepts. Structured Query Language (Part 1) The Entity Integrity Rules. Relational Data Structure and Concepts

CGS 3066: Spring 2017 SQL Reference

Chapter 4. Basic SQL. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Db2 Alter Table Alter Column Set Data Type Char

IS 331-Fall 2017 Database Design, Management and Applications

DBLOAD Procedure Reference

EGCI 321: Database Systems. Dr. Tanasanee Phienthrakul

Chapter 7. Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel

WHAT IS SQL. Database query language, which can also: Define structure of data Modify data Specify security constraints

1 INTRODUCTION TO EASIK 2 TABLE OF CONTENTS

COWLEY COLLEGE & Area Vocational Technical School

1 Writing Basic SQL SELECT Statements 2 Restricting and Sorting Data

Lab 4: Tables and Constraints

CSE 414 Introduction to Data Management. Section 2: Introduction to SQLite

COSC344 Database Theory and Applications. Lecture 5 SQL - Data Definition Language. COSC344 Lecture 5 1

Sample Question Paper

Unit 27 Web Server Scripting Extended Diploma in ICT

Getting started with Oracle

The SQL Guide to Pervasive PSQL. Rick F. van der Lans

Oracle EXAM - 1Z Oracle Database SQL Expert. Buy Full Product.

Chapter 4. Basic SQL. SQL Data Definition and Data Types. Basic SQL. SQL language SQL. Terminology: CREATE statement

MCA (Revised) Term-End Examination June, 2013 MCS-023 : DATABASE MANAGEMENT SYSTEMS. Time : 3 hours Maximum Marks : 100 (VVeightage 75%)

THE COPPERBELT UNIVERSITY

Module Contact: Dr Beatriz de la Iglesia, CMP Copyright of the University of East Anglia Version 1

8) A top-to-bottom relationship among the items in a database is established by a

Oracle 1Z0-071 Exam Questions and Answers (PDF) Oracle 1Z0-071 Exam Questions 1Z0-071 BrainDumps

Registration, Data Download, and Online Homework

KRISHNA KANTA HANDIQUI STATE OPEN UNIVERSITY Hiranya Kumar Bhuyan School of Science and Technology

In This Lecture. SQL Data Definition SQL SQL. Non-Procedural Programming. Notes. Database Systems Lecture 5 Natasha Alechina

COSC344 Database Theory and Applications. Lecture 11 Triggers

Interview Questions on DBMS and SQL [Compiled by M V Kamal, Associate Professor, CSE Dept]

Chapter-14 SQL COMMANDS

Database Processing: Fundamentals, Design, and Implementation

CISC 3140 (CIS 20.2) Design & Implementation of Software Application II

Tutorial 1. Creating a Database

Question No : 1 Which three possible values can be set for the TIME_ZONE session parameter by using the ALTER SESSION command? (Choose three.

ORACLE DATABASE 12C INTRODUCTION

Networks and Web for Health Informatics (HINF 6220)

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Database Management System 9

Oracle. SQL(Structured Query Language) Introduction of DBMS. Build In Function. Introduction of RDBMS. Grouping the Result of a Query

2.9 Table Creation. CREATE TABLE TableName ( AttrName AttrType, AttrName AttrType,... )

Course Outline. MySQL Database Administration & Design. Course Description: Pre-requisites: Course Content:

EDUVITZ TECHNOLOGIES

Database Systems Laboratory 2 SQL Fundamentals

EXAMINATION PAPER. Exam in: INF-2700 Database Systems Date: Thursday Time: Kl 15:00-19:00 Place: Åsgårdveien 9. Approved aids: None

SAS 9.3 LIBNAME Engine for DataFlux Federation Server

DATABASES SQL INFOTEK SOLUTIONS TEAM

Transcription:

INF3707/201/02/2018 Tutorial Letter 201/02/2018 Database Design and Implementation INF3707 Semesters 2: Assignment 01 solutions School of Computing This tutorial letter contains important information about your module. BARCODE

Assignment 1 Total marks Due date 25 marks (100%) Note that this is a COMPULSORY assignment! If you do not complete this assignment and submit it by the due date, you will not gain examination entry! 1. Which of the following software is used to create and maintain the physical database? 1. Data mining 2. Database Management System (DBMS) 3. E-R Model 4. Systems Development Life Cycle (SDLC) 2. Which of the following may contain transitive dependencies, but not partial dependencies? 1. Unnormalized data 2. First normal form (1NF) 3. Second normal form (2NF) 4. Third normal form (3NF) Answer 3 3. Which of the following represents a field in a table? 1. A record 2. A row 3. Column 4. An entity Answer 3 4. To indicate which database table contains the data to be selected by a query, the table name should be listed in which clause. 1. WHERE 2. SELECT 3. HAVING 4. FROM ANSWER: 4 5. If the results of a SELECT statement include more than one column of data, the column names must be separated in the SELECT clause by which of the following symbols? 1. " " 2. ' ' 3. * 4., ANSWER: 4 2

INF3707 6. Which of the following will display the new retail price of each book as 20 percent more than it originally cost? 1. SELECT title, retail*.2 "New Retail Price" FROM books 2. SELECT title, retail+.20 "New Retail Price" FROM books; 3. SELECT title, cost*.20 "New Retail Price" FROM books; 4. SELECT title, cost*1.20 "New Retail Price" FROM books; 7. Which keywords are used to complete the deletion of a column previously marked with SET UNUSED? 1. DELETE UNUSED COLUMNS 2. DROP UNUSED COLUMNS 3. UNSET UNUSED COLUMNS 4. DROP SET COLUMNS ANSWER: 2 8. Which command instructs Oracle 12c to create a new table from existing data? 1. CREATE NEW TABLE 2. CREATE TABLE...FROM 3. CREATE TABLE 4. CREATE TABLE...AS 9. Which of the following keywords cannot be used to modify an existing table? 1. ALTER TABLE...ADD 2. ALTER TABLE...DROP COLUMN 3. ALTER TABLE...MODIFY 4. ALTER TABLE...AS 10. Which of the following rules does not apply to column names in Oracle 12c? 1. Column names can contain numbers. 2. Column names can be up to 30 characters in length. 3. Column names must begin with a letter. 4. Column names can contain an ampersand (&). ANSWER: 4 11. Which of the following commands changes a table s name from OLDNAME to NEWNAME? 1. RENAME oldname TO newname 2. REMANE table FROM oldname TO newname 3. ALTER TABLE oldname MODIFY TO newname 4. CREATE TABLE newname (SELECT * FROM oldname) Answer 1 12. Which of the following statements about creating constraints is incorrect? 1 If you do not provide a name for a constraint, the Oracle 12c server 3

will issue an error message. 2. There are two approaches for creating constraints: at the column level or the table level. 3. One industry convention is to use the format tablename_columnname_constraint type for the constraint name. 4. none of the above ANSWER: 1 13. If a PRIMARY KEY constraint, named ORDERITEMS_PK, exists for the ORDER# and ITEM# columns of the ORDERITEMS table, which of the following commands will disable the constraint? 1. ALTER TABLE orderitems DISABLE PRIMARY KEY CONSTRAINT; 2. ALTER TABLE orderitems DISABLE CONSTRAINT orderitems_pk; 3. ALTER TABLE orderitems REMOVE PRIMARY KEY CONSTRAINT; 4. ALTER TABLE orderitems MODIFY PRIMARY KEY CONSTRAINT DISABLE; ANSWER: 2 14. Which of the following datatypes refers to fixed-length character data, where n represents the maximum length of the column? 1. CHAR(n) 2. VARCHAR(n) 3. VARCHAR2(n) 4. LONG ANSWER: 1 15. If a PRIMARY KEY constraint, named ORDERITEMS_PK, exists for the ORDER# and ITEM# columns of the ORDERITEMS table, which of the following commands will drop the constraint? 1. ALTER TABLE orderitems DROP PRIMARY KEY CONSTRAINT; 2. ALTER TABLE orderitems DELETE CONSTRAINT orderitems_pk; 3. ALTER TABLE orderitems DROP PRIMARY KEY; 4. ALTER TABLE orderitems MODIFY PRIMARY KEY CONSTRAINT DROP; ANSWER: 3 16. Based on the structure of the ORDERITEMS table, which of the following commands will make certain that the ISBN entered actually exists in the ISBN column of the BOOKS table? 1. ALTER TABLE orderitems ADD FOREIGN KEY isbn REFERENCES BOOKS TABLE (isbn); 4

2. ALTER TABLE orderitems MODIFY FOREIGN KEY (isbn) REFERENCES books(isbn); 3. ALTER TABLE orderitems CREATE FOREIGN KEY (isbn) REFERENCES books(isbn); 4. ALTER TABLE orderitems ADD FOREIGN KEY (isbn) REFERENCES books(isbn); 17. Which of the following commands is used to add data to an existing row in a table? 1. ADD 2. UPDATE 3. INSERT 4. MODIFY 18. Which keywords create a shared lock on a table to prevent another user from making changes to data in specified columns? 1. SELECT...LOCK 2. SELECT...COMMIT 3. SELECT...FOR UPDATE 4. SELECT...FOR CHANGE ANSWER: 3 19. Contents of the PUBLISHER table INF3707 Which of the following commands will delete only publisher 4 from the PUBLISHER table? 1. DELETE FROM publisher; 2. DELETE pubid = 4 FROM publisher; 3. DROP FROM publisher WHERE pubid = 4; 4. DELETE FROM publisher WHERE pubid = 4; 20. Based on the contents of the PUBLISHER table, which of the following will add a new record to the table? 1. INSERT INTO publisher VALUES ('BOOKS MADE CHEAP', '800-111-2222'); 2. INSERT INTO publisher (pubid, name) VALUES (6, 'BOOKS MADE CHEAP'); 3. UPDATE publisher 5

VALUES ('BOOKS MADE CHEAP', '800-111-2222'); 4. UPDATE publisher (pubid, name) VALUES (6, 'BOOKS MADE CHEAP'); 21. Which of the following commands is used to create a function-based index? 1. CREATE FUNCTION INDEX...ON 2. CREATE INDEX...ON 3. CREATE INDEX...FOR 4. CREATE INDEX...FUNCTION 22. Which of the following methods is not used in an INSERT statement to enable the use of a DEFAULT sequence value defined for a column? 1. Use the DEFAULT keyword 2. Do not include the column 3. Use NEXTVAL to call the value 4. All of the above Answer 3 23. Which of the following commands are used to create a user account? 1. CREATE NEW USER username IDENTIFIED BY password; 2. CREATE USERNAME username IDENTITY password; 3. CREATE USER username PASSWORD password; 4. CREATE USER username IDENTIFIED BY password; answer 4 24. Which command will delete a user account from a database? 1. DELETE USER username; 2. DELETE USER username IDENTIFIED BY password; 3. DROP USER username IDENTIFIED BY password; 4. DROP USER username; 25. Which of the following SQL statements will create a new role named PRCLERK? 1. CREATE prclerk; 2. CREATE ROLE prclerk; 3. CREATE ROLE prclerk ON payroll; 4. CREATE ROLE prclerk WITH SELECT ANY TABLE PRIVILEGE; 6