Write a sql query using relation database schema of following two statements 1.A list of Officials and
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a sql query using relation database schema of following two statements
1.A list of Officials and their highest preferred languages. Sort according to their First name followed by Last name. Display their full names and the
highest preferred languages (names and preferences). Note that there is only one highest preferred language for each official.
2. The date on which the most recent Trip(s) was (were) complete. Show the date as well as the vehicle model(s) and type(s) description involved in the trip(s)
Transcribed Image Text:
Entity LANGUAGE COUNTRY COUNTRY_LANGUAGE LOCATION LOCATION_TYPE DRIVER DRIVER LANGUAGE VEHICLE VEHICLE_TYPE MAINTENANCE_REPAIR OFFICIAL OFFICIAL_ROLE TRIP Field Name LanguageCode LanguageName CountryCode CountryName CountryCode LanguageCode Relational Database Schema PercentageSpoken LocationID LocationTypeID StreetNo SteetName City State Postcode LocTypeID LocType Description DriverLicenceNum DriverFirst Name DriverLastName Clearance Level IsAvailable LanguageCode DriverLicenceNum VIN Veh_TypeID Veh Make Veh Model Veh_Year Veh_Colour Veh_RegoNum Veh_Odometer Veh_Availability DriverLanguageProf CHAR CHAR CHAR Veh_Type_Description VIN Odometer Reading MR_Type MR_Date MR_Cost MR_Detail OfficialID Official Role CountryCode. Official First Name Official LastName RolelD Role Description BookingRefNum DriverLicenceNum OfficialID CHAR INT CHAR Veh_For_Passenger CHAR Veh_For_Cargo Veh_TypeID LanguageCode Datatype Length Description CHAR 2 VARCHAR 50 CHAR 2 VARCHAR 50 CHAR 2 PickUpLocID CHAR DronOffroaID DECIMAL (5,2) INT(AUTO) CHAR CHAR CHAR CHAR VARCHAR 5 VARCHAR 50 VARCHAR 40 3 4 2 VARCHAR 40 CHAR 12 VARCHAR 40 VARCHAR 40 1 1 2 CHAR CHAR CHAR CHAR CHAR CHAR VARCHAR CHAR INT CHAR DATE VARCHAR 30 VARCHAR 30 4 CHAR VARCHAR 20 6 CHAR CHAR CHAR 2 CHAR 2 CHAR INT 12 DECIMAL (7,2) VARCHAR 100 INT 1 17 2 1 1 1 2 40 17 1 VARCHAR 40 VARCHAR 40 CHAR 2 VARCHAR 40 INT (AUTO) CHAR 8 2 2 12 8 2 Primary Key, see examples in Ref. [1] Primary Key, see examples in Ref. [2] Primary Key, Foreign Key references COUNTRY(CountryCode) Primary Key, Foreign Key references LANGUAGE(LanguageCode) e.g., 50.25, 80 Primary Key Foreign Key references LOCATION_TYPE(LocTypeID) e.g., QLD, NSW, SA e.g., 4004, 2002, 3003 Primary Key e.g., Airport, Swimming Pool Primary Key Levels: 1, 2, 3, 4 (4 is the highest clearance) Y, N Primary Key, Foreign Key references LANGUAGE(LanguageCode) Primary Key, Foreign Key references DRIVER (DriverLicenceNum) See examples in Ref. [3] (5 is the highest) Primary Key Foreign Key references VEHICLE TYPE(Veh_TypeID) e.g., Toyota e.g., Corolla e.g., 2020 e.g., Red Y, N Y, N Y, N Primary Key e.g., Sedan Primary Key, Foreign Key references VEHICLE(VIN) Primary Key M, R Format: DD-MM-YYYY Primary key Foreign Key references OFFICIAL_ROLE(RoleID) Foreign key references COUNTRY(CountryCode) Primary key e.g., Judge, Coach Primary Key Foreign Key References DRIVER (DriverLicenceNum) Foreign key references OFFICIAL_LANGUAGE(OfficialID) Foreign Key references OFFICIAL LANGUAGE(Language Code) Foreign key references LOCATION (LocationID) Foreign kou refer Entity LANGUAGE COUNTRY COUNTRY_LANGUAGE LOCATION LOCATION_TYPE DRIVER DRIVER LANGUAGE VEHICLE VEHICLE_TYPE MAINTENANCE_REPAIR OFFICIAL OFFICIAL_ROLE TRIP Field Name LanguageCode LanguageName CountryCode CountryName CountryCode LanguageCode Relational Database Schema PercentageSpoken LocationID LocationTypeID StreetNo SteetName City State Postcode LocTypeID LocType Description DriverLicenceNum DriverFirst Name DriverLastName Clearance Level IsAvailable LanguageCode DriverLicenceNum VIN Veh_TypeID Veh Make Veh Model Veh_Year Veh_Colour Veh_RegoNum Veh_Odometer Veh_Availability DriverLanguageProf CHAR CHAR CHAR Veh_Type_Description VIN Odometer Reading MR_Type MR_Date MR_Cost MR_Detail OfficialID Official Role CountryCode. Official First Name Official LastName RolelD Role Description BookingRefNum DriverLicenceNum OfficialID CHAR INT CHAR Veh_For_Passenger CHAR Veh_For_Cargo Veh_TypeID LanguageCode Datatype Length Description CHAR 2 VARCHAR 50 CHAR 2 VARCHAR 50 CHAR 2 PickUpLocID CHAR DronOffroaID DECIMAL (5,2) INT(AUTO) CHAR CHAR CHAR CHAR VARCHAR 5 VARCHAR 50 VARCHAR 40 3 4 2 VARCHAR 40 CHAR 12 VARCHAR 40 VARCHAR 40 1 1 2 CHAR CHAR CHAR CHAR CHAR CHAR VARCHAR CHAR INT CHAR DATE VARCHAR 30 VARCHAR 30 4 CHAR VARCHAR 20 6 CHAR CHAR CHAR 2 CHAR 2 CHAR INT 12 DECIMAL (7,2) VARCHAR 100 INT 1 17 2 1 1 1 2 40 17 1 VARCHAR 40 VARCHAR 40 CHAR 2 VARCHAR 40 INT (AUTO) CHAR 8 2 2 12 8 2 Primary Key, see examples in Ref. [1] Primary Key, see examples in Ref. [2] Primary Key, Foreign Key references COUNTRY(CountryCode) Primary Key, Foreign Key references LANGUAGE(LanguageCode) e.g., 50.25, 80 Primary Key Foreign Key references LOCATION_TYPE(LocTypeID) e.g., QLD, NSW, SA e.g., 4004, 2002, 3003 Primary Key e.g., Airport, Swimming Pool Primary Key Levels: 1, 2, 3, 4 (4 is the highest clearance) Y, N Primary Key, Foreign Key references LANGUAGE(LanguageCode) Primary Key, Foreign Key references DRIVER (DriverLicenceNum) See examples in Ref. [3] (5 is the highest) Primary Key Foreign Key references VEHICLE TYPE(Veh_TypeID) e.g., Toyota e.g., Corolla e.g., 2020 e.g., Red Y, N Y, N Y, N Primary Key e.g., Sedan Primary Key, Foreign Key references VEHICLE(VIN) Primary Key M, R Format: DD-MM-YYYY Primary key Foreign Key references OFFICIAL_ROLE(RoleID) Foreign key references COUNTRY(CountryCode) Primary key e.g., Judge, Coach Primary Key Foreign Key References DRIVER (DriverLicenceNum) Foreign key references OFFICIAL_LANGUAGE(OfficialID) Foreign Key references OFFICIAL LANGUAGE(Language Code) Foreign key references LOCATION (LocationID) Foreign kou refer
Expert Answer:
Related Book For
Concepts of Database Management
ISBN: 978-1285427102
8th edition
Authors: Philip J. Pratt, Mary Z. Last
Posted Date:
Students also viewed these databases questions
-
In this project you are to choose a publicly traded company based on Canada / U.S. The company must be in the retail sector. You will have to access the company's financial statements for 2020, 2021...
-
Consider the following relational schema: Staff ( staffNo , name, dept, skillCode) Skill ( skillCode , description, chargeOutRate) Project ( projectNo ,...
-
In Data 2.1 on page 46, we introduce a study in which people were asked whether they agreed or disagreed with the statement that there is only one true love for each person. Is the level of a persons...
-
A three-dimensional elasticity problem of a uniform bar stretched under its own weight gives the following strain field: where A and B are constants. Integrate the strainedisplacement relations to...
-
Consider the absorbing stochastic matrix A, where Approximate the stable matrix of A by raising A to a high power. Then find the exact stable distribution by calculating S(I - R)-1. 0.6 .1 .1 0 0 .2...
-
The current assets and current liabilities sections of the balance sheet of Allessandro Scarlatti Company appear as follows. The following errors in the corporations accounting have been discovered:...
-
Why is it important for organizations to take a people-first approach to IT?
-
The accounts in the ledger of Bastin Delivery Service contain the following balances on July 31, 2014. Instructions (a) Prepare a trial balance with the accounts arranged as illustrated in the...
-
Prepare Trina Haldane's Statement of Profit or Loss for the period ended 31 December 2014 Trina Haldane's unadjusted Trial Balance as at 31 December 2014 Particulars Dr Cr Capital 200,000 Drawings...
-
Amazon.com, Inc., headquartered in Seattle, WA, started its electronic commerce business in 1995 and expanded rapidly. The following transactions occurred during a recent year (dollars in millions):...
-
Mr. Kiplimo is finalizing his tax affairs for the year of income 2017. He and his wife had the following income and transactions for 2017: 1. Mr. Kiplimos income: He has paid Sh.52,000 Value Added...
-
Were the shares of stock issued as a result of Snaps initial public offering (IPO) sold in a primary market or a secondary market? Was the IPO an example of direct finance or indirect finance?
-
Under what circumstances might a monopolistically competitive firm continue to earn an economic profit as new firms enter its market?
-
Sony suffered losses selling televisions from 2004 to 2013, before finally earning a small profit on this business from 2014 to 2016. Given the strong consumer demand for plasma, LCD, and LED...
-
What is the underground economy? Why do some countries have larger underground economies than other countries?
-
An article in the Wall Street Journal stated that a change in inventories dragged down the overall growth in GDP by nearly a full percentage point below what it otherwise would have been. For this...
-
Suppose you purchase a zero coupon bond with face value $1,000, maturing in 25 years, for $180. What is the implicit interest, in dollars, in the first year of the bond's life? A) $2.86 B) $ 9.84 C)...
-
Find the market equilibrium point for the following demand and supply functions. Demand: 2p = - q + 56 Supply: 3p - q = 34
-
What is multiplicity?
-
The requirements shown in Question 11 have changed. The dentists office would like to add the date of the patients last payment. In which relation (table) would you place this attribute? Why? Data...
-
How do views relate to security?
-
What information do CPAs request from a financial institution on the Standard Form to Confirm Account Balance Information with Financial Institutions?
-
Why was the Hochfelder v. Ernst decision considered a "victory" for the accounting profession?
-
The CPA firm of Hanson and Brown was expanding very rapidly. Consequently, it hired several staff assistants, including James Small. Subsequently, the partners of the firm became dissatisfied with...
Study smarter with the SolutionInn App