Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please provide query and necessary views: DDL: https://www.eecs.yorku.ca/~papaggel/courses/eecs3421/docs/assignments/a2/a2.ddl SQL https://www.eecs.yorku.ca/~papaggel/courses/eecs3421/docs/assignments/a2/a2.sql Please read careful and provide answers as I need to check with my answers. Please

image text in transcribed

image text in transcribed

Please provide query and necessary views:

DDL:

https://www.eecs.yorku.ca/~papaggel/courses/eecs3421/docs/assignments/a2/a2.ddl

SQL

https://www.eecs.yorku.ca/~papaggel/courses/eecs3421/docs/assignments/a2/a2.sql

Please read careful and provide answers as I need to check with my answers. Please provide a short detail with each answer so if i get it wrong, I know where my mistakes are.I will be attaching the a2.ddl and a2.sql file if needed. Please comment if you require anything else. I will upvote best answers!

For each country, find its neighbor country with the highest elevation point. Report the id and name of the country and the id and name of its neighboring country. Output Table: query1 Attributes c1id c1name (country name) c2id c2name (neighbor country name) VARCHAR(20)] (country id) (neighbor country id) ASC [INTEGER] [VARCHAR(20)] [INTEGER] Order by: c1name In this section, you must edit the file a2.sql and add SQL statements that can be run in psql on Prisnm machines. Your SQL statements can create views and queries that will populate the result tables query1, query2, .., query10 with tuples that satisfy the questions below. In order to ensure that everything is run in the correct order (by the markers or the automarker), you should add all your SQL statements in the file a2.sl that we have provided. This file can be read and executed using the psql command i You can assume that the a2.ddl file has been read and executed in psql, before your a2.sql file is executed. Follow these rules: The output of each query must be stored in a result table. We provide the definitions of these tables in the a2.ddl file (query1, query2,.., query10). . For each of the queries below, your final statement should populate the respective answer table (queryX) with the correct tuples. It should look something like "INSERT INTO queryx (SELECT ... You can assume that the a2.ddl file has been read and executed in psql, before your a2.sql file is executed. Follow these rules: The output of each query must be stored in a result table. We provide the definitions of these tables in the a2.ddl file (query1, query2,.., query10). . For each of the queries below, your final statement should populate the respective answer table (queryX) with the correct tuples. It should look something like "INSERT INTO queryx (SELECT ...

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

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

ISBN: 0764532545, 978-0764532542

Students also viewed these Databases questions