THE AUSTRALIAN NATIONAL UNIVERSITY. Mid-Semester Examination August 2006 RELATIONAL DATABASES (COMP2400)

Similar documents
Information Systems for Engineers. Exercise 10. ETH Zurich, Fall Semester Hand-out Due

Programming and Database Fundamentals for Data Scientists

Relational Algebra. Spring 2012 Instructor: Hassan Khosravi

COMP102: Introduction to Databases, 5 & 6

Data Definition Language (DDL), Views and Indexes Instructor: Shel Finkelstein

Comp2310 & Comp6310 Systems, Networks and Concurrency

Database Modifications and Transactions

AC61/AT61 DATABASE MANAGEMENT SYSTEMS DEC 2013

SQL queries II. Set operations and joins

EECS-3421a: Test #2 Queries

Exam I Computer Science 420 Dr. St. John Lehman College City University of New York 12 March 2002

Relational Model, Key Constraints

ISYS1055/1057 Database Concepts Week 9: Tute/Lab SQL Programming

COMP302. Database Systems

Information Systems Engineering. SQL Structured Query Language DDL Data Definition (sub)language

Information Systems Engineering. SQL Structured Query Language DML Data Manipulation (sub)language

Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa

Database Systems, CSCI Exam #2 Thursday November 4, 2010 at 2 pm

2. E/R Design Considerations

CSE-3421 Test #1 Design

Midterm 1 157A Fall /22

Database Systems CSE 303. Lecture 02

Database Systems CSE 303. Lecture 02

Summer Examinations 2015

Task: Design an ER diagram for that problem. Specify key attributes of each entity type.

SAMPLE FINAL EXAM SPRING/2H SESSION 2017

EXAMINATIONS 2013 MID-YEAR SWEN 432 ADVANCED DATABASE DESIGN AND IMPLEMENTATION

CS 4320/5320 Homework 2

Set Operations, Union

Introduction to ERwin

Project 1. Yuji Shimojo CMIS 320. Instructor: Denton Guy-Williams

THE AUSTRALIAN NATIONAL UNIVERSITY Mid Semester Examination September COMP1730 / COMP6730 Programming for Scientists

Relational Databases. Charles Severance

L12: ER modeling 5. CS3200 Database design (sp18 s2) 2/22/2018

Chapter 11 Database Concepts

Chapter 4. The Relational Model

PESIT Bangalore South Campus

Database Design. Overview

1. Given the name of a movie studio, find the net worth of its president.

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus

Introduction to Databases, Fall 2005 IT University of Copenhagen. Lecture 2: Relations and SQL. September 5, Lecturer: Rasmus Pagh

Comp2310 & Comp6310 Systems, Networks and Concurrency

2018/9 Guidelines for Electronic Exam Paper Submission

ISYS1055/1057 Database Concepts Week 7: Tute/Lab SQL Programming

INFO 1103 Homework Project 2

2. (10 points) SQL. Some Quidditch League! [Exercise] Consider the Movie database with the schema in Figure 2 on page 15 for the questions below.

THE COPPERBELT UNIVERSITY

CSE-3421: Exercises. Winter 2011 CSE-3421 Exercises p. 1 of 18

Relational Model. IT 5101 Introduction to Database Systems. J.G. Zheng Fall 2011

The University Of New South Wales. Final Exam November 2006 COMP9311. Database Systems

Administration and Examination Guidelines for Holding ISEB BSD Written Examinations

Review the syntax of. Create a new Schema CREATE TABLE INSERT SELECT UPDATE DELETE

CONSTRAINTS AND UPDATES CHAPTER 3 (6/E) CHAPTER 5 (5/E)

Faculty of Environment & Technology

Computer Science Applications to Cultural Heritage. Relational Databases

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

Assignment 2. Database Implementation and Queries

THE UNIVERSITY OF BRITISH COLUMBIA CPSC 121: MIDTERM 2 Group March 12, 2014

IMPLEMENTING STATISTICAL DOMAIN DATABASES IN POLAND. OPPORTUNITIES AND THREATS. Central Statistical Office in Poland

CSE 135. Applications View of a Relational Database Management System (RDBMS) SQL. Persistent data structure. High-level API for access &modification

Name: Database Systems ( 資料庫系統 ) Midterm exam, November 15, 2006

A <column constraint> is a constraint that applies to a single column.

Information Systems Engineering. Other Database Concepts

EE221 Databases Practicals Manual

Niklas Fors The Relational Data Model 1 / 17

SQLite, Firefox, and our small IMDB movie database. CS3200 Database design (sp18 s2) Version 1/17/2018

COMP 102: Test August, 2017

UNIVERSITY OF TORONTO SCARBOROUGH WINTER 2016 EXAMINATIONS. CSC B20H3 Duration 3 hours. No Aids Allowed

High-Level Database Models. Spring 2011 Instructor: Hassan Khosravi

CSE 154 LECTURE 14: MULTI-TABLE SQL QUERIES (JOINS )

1 (10) 2 (8) 3 (12) 4 (14) 5 (6) Total (50)

15CSL58: DATABASE MANAGEMENT LABORATORY

MET CS 669 Database Design and Implementation for Business Final Project Page 1 of 19 TERM PROJECT _ FINAL. Online DVD Rental Business

The Relational Model Constraints and SQL DDL

Database Management Systems,

Data Management Lecture Outline 2 Part 2. Instructor: Trevor Nadeau

Project Risk Management Single Subject Certificate Level 2. Guide for candidates

Two hours. Please note that an OMR Sheet is attached for use with Section A: full instructions for their use are given in Section A

The appendix contains information about the Classic Models database. Place your answers on the examination paper and any additional paper used.

Convert E/R to Relation

Corporate Identity Guide

Introduction to Database Design, fall 2011 IT University of Copenhagen. Normalization. Rasmus Pagh

B.C.A DATA BASE MANAGEMENT SYSTEM MODULE SPECIFICATION SHEET. Course Outline

COMP102: Introduction to Databases, 20

CSE-3421M Test #2. Queries

Data Modelling and Databases. Exercise Session 7: Integrity Constraints

Exam. Question: Total Points: Score:

THE UNIVERSITY OF BRITISH COLUMBIA CPSC 304: MIDTERM EXAMINATION SET A OCTOBER 2016

Version: 1. Designing Microsoft SQL Server 2005 Databases

CS2 Databases TEST 1 25 August 2003 Student Number: MARK: /35

NOTE: DO NOT REMOVE THIS EXAM PAPER FROM THE EXAM VENUE

Access Intermediate

The Relational Model of Data (ii)

Joins, NULL, and Aggregation

BTEC Nationals IT - Unit2 FAQs

Introduction to Data Management. Lecture #4 (E-R Relational Translation)

SQL Simple Queries. Chapter 3.1 V3.01. Napier University

Homework 2: E/R Models and More SQL (due February 17 th, 2016, 4:00pm, in class hard-copy please)

School of Computer Science and Software Engineering. 2nd SEMESTER EXAMINATIONS 2007 CITS3240 DATABASES

COMP3311 Database Systems

Transcription:

THE AUSTRALIAN NATIONAL UNIVERSITY Mid-Semester Examination August 2006 RELATIONAL DATABASES (COMP2400) Reading Time: 10 minutes Writing Time: 1 hour Permitted Materials: One A4 sheet with notes on both sides Notes may be handwritten or printed/typed The A4 sheet may be a photocopy Total Marks: 30 If your examination paper is missing any pages, or if any pages are illegible, raise your hand and ask for another examination paper. In addition to the examination paper, you should have received a sheet of scribble paper. You may ask for more scribble paper. All answers are to be written on the examination paper. Write your student number on every page of your examination paper. Write your name on this cover sheet in UPPERCASE. At the end of the examination, hand in your A4 sheet of notes and your scribble paper as well as your examination paper. Your A4 sheet of notes and your scribble paper will be destroyed. Only the examination paper will be marked. If you are ill during the examination, or otherwise suffer adverse circumstances during the examination, advise an invigilator immediately. FAMILY NAME: GIVEN NAME: Page 1 of 10 RELATIONAL DATABASES (COMP2400)

GENERAL INSTRUCTIONS Write all your answers on the examination paper. Write your Student Number neatly, especially on the pages which contain a Part header (eg Page 3). Do not write in the boxes in the Part headers. All answers should be written legibly, preferably in blue or black ink or in very dark pencil (eg 2B). Do not write in red ink. Answer all questions in the context of the material covered in this course, including the assignments for this course. More marks will be awarded for answers that are simple, short and concrete than will be awarded for answers that are of a sketchy or rambling nature. Generally, you will receive more marks for answers that show an understanding of the material than for answers which are simply transcriptions from lecture outlines or solution notes. You may ask for clarification of anything written on this paper, especially if you suspect that there is a typographical error. However, you should not ask for help with answering any of the questions. There are no optional questions on this examination paper. Page 2 of 10 RELATIONAL DATABASES (COMP2400)

Part 1 (10 marks) 1 TRUE/FALSE Nominate whether each of the following statements is true or false by circling either True or False after each statement on this paper. You will receive You will lose 1 mark for each correct nomination; zero marks for each absent nomination. 1/2 mark for each incorrect or unclear nomination. (1) All databases are relational. (2) {h, o, b, b, i, t} is a set. (3) {x, y} is a proper subset of {x, y}. (4) A database is a collection of related data. (5) On an ER Diagram, foreign keys are written in italics. Page 3 of 10 RELATIONAL DATABASES (COMP2400)

(6) Foreign keys can never be null. (7) SELECT CourseCode, Year, COUNT(*) AS Enroled FROM Enrolment WHERE Year = 2005 GROUP BY CourseCode; will list the number of students enrolled in each course in each year. (8) SELECT StudentId FROM Enrolment WHERE Mark = MAX(Mark); will tell us which student has the highest mark. (9) When we copy a table using create table... as, the new table has the same constraints as the original table. (10) alter table allows us to add columns to a table. Page 4 of 10 RELATIONAL DATABASES (COMP2400)

Part 2 (10 marks) 2 ER DIAGRAMS You will receive up to 5 marks for your answer to the following. Using the COMP2400 Entity-Relationship modelling conventions, draw a Level Zero ER Diagram (ie do not show any attributes on your diagram) which matches the following schema. Relational Schema Album Artist Gig Musician (Album_Id, Title, Label, Year, Artist_Id) (Artist_Id, Name) (Album_Id, Musician_Id) (Musician_Id, Family_Name, Given_Name, Birth_Date, Birth_Country, Death_Date, Death_Country) Page 5 of 10 RELATIONAL DATABASES (COMP2400)

You will receive up to 5 marks for your answer to the following. Using the COMP2400 Entity-Relationship modelling conventions, draw an ER Diagram to model the information in the following scenario. ER Scenario Lord Peter Wimsey has decided to create another front for his sleuthing activities. The organisation's official business is the warehousing of whimsical gadgets of all kinds, and its name is Wimsey's Widget Warehouse (WWW). WWW sells widgets to customers. Each type of widget in the warehouse is uniquely identified by a number, and has a name, a category, a colour, and a price. WWW uniquely identifies each of its customers using an identifier created by WWW and stores the following information about each customer: name, address, phone number, email address. Page 6 of 10 RELATIONAL DATABASES (COMP2400)

Part 3 (10 marks) 3 SQL Write SQL queries to answer each of the questions on the following pages. Write one select statement for each query. Do not write any create or alter statements. The relational schemas for the tables against which the queries will be run: Actor ActsIn Customer Director Movie (ActorId, [pk] ActorName, BirthPlace, Nationality, YearBorn, YearDied, Sex) (MovieId [fk1], ActorId [fk2], [pk] StarsIn) (CustomerId, [pk] CustomerName, CustomerAddress, CustomerPhoneAH, CustomerPhoneBH) (DirectorId, [pk] DirectorName, YearBorn, YearDied) (MovieId, [pk] MovieTitle, MovieYear, Genre, CriticRating, Classification, Nominations, Awards, Length, InColor, DirectorId [fk1], StudioName [fk2], CertNoProducer [fk3]) MovieExec (CertNo, [pk] Name, Address, NetWorth) Studio Video (StudioName, [pk] Address, CertNoHead [fk]) (VideoId, [pk] StockDate, SupplierName, SoldTo [fk1], MovieId [fk2]) Simplified syntax for the SQL select command: select [distinct] <select_list> from <table_list> [where <boolean_condition>] [group by <column_list> [having <boolean_condition>]] [order by <column_list>] / Page 7 of 10 RELATIONAL DATABASES (COMP2400)

You will receive up to 5 marks for your answer to the following. (1) How many actors were born before 1984? Page 8 of 10 RELATIONAL DATABASES (COMP2400)

You will receive up to 5 marks for your answer to the following. (2) Which actors starred in the movie Gone With the Wind? Page 9 of 10 RELATIONAL DATABASES (COMP2400)

EXTRA PAPER FOR ANSWERS Clearly indicate which question(s) you are answering, from which Part(s). Page 10 of 10 RELATIONAL DATABASES (COMP2400)