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 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 202

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

J

SHORTAND NOTATION FOR RELATIONAL SQL TABLES

Notation Example Meaning

Underlined A or A, B The attribute(s) is

(are) a primary key

Superscript name

of relation

AR or AR, BR The attribute(s) is

(are) a foreign key

referencing

relation R

As an example, the schema

R(A, B, C, D, ES)

S(F, G, H)

corresponds to the following SQL tables:

CREATE TABLE R

( A <any SQL type>,

B <any SQL type>,

C <any SQL type>,

D <any SQL type>,

E <any SQL type>,

PRIMARY KEY(A),

FOREIGN KEY (E) REFERENCES S(F)

);

CREATE TABLE S

( F <any SQL type>,

G <any SQL type>,

H <any SQL type>,

PRIMARY KEY(F))

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 (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 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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
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