Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

data base write 2 of the queries should be answered by scanning a single Relation., 2 of the queries should involve two Relations. ,2 of

data base
write 2 of the queries should be answered by scanning a single Relation., 2 of the queries should involve two Relations.
,2 of the queries should involve three Relations. in each of the following :
1 )Implement the following types of queries in SQL (at least 2 queries for each category) (a) retrieve all the tuples of a relation. Display all the attribute values.
(b) retrieve all the tuples of a relation. Display some but not all attribute values. (c) retrieve the tuples that satisfy some condition.
(d) retrieve the tuples that satisfy some condition. Query should include the LIKE
operator.
(e) retrieve the tuples that satisfy some condition. Output should be sorted - sorting on a single attribute.
(f) retrieve the tuples that satisfy some condition. Output should be sorted - sorting on more than one attribute.
(g) implement a query that groups a relation on a specific attribute, and applies SUM,
COUNT, MIN, MAX aggregate functions on each group.
2)I Implement the following types of queries in SQL (at least 2 queries for each category):
(a) a JOIN combining 2 relations.
(b) a JOIN combining 3 relations.
(c) a CROSS JOIN
(d) A SELF JOIN (if it makes sense for your database).
Implement the following types of queries in SQL (at least 2 queries for
each category):
(a) a Subquery.
(b) a Corelated Subquery.
(c) UNION.
(d) UNION ALL.
(e) INTERSECT. (f) EXCEPT
image text in transcribed
image text in transcribed
E-R Diagram for Insurance Company 1. Relahonal sehemia 1. niddress (strectAddress (PK), ZIPCPK, city, state) 2. Apent (neent-id (pK), user-name, first-name, last hamg streeliddres (FK) - Apent-phone (Agent-id (FK) phore) - custamer ccust-id(PK), SSN, Firathrome, lat rame, DL uem, phone, DOb, - Policy (policuen oceet Fiddress (FX),21p(FK), Acent-id (FX) ) 6. policy (policy - num ( KK), type(PK), coverage, deduchible, cust -id (AK)) . Home policy (policy. nom (FX)) 3. peyment ( payment - nam (PK), payment, date, payment Amount, policy - num(FK), type (FK)) a. House (House-id (PK), housecost, floor, year_build, occupants, street niddies (FK), z1P (FK), 1 tome-policy-num (FK)) 10. Car(Vinu (PK), color, make, model, doors, lic-plate, yeer, nutapolig - num (FK)) 11. Accident (Report_num(PK), dake) 12. wos. in Accident Relationship (Report_.num(FK), VIN (FK ), is to - Had, accident (cust-id (FK), Report.num (FK), is.fault)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2016 Riva Del Garda Italy September 19 23 2016 Proceedings Part 3 Lnai 9853

Authors: Bettina Berendt ,Bjorn Bringmann ,Elisa Fromont ,Gemma Garriga ,Pauli Miettinen ,Nikolaj Tatti ,Volker Tresp

1st Edition

3319461303, 978-3319461304

More Books

Students also viewed these Databases questions

Question

8. Explain the relationship between communication and context.

Answered: 1 week ago

Question

d. How were you expected to contribute to family life?

Answered: 1 week ago