Consider the following relational schema, representing five relations describing shopping transactions and information about credit cards...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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, Card TypeCARDTYPE, 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. Notation Underlined Superscript name of relation Example A or A, B A" or A", B Meaning The attribute(s) is (are) a primary key The attribute(s) is (are) a foreign key referencing relation R As an example, the schema R(A, B, C, D, ES) S(E, 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)) 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, Card TypeCARDTYPE, 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. Notation Underlined Superscript name of relation Example A or A, B A" or A", B Meaning The attribute(s) is (are) a primary key The attribute(s) is (are) a foreign key referencing relation R As an example, the schema R(A, B, C, D, ES) S(E, 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))
Expert Answer:
Related Book For
Posted Date:
Students also viewed these databases questions
-
In what ways are investment institutions and commercial banks different?
-
Consider the following relational schema and SQL query. The schema captures information about employees, departments, and company finances (organized on a per department basis). Emp(eid: integer,...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Prepare a statement of cash flows in proper form using the inflows and outflows from questions 4-15. Assume net income (earnings after taxes) from the 2018 income statement was $10,628, and $5,000 in...
-
Convert each of the following molecular models into skeletal structure, and give the formula of each. Only the connections between atoms are shown; multiple bonds are not indicated (gray = C, red ?...
-
In the MCRF, Ui = 0. Why can't we assume Ui,( = 0?
-
Rawls was not writing his Theory of Justice and Justice as Fairness for executives working in corporations but rather for government institutions forming public policy. Explain how the equal liberty...
-
Otay Lakes Park is a private camping ground near the Mount Miguel Recreation Area. It has compiled the following financial information as of December 31, 2017. Instructions (a) Determine Otay Lakes...
-
1 What is HRM? Explain the Functions of HRM? 2 What is HRP? Explain the process of HRP? 3 4 5 6 7 What is Recruitment? Explain the factors affecting Recruitment. What are the different Sources of...
-
Lucy loves to play the Hop, Skip, and Jump game. Given an N*M matrix and starting from the cell (1,1), her challenge is to hop in an anti-clockwise direction and skip alternate cells. The goal is to...
-
A particle moves in the plane according to the law x=t^2, y=2r6t. Find the slope of the tangent line when t=0.
-
One _____________ moving testimony caused the jury _____________ enough doubt to acquit. a. witnesses, members b. witnesss, members c. witnesss, members For the above sentence, write the correct...
-
Twitter may not be the first social media site you consider for posting your rsum. Savvy candidates, however, know that Twitter has one major advantage over more obvious sites such as LinkedIn and...
-
a. The deadline for the project was moved up three days. Which means that our team must work overtime. b. Tyrese supervises shipping, Gabriela manages the Legal Department. c. No stock prices were...
-
Your orderMr.Wongwill be sent from Kansas CityMissourion September 1. For the above sentence, insert any necessary commas. Count the number of commas you add. Write that number in the space provided....
-
The construction of the U.S. interstate highway system began in 1956 and has spawned many new industries. For the above sentence, insert any necessary commas. Count the number of commas you add....
-
SP6-1. (a) A very long, prismatic elastic shaft of circular cross section is embedded in an elastic medium. When a length dx of the shaft rotates an amount 8, the medium applies torque kedx to the...
-
Complete the following acid-base reactions: (a) HCCH + NaH
-
Visit ten Web sites that sell products or services, and record the URL of each. Evaluate each sites published privacy policy in terms of the condition needed for compliance with the Safe Harbor...
-
If management control and strategic planning decisions do not receive a high level of support from traditional information systems, then how do they get the support?
-
What functions should be separated to segregate record keeping from asset custody?
-
In the FRED database, find a variable that is available in both a seasonally adjusted form and a not seasonally adjusted form. Plot both over time and describe how large the seasonal variation in the...
-
An economic variable is persistent if declines in the variable tend to be followed by more declines, and increases by more increases. This question asks you to study the persistence of the civilian...
-
It has been argued that the stock market predicts recessions. Using quarterly data since 1961, plot the real value of the stock market index (the Wilshire 5000 index in the last month of the quarter...
Study smarter with the SolutionInn App