Вы находитесь на странице: 1из 4

Database Design and Modeling

SWS 213
Assignment 1

Description

This lab is targeted to practice Chapter 4 of your Textbook.

 This lab is an individual assignment. In other word, the submitted solution should be your
individual work.
 To answer questions group study and group chat are extremely recommended.
 Remember if you copy the solution from other student you will not credited and will be
penalized accordingly.

Exercise

Use Oracle SQL Developer to create the following tables and insert some records in each table.

The following tables form part of a database held in a relational DBMS:

Hotel (hotelNo, hotelName, city)

Room (roomNo, hotelNo, type, price)

Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo)

Guest (guestNo, guestName, guestAddress)

where Hotel contains hotel details and hotelNo is the primary key;

Room contains room details for each hotel and (roomNo, hotelNo) forms the primary key;

Booking contains details of the bookings and (hotelNo, guestNo, dateFrom) forms the primary key;

and Guest contains guest details and guestNo is the primary key.
Submission

Template to be submitted by a Microsoft Word document. The Name of the document should be:

Lastname_Firstname_Lab1.docx

<In the document include>

First Name:

Last Name:

Student Id:

The user name is used for Oracle SQL Developer:

The password is used for Oracle SQL Developer:

A screenshot from “Connection” which shows your database contains 4 tables.

Screenshots of the 4 tables which includes:

The design of the tables including:

1. “Columns”
2. “Data”:

3. “Model”:

4. “Constraints”:

5. “Indexes”:

6. “SQL”: (this is text data; thus copy text and past it here)

CREATE TABLE "SWS213_F19_001_1"."TEST"


( "ID" NUMBER(*,0) NOT NULL ENABLE,
"NAME" VARCHAR2(20 BYTE) NOT NULL ENABLE,
CONSTRAINT "TEST_PK" PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS" ENABLE
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS" ;

Вам также может понравиться