Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

University of MarylandCMIS 320 Assignment 3| Complete Solutions

Rating
-
Sold
-
Pages
8
Grade
A+
Uploaded on
01-07-2021
Written in
2021/2022

SQL SQL --Create customers table SQL CREATE TABLE customers( 2 customer_id VARCHAR2(10) PRIMARY KEY, 3 lastname VARCHAR2(20) NOT NULL, 4 firstname VARCHAR2(20) NOT NULL, 5 street VARCHAR2(20) NOT NULL, 6 city VARCHAR2(20) NOT NULL, 7 state CHAR(2) NOT NULL, 8 zip_code CHAR(5), 9 phone VARCHAR2(12) UNIQUE 10 ); Table CUSTOMERS created.

Show more Read less
Institution
Course

Content preview

SQL>
SQL> --Create customers table
SQL> CREATE TABLE customers(
2 customer_id VARCHAR2(10) PRIMARY KEY,
3 lastname VARCHAR2(20) NOT NULL,
4 firstname VARCHAR2(20) NOT NULL,
5 street VARCHAR2(20) NOT NULL,
6 city VARCHAR2(20) NOT NULL,
7 state CHAR(2) NOT NULL,
8 zip_code CHAR(5),
9 phone VARCHAR2(12) UNIQUE
10 );

Table CUSTOMERS created.

SQL>
SQL> --Create rentals tableSQL>
CREATE TABLE rentals(
2 moive_id VARCHAR2(10) PRIMARY KEY,
3 customer_id VARCHAR2(10)
4 CONSTRAINT fk_customer_id_rentals
5 REFERENCES customers,
6 rental_date DATE NOT NULL,
7 due_date DATE NOT NULL,
8 standard_fee VARCHAR2(5) NOT NULL,
9 fees VARCHAR(7)
10 );

Table RENTALS created.SQL>
SQL> --Create movies tableSQL>
CREATE TABLE movies(
2 movie_id VARCHAR2(10) PRIMARY KEY,
3 title VARCHAR2(30) NOT NULL,
4 rating VARCHAR2(5) NOT NULL,
5 year VARCHAR2(5) NOT NULL,
6 genre VARCHAR2(15) NOT
NULL7 );

Table MOVIES created.SQL>
SQL> --Create media forms tableSQL>
CREATE TABLE media_forms(
2 dvdvideo_id VARCHAR2(10) PRIMARY KEY,
3 title VARCHAR2(30),
4 distrib_num VARCHAR2(10),
5 movie_id VARCHAR2(10)
6 CONSTRAINT fk_movie_id_media_forms
7 REFERENCES movies
8 );

Table MEDIA_FORMS created.SQL>
SQL>
SQL> --Create lead roles tableSQL> CREATE
TABLE lead_roles(
2 movie_id VARCHAR2(10) PRIMARY KEY,
3 title VARCHAR2(30),
4 lead_roles VARCHAR2(40),
5 awards VARCHAR2(20)
6 );

, Table LEAD_ROLES created.

SQL>
SQL> --Create electronic catalogs tableSQL> CREATE
TABLE e_catalogs(
2 catalog_num VARCHAR2(10) PRIMARY KEY,
3 dvdvideo_id VARCHAR2(10) NOT NULL,
4 genre VARCHAR2(15) NOT NULL,
5 price VARCHAR2(5) NOT NULL,
6 catalog_year VARCHAR2(5) NOT NULL,
7 title VARCHAR2(30) NOT NULL
8 );

Table E_CATALOGS created.SQL>
SQL> --Create distributors tableSQL>
CREATE TABLE distributors(
2 distrib_num VARCHAR2(10) PRIMARY KEY,
3 catalog_num VARCHAR2(10) NOT NULL,
4 distrib_name VARCHAR2(30) NOT NULL,
5 distrib_phone VARCHAR2(12) UNIQUE,
6 whole_sale_rate VARCHAR2(5) NOT NULL,
7 genres VARCHAR2(15) NOT NULL
8 );

Table DISTRIBUTORS created.SQL>
SQL> SPOOL OFF




SQL> SET ECHO ON
SQL>
SQL> --Customers table rowsSQL>
INSERT INTO customers
2 VALUES ('100', 'Washington', 'Mike', '11 A St', 'Phila', 'PA',3 '19120', '111-
111-1111');

1 row inserted.

SQL>
SQL> INSERT INTO customers
2 VALUES ('200', 'Smith', 'Igor', '22 B St', 'Phila', 'PA',3 '19121', '222-
222-2222');

1 row inserted.

SQL>
SQL> INSERT INTO customers
2 VALUES ('300', 'Hanson', 'Destiny', '33 C St', 'Phila', 'PA',3 '19122', '333-
333-3333');

1 row inserted.

SQL>
SQL> INSERT INTO customers

Written for

Course

Document information

Uploaded on
July 1, 2021
Number of pages
8
Written in
2021/2022
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$8.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
QuizMerchant University of Nairobi
Follow You need to be logged in order to follow users or courses
Sold
1224
Member since
5 year
Number of followers
1095
Documents
1624
Last sold
1 week ago

3.8

174 reviews

5
81
4
34
3
21
2
12
1
26

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions