Question

Design a database with the following tables Table name: Customer customer_id lastname firstname phone c10001 Smith...

Design a database with the following tables

Table name: Customer

customer_id

lastname

firstname

phone

c10001

Smith

John

714-877-2333

Table name: Video

video_id

title

daily_rent

V8752

ET

2.99

Table name: Transaction

transaction_id

customer_id

video_id

date_rented

Please create 3 tables and enter 5 records in each table using WORD

Please indicate the primary key and foreign keys of each table

Homework Answers

Answer #1

Dear Student ,

As per requirement submitted above kindly find below solution.

This demonstration is using MySQL.

1.Table Name :Customer
create table Customer(
customer_id varchar(10) primary key,
lastname varchar(50),
firstname varchar(50),
phone varchar(50));

/*inserting records*/
insert into customer values ('c10001','Smith','John','714-877-2333');
insert into customer values ('c10002','Sam','Karan','714-888-2434');
insert into customer values ('c10003','Ram','Kill','714-887-2933');
insert into customer values ('c10004','Pink','Blue','714-977-25334');
insert into customer values ('c10005','Virat','Kohli','715-777-3333');
insert into customer values ('c10006','KL','Rahul','715-778-2333');

/*selecting records from customer table*/
select * from customer;

Screen in MySQL :

**************************************

2.Table Name :Video
create table Video(
video_id varchar(10) primary key,
title varchar(50),
daily_rent decimal(6,2));

/*inserting records*/
insert into Video values ('V8752','ET',2.99);
insert into Video values ('V8753','ET1',3.99);
insert into Video values ('V8754','AT2',4.99);
insert into Video values ('V8755','QP3',5.99);
insert into Video values ('V8756','BS',6.99);
insert into Video values ('V8757','MQV',7.99);
/*selecting records from Video table*/
select * from Video;

Screen in MySQL :

********************************

3.Table Name :Transaction
create table Transaction(
transaction_id varchar(10) primary key,
customer_id varchar(10),
video_id varchar(10) ,
date_rented date,
foreign key (customer_id) references customer(customer_id),
foreign key (video_id) references video(video_id));

/*inserting records*/
insert into Transaction values ('T001','c10001','V8752','2020/06/04');
insert into Transaction values ('T002','c10001','V8753','2020/07/01');
insert into Transaction values ('T003','c10002','V8754','2020/05/04');
insert into Transaction values ('T004','c1003','V8755','2020/06/24');
insert into Transaction values ('T005','c1004','V8756','2020/07/05');

/*selecting records from Transaction table*/
select * from Transaction;

Screen in MySQL :

NOTE :PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a script to create the following tables with attributes as specified(SQL) Customer table with Customer’s...
Write a script to create the following tables with attributes as specified(SQL) Customer table with Customer’s id, name, address, city as varchar, customer’s date of birth as date type and zip code number where the customers id is the primary key in the table, name and date of birth are mandatory. Id has a 10-character limit, name, address and city have a 50-character limit, zip has a 5-character limit Product Table with Product id, description and finish as varchar, price...
You want to design a database for an automobile dealership with three locations. A vehicle's data...
You want to design a database for an automobile dealership with three locations. A vehicle's data fields include stock number (a common name for SKU (Stock Keeping Unit)), vehicle identification number (VIN), make, model, year, color and invoice cost. Identify the possible candidate keys, the likely primary key, probably foreign keys, and potential secondary keys for the Vehicle table. Identify other tables the Vehicle table might need to form a relationship (or link with).
car dealership needs to design a database for their business. It is assumed there are three...
car dealership needs to design a database for their business. It is assumed there are three tables in the database with 6 fields in each table. Give your suggestions for the most necessary fields and their proper types, propertis and PK (primary key) / FK (foreign key) You can enlarge the answer window this way. Click in the answer box, then on the bottom right of the answer box, click on the triangle of dots icon and drag the window...
Kitchen World is changing its inventory system from a file-oriented system to a relational database system....
Kitchen World is changing its inventory system from a file-oriented system to a relational database system. Identify and design at least three tables that would be needed to capture data for Kitchen World's inventory. Each table should include a primary key, three non-key attributes, and foreign keys as necessary. Make up data values for two records within each table. Create an excel spreadsheet with this data. Download it to Access and do a query for the name of the largest...
Data Modeling and Database Design Database Concepts, Eighth Edition (Kroenke, Auer, Vanderberg, Yoder) Given the data...
Data Modeling and Database Design Database Concepts, Eighth Edition (Kroenke, Auer, Vanderberg, Yoder) Given the data model shown below, please define the following: 1) Table names 2) Primary Keys for each table. If the key is composite, please indicate. 3) Foreign Keys for each table and what table/field the FK relates to. 4) Define which table is the "Parent" and is the "Child" in the relationship. EMPLOYEE(EmployeeNumber, ELastName, EFirstName, EAddress, ECity, EZipCode, EDepartCode) DEPARTMENT(DepartmentCode, DeptName, DeptDiv) DIVISION(DivisionCode, DivName, DivVP) EPHONE(PhoneID,...
Created the database and all the tables in phpMyadmin. In addition, write all the sql statements...
Created the database and all the tables in phpMyadmin. In addition, write all the sql statements used in perforing the tasks in a word document and submit that for grading. Lab 1: CREATE STATEMENT This statement is used to create a database or a table. CREATE DATABASE This statement is used to create a database Syntax: CREATE DATABASE database_name; OR CREATE SCHEMA database_name; Example: CREATE DATABASE Nyumbani; OR CREATE SCHEMA Nyumbani ; CREATE TABLE This SQL statement is used to...
Make Java program with the following tasks: 1. Create a new database called DTCC 2. Create...
Make Java program with the following tasks: 1. Create a new database called DTCC 2. Create a table called Students in the DTCC database with the following fields:     Student_ID    CHAR (10) ** make sure to set this field as the primary key     LastName      CHAR(20)     FirstName     CHAR(15)     PlanOfStudy CHAR(25)     GPA               Double 3. Insert 5 records into Students table: 899090111    Rothlisberger   Ben          CIT                                       3.7 129020202    Manning          Peyton     Computer Programming       3.8 890101030    Brady               Tom         Accounting                           3.4 980191919    Rodgers           Aaron       Networking                          3.2...
Garden Glory Project Questions Assume that Garden Glory designs a database with the following tables: OWNER...
Garden Glory Project Questions Assume that Garden Glory designs a database with the following tables: OWNER (OwnerID, OwnerName, OwnerEmail, OwnerType) OWNED_PROPERTY (PropertyID, PropertyName, PropertyType, Street, City, State, Zip, OwnerID) GG_SERVICE (ServiceID, ServiceDescription, CostPerHour); EMPLOYEE (EmployeeID, LastName, FirstName, CellPhone, ExperienceLevel) PROPERTY_SERVICE ( PropertyServiceID , PropertyID , ServiceID, ServiceDate , EmployeeID, HoursWorked) The referential integrity constraints are: OwnerID in OWNED_PROPERTY must exist in OwnerID in OWNER PropertyID in PROPERTY_SERVICE must exist in PropertyID in OWNED_PROPERTY ServiceID in PROPERTY_SERVICE must exist in ServiceID...
Consider the following information to design a database for a catalogue of an online video service...
Consider the following information to design a database for a catalogue of an online video service that offers access to popular TV series. The following is the description of the application: Each series has a name and a description. Each series has many episodes. Each episode of a series has an episode number, the date it was first aired, and the length of the episode in minutes. The episode number uniquely identifies an episode with respect to the series, but...
Book(bookID, ISBN, title, author, publish-year, category) Member(memberID, lastname, firstname, address, phone-number, limit) CurrentLoan(memberID, bookID, loan-date, due-date)...
Book(bookID, ISBN, title, author, publish-year, category) Member(memberID, lastname, firstname, address, phone-number, limit) CurrentLoan(memberID, bookID, loan-date, due-date) History(memberID, bookID, loan-date, return-date) Members can borrow books from the library. The number of books they can borrow is limited by the “limit” field of the Member relation. The category of a book includes fiction, non-fiction, children’s and reference. The CurrentLoan table represents the information about books that are currently checked out. When the book is returned to the library, the record will be...