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, Exchange Rate, CardNbrCREDITCARD, StoreldSTORE) CREDITCARD (CardNbr, CardTypeCARDTYPE, 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)

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
JANUARY
DATA MANAGEMENT
SHORTAND NOTATION FOR RELATIONAL SQL TABLES
Notation
Underlined
Example
Meaning
The attribute(s) is
(are) a primary key
The attribute(s) is
(are) a foreign key
referencing
relation R
CREATE TABLE R
A or A, B
A cany SQL type>,
B cany SQL type>,
C cany SQL type>,
D cany SQL type>,
E cany SQL type>,
A or A", B*
Superscript name
of relation
PRIMARY KEY(A),
As an example, the schema
FOREIGN KEY (E) REFERENCES S(F)
):
R(A, B, C, D, E')
S(E, G, H)
CREATE TABLE S
F <any SQL type>,
G cany 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, CardNbrREDITCARD, StoreldSTORE)
CREDITCARD (CardNbr, CardTypeCARDTYPE, 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 occur in each store? (provide the minimum and the maximum number)
1.2. How many credit cards with the same owner and the same type can exist? (provide the minimum
and the maximum number)
2) Write the SQL query representing the following request:
2.1. Determine the number and the expire date of the credit cards with a limit equal to 2.000, that have
not generated any transaction in 2022.
Transcribed Image Text:JANUARY DATA MANAGEMENT SHORTAND NOTATION FOR RELATIONAL SQL TABLES Notation Underlined Example Meaning The attribute(s) is (are) a primary key The attribute(s) is (are) a foreign key referencing relation R CREATE TABLE R A or A, B A cany SQL type>, B cany SQL type>, C cany SQL type>, D cany SQL type>, E cany SQL type>, A or A", B* Superscript name of relation PRIMARY KEY(A), As an example, the schema FOREIGN KEY (E) REFERENCES S(F) ): R(A, B, C, D, E') S(E, G, H) CREATE TABLE S F <any SQL type>, G cany 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, CardNbrREDITCARD, StoreldSTORE) CREDITCARD (CardNbr, CardTypeCARDTYPE, 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 occur in each store? (provide the minimum and the maximum number) 1.2. How many credit cards with the same owner and the same type can exist? (provide the minimum and the maximum number) 2) Write the SQL query representing the following request: 2.1. Determine the number and the expire date of the credit cards with a limit equal to 2.000, that have not generated any transaction in 2022.
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