Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

SQL Introduction Consider the following relational database that Delta Airlines

ID: 3843459 • Letter: S

Question

SQL Introduction Consider the following relational database that Delta Airlines uses to keep track of its mechanics, their skills, and their airport locations. Mechanic number (MECHNUM), airport name (AIRNAME), and skill number (SKILLNUM) are all unique fields. SIZE is an airport’s size in acres. SKILLCAT is a skill’s category, such as an engine skill, wing skill, tire skill, etc. YEARQUAL is the year that a mechanic first qualified in a particular skill; PROFRATE is the mechanic’s proficiency rating in a particular skill. Cell minus directions - Week 3 for LMS.jpg Write SQL SELECT commands to answer the following queries. List the names and telephone numbers of all of the mechanics. List the airports in California that are at least 20 acres in size and have opened in or after 1935. List the airports in California that were opened before 1950. Order the results from smallest to largest airport. Find the average size of the airports in California (Hint: use avg). How many airports have been open in California in or after 1935? (Hint: use count). List the names of the mechanics who work in California.

Explanation / Answer

SQL Code for List the names and telephone numbers of all of the mechanics:-

SELECT Name,Telephone_Number
FROM Table_Name;

SQL Code for List the airports in California that are at least 20 acres in size and have opened in or after 1935:-

SELECT AIRNAME
FROM Delta_Airlines
WHERE SIZE = 20 AND DateofOpening >= 1935;

SQL Code for List the airports in California that were opened before 1950:-

SELECT AIRNAME
FROM Delta_Airlines
WHERE DateofOpening < 1950;

SQL Code to Find the average size of the airports in California:-

SELECT AVG(SIZE)
FROM Delta_Airlines
WHERE Airport_Location = 'California';


SQL Code to display How many airports have been open in California in or after 1935:-

SELECT COUNT(AIRID)
FROM Delta_Airlines
WHERE DateofOpening >= 1935;

SQL Code to List the names of the mechanics who work in California:-

SELECT MECHNAME
FROM Table_Name
WHERE Work_Location = 'California';