following relational schema, representing five relations describing shopping transactions and information about credit cards generating them

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Consider the following relational schema, representing five relations describing shopping transactions and
information about credit cards generating them [the used notation is explained above].
SHOPPINGTRANSACTION (TransId, Date, Amount, Currency, ExchangeRate, CardNbrCREDITCARD, StoreIdSTORE)
CREDITCARD (CardNbr, CardTypeCARDTYPE, CardOwnerOWNER, ExpDate, Limit)
OWNER (OwnerId, Name, Surname, BirthDate, Job, IncomeLevel, Level)
CARDTYPE (CardType, Circuit, Issuer, Address, Country, CardName, Color)
STORE (StoreId, Name, Address, Country, Zone, Web, Email, Type)
1) Answer the following questions considering the domain described by the previous relational schema:
1.1. How many transactions can be generated by a given credit card? (provide the minimum and the
maximum number)
1.2. How many shopping transactions occurred in the same store can be associated with a given
identifier? (provide the minimum and the maximum number)
2) Write the SQL query representing the following request:
2.1. Determine the total number of shopping transactions, performed during the last validity day of a
credit card, whose amount coincides with the credit card limit.

APRIL
DATA MANAGEMENT
SHORTAND NOTATION FOR RELATIONAL SQL TABLES
Notation
Example
Meaning
CREATE TABLER
The attribute(s) is
(are) a primary key
The attribute(s) is
(are) a foreign key
referencing
Underlined
A or A, B
A cany SQL type>,
B <any SQL type>,
C <any SQL type>,
D <any SQL type>,
E cany SQL type>,
A" or A", B"
Superscript name
of relation
relation R
PRIMARY KEY(A),
As an example, the schema
FOREIGN KEY (E) REFERENCES S(F)
);
R(A, B, C, D, ES)
S(E G, H)
CREATE TABLES
F <any SQL type>,
G <any SQL type>,
H cany SQL type>,
PRIMARY KEY(F))
corresponds to the following SQL tables:
EXERCISE
Consider the following relational schema, representing five relations describing shopping transactions and
information about credit cards generating them [the used notation is explained above].
SHOPPINGTRANSACTION (Transld, Date, Amount, Currency, ExchangeRate, CardNbrCREDITCARD, StoreldSTORE)
CREDITCARD (CardNbr, CardTypeARDTYPE, CardowneroWNER, ExpDate, Limit)
OWNER (Ownerld, Name, Surname, BirthDate, Job, Incomelevel, Level)
CARDTYPE (CardType, Circuit, Issuer, Address, Country, CardName, Color)
STORE (Storeld, Name, Address, Country, Zone, Web, Email, Type)
1) Answer the following questions considering the domain described by the previous relational schema:
1.1. How many transactions can be generated by a given credit card? (provide the minimum and the
maximum number)
1.2. How many shopping transactions occurred in the same store can be associated with a given
identifier? (provide the minimum and the maximum number)
2) Write the SQL query representing the following request:
2.1. Determine the total number of shopping transactions, performed during the last validity day of a
credit card, whose amount coincides with the credit card limit.
Transcribed Image Text:APRIL DATA MANAGEMENT SHORTAND NOTATION FOR RELATIONAL SQL TABLES Notation Example Meaning CREATE TABLER The attribute(s) is (are) a primary key The attribute(s) is (are) a foreign key referencing Underlined A or A, B A cany SQL type>, B <any SQL type>, C <any SQL type>, D <any SQL type>, E cany SQL type>, A" or A", B" Superscript name of relation relation R PRIMARY KEY(A), As an example, the schema FOREIGN KEY (E) REFERENCES S(F) ); R(A, B, C, D, ES) S(E G, H) CREATE TABLES F <any SQL type>, G <any SQL type>, H cany SQL type>, PRIMARY KEY(F)) corresponds to the following SQL tables: EXERCISE Consider the following relational schema, representing five relations describing shopping transactions and information about credit cards generating them [the used notation is explained above]. SHOPPINGTRANSACTION (Transld, Date, Amount, Currency, ExchangeRate, CardNbrCREDITCARD, StoreldSTORE) CREDITCARD (CardNbr, CardTypeARDTYPE, CardowneroWNER, ExpDate, Limit) OWNER (Ownerld, Name, Surname, BirthDate, Job, Incomelevel, Level) CARDTYPE (CardType, Circuit, Issuer, Address, Country, CardName, Color) STORE (Storeld, Name, Address, Country, Zone, Web, Email, Type) 1) Answer the following questions considering the domain described by the previous relational schema: 1.1. How many transactions can be generated by a given credit card? (provide the minimum and the maximum number) 1.2. How many shopping transactions occurred in the same store can be associated with a given identifier? (provide the minimum and the maximum number) 2) Write the SQL query representing the following request: 2.1. Determine the total number of shopping transactions, performed during the last validity day of a credit card, whose amount coincides with the credit card limit.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY