Relational algebra pls. Appreciate it!(Queries are
detailed)
Answer is as follows :
Relational Algebra for given scenarios are :
Answer 1 :
In this we get to know that we need four tables i.e. Drinker, Likes, Frequents and Servers.
Drinker is used to get data about drinker, Likes defines the beer he/she likes, Frequents finds the corresponding bar and servers helps to find the only corresponding bars.
drinker.name, drinker.address ( Drinker Likes Frequents Serves) drinker.name = likes.drinker likes.drinker = frequents.drinker frequents.beer = servers.beer ;
Answer 2 :
In this we get to know that we need four tables i.e. Drinker, Likes, Frequents
Drinker is used to get data about drinker, Likes defines the beer he/she likes, Frequents finds the corresponding bar. For every bar details, we get bar names form frequents table too.
drinker.name, drinker.address ( Drinker Likes Frequents) drinker.name = likes.drinker likes.drinker = frequents.drinker ;
Answer 3 :
In this we need only two tables i.e. Drinker and Likes and Frequents
Drinker is used to get data about drinker and Likes to find the which beer drink by Amy. Frequents used to find same match of same beers which liked by Amy.
drinker.name, drinker.address ( Drinker Likes ) likes.drinker = "Amy" likes.beer = frequents.drinker ;
if there is any query please ask in comments..
Relational algebra pls. Appreciate it!(Queries are detailed) Consider the following relational database that stores information about...
Consider a database with the following schema.BARS(name,license,city,phone,addr);BEERS(name,manf);DRINKERS(name,city,phone,addr);LIKES(drinker,beer); FREQUENTS(drinker,bar); SELLS(bar,beer,price); Return SQL code for the following queries.1. Find all distinct drinkers whose phone numbers come from area code 917 and who like Budweiser or Bud (synonim!)2. What beers does Mike like?3. Which town has the most drinkers?4. What bars are frequented by drinkers from that town (3)?5. Provide all bars which serve beers that Mike likes6. Who likes the at least one same beer that Joe or Mike like?7. All bars...
Consider a database with the following schema. LIKES(drinker,beer); /* key: all columns */ FREQUENTS(drinker,pub); /* key: all columns */ SERVES(pub,beer,cost); /* key: (pub,beer) */ Write the following queries in relational algebra. You can use the math notation (greek letters sigma, pi, etc.) or the ASCii "linear" notation I used in class. In order to make things more clear, please use intermediate results defined with the assignment notation in the algebra: R(a,b) := <rel-alg expression>. Try to give meaningful names for...
Consider following relational database schema and translate the queries ‘a’ and ‘b’ into relational algebra expressions Teacher(ID, Name, Designation, Phone, Address) Course(CourseCode, CourseName, CreditHour) Taught(TeacherID, CourseCode, Semester) a. SELECT Name, Address FROM Teacher, Taught WHERE Teacher.ID=Taught.TeacherID and CourseCode=’IT344’ b. SELECT CourseName FROM Course, Taught WHERE Course.CourseCode=Taught.CourseCode and TeacherID=200
Translate the following queries into extended Relational Algebra (Use COUNT to do this one) Find every person who is skilled in the manufacture of every product manufactured by 111-22-3333. company(co_name, govt id, ceo_ssn, hq_loc) division(co id, div name, subdiv_of, dir_ssn, div_hq) site(co id, divname, loc) product(prod id, manuf co, manuf_div, loc, prod_descr) person(ssn, name, address) works_for(ssn, co id, div_name, salary, emp_id, sup_ssn) skill(ssn, prod id, manuf co company(co_name, govt id, ceo_ssn, hq_loc) division(co id, div name, subdiv_of, dir_ssn, div_hq) site(co...
Given the following relational database schema (primary keys are bold and underlined). Answer questions 2.1 to 2.4 Orders(orderld, customerld, dateOrdered, dateRequired, status) Customer(customerld, customerLastName, customerStreet, customerCity, customerState, customer Lip OrderDetails(orderld.productld, quantity, lineNumber, amount) Products(productld, name, description, quantity, unitPrice) Account(accountNumber, customerld, dateOpened, creditCard, mailingStreet, mailingCity, mailingState, mailingZip) 2.1 (2 Points) List all possible foreign keys. For each foreign key list both the referencing and referenced relations. 2.2 (2 Points) Devise a reasonable database instance by filling the tables with data of...