Question
ASX database: -- Address contains the registered address of the company (excluding the zip code and country -- Zip is the zip code of the
ASX database:
-- Address contains the registered address of the company (excluding the zip code and country -- Zip is the zip code of the Address -- Country is the incorporation country of the company (same as the country for the Address) CREATE TABLE Company ( Code char(3) primary key check (Code ~ '[A-Z]{3}'), Name text not null, Address text default null, Zip varchar(10) default null, Country varchar(40) default null );
-- Person may contain person name, title and/or qualification CREATE TABLE Executive ( Code char(3) references Company(Code), Person text, primary key (Code, Person) );
CREATE TABLE Category ( Code char(3) primary key references Company(Code), Sector varchar(40) default null, Industry varchar(80) default null );
CREATE TABLE ASX ( "Date" date, Code char(3) references Company(Code), Volume integer not null check (Volume >= 0), Price numeric not null check (Price > 0.0), primary key ("Date", Code) );
CREATE TABLE Rating ( Code char(3) references Company(Code), Star integer default 3 check (Star > 0 and Star < 6) );
CREATE TABLE ASXLog ( "Timestamp" timestamp, "Date" date, Code char(3) references Company(Code), OldVolume integer not null check (OldVolume >= 0), OldPrice numeric not null check (OldPrice > 0.0), primary key ("Timestamp", "Date", Code) );
Question :Assuming the schema from the ASX database, give the following queries in relational algebra:
1.List all the company names that are in the sector of "Technology".
2.List all the company codes that have more than five executive members on record (i.e., at least six).
3.Output the person names of the executives that are affiliated with more than one company.
4.List all the companies (by their Code) that are the only one in their Industry (i.e., no competitors). Same as Assignment 2, please include both Code and Industry in the output.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started