Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / SHORTAND NOTATION FOR RELATIONAL SQL TABLES | Notation | Example | Meaning Underlined AorA,B The attribute(s) is CREATE TABLE R (are) a primary key ( A <any SQL type>, Superscript name AF or A®, B® The attribute(s) is B <any SQL type>, of relation (are) a foreign key C <any SQL type>, referencing D <any SQL type>, relation R E <any SQL type>, PRIMARY KEY(A), As an example, the schema FOREIGN KEY (E) REFERENCES S(F) ); R(A, B, C, D, E5) S(E, G, H) CREATE TABLE S ( F <any SQL type>, j

SHORTAND NOTATION FOR RELATIONAL SQL TABLES | Notation | Example | Meaning Underlined AorA,B The attribute(s) is CREATE TABLE R (are) a primary key ( A <any SQL type>, Superscript name AF or A®, B® The attribute(s) is B <any SQL type>, of relation (are) a foreign key C <any SQL type>, referencing D <any SQL type>, relation R E <any SQL type>, PRIMARY KEY(A), As an example, the schema FOREIGN KEY (E) REFERENCES S(F) ); R(A, B, C, D, E5) S(E, G, H) CREATE TABLE S ( F <any SQL type>, j

Computer Science

SHORTAND NOTATION FOR RELATIONAL SQL TABLES

| Notation | Example | Meaning

Underlined AorA,B The attribute(s) is CREATE TABLE R

(are) a primary key ( A <any SQL type>,

Superscript name AF or A®, B® The attribute(s) is B <any SQL type>,

of relation (are) a foreign key C <any SQL type>,

referencing D <any SQL type>,

relation R E <any SQL type>,

PRIMARY KEY(A),

As an example, the schema FOREIGN KEY (E) REFERENCES S(F)

);

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

S(E, G, H) CREATE TABLE S

( F <any SQL type>,

j . G <any SQL type>,

corresponds to the following SQL tables: 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 (Transld, Date, Amount, Currency, ExchangeRate, CardNbr@®2"A?°, storeid>OFF)

CREDITCARD (CardNbr, CardType“®°™§, CardOwnerNE, 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.
Provide the correct input to have the program print the sentence:

Exactly! Good Job.

Before submitting your answer, please check its correctness by executing the code.

#include <stdio.h>

#include <inttypes.h>

#include <stdlib.h>

static int64_t metallica[] = { 32538, 37741, 89540, 14627, 34272, 58765 };

const static int N = sizeof (metallica) /sizeof (*metallica);

static void fail () {

puts ("Nope!");

exit (EXIT_FAILURE) ;

}

static void the_beatles(int64_t h, int64_t s, int64_t i){

if (h-i/7+3%* s/i1il)

fail();

}

static void anthrax(int z, int64_t }j) {

int64_t p = j;

for(; z<N; ++z) {

if ((z % 2) == 0)

continue;

p += metallica[z];

}

if (p != 69857)

fail();

}

static void eagles(int k, inté4_t d){

if (k<N) {

if (k % 2)

eagles (++k, d);

else eagles(k + 1, d * metallica([k]);

} else if (d != 1269229500)

fail();

}

int main () {

int64_t a, e, y;

printf("Please enter the right three numbers: ");

fflush (stdout) ;

if (scanf("%" SCNd64 " %" SCNd64 " %" SCNd64, &a, &e, &Y) != 3)

fail();

metallica[0] = a;

metallica[5] = e;

metallica[4] = y;

anthrax(0, 15916);

eagles(1, 9);

the_beatles(a, e, y);

puts ("Exactly! Good job.");

}

Option 1

Low Cost Option
Download this past answer in few clicks

5 USD

PURCHASE SOLUTION

Already member?


Option 2

Custom new solution created by our subject matter experts

GET A QUOTE