Given are the entities and attributes: Customers (customerNo, firstName, lastName, postalAddress, homeAddress(street num
Posted: Fri May 20, 2022 11:37 am
Given are the entities and attributes:
Customers (customerNo, firstName, lastName, postalAddress,
homeAddress(street number, street name, suburb, post-code, city),
gender, cardNo, bookingNo, propertyNo , next-To-KinNo,
workType)
Property (propertyNo, customerNo)
WorkTypes (workTypeNo, customerNo, propertyNo)
Next-Of-Kin (Next-Of-KinNo, firstName, lastName, telephoneNo,
address (street number, street name, suburb, post-code, city,
state)
RepairServices ( serviceNo, serviceName, serviceType,
price)
Staff members ( staffNo, firstName, lastName, position, gender,
dateOfBirth, salary, sectionName, internalTelephoneNo, officeNo,
bookingNo)
SectionInformation ( sectionNo, sectionName, emailAddress,
location, telNo, faxNo)
SectionTelephoneNos ( sectionTelephoneID, TelephoneNo,
sectionName)
SectionFaxNos ( sectionFaxID, FaxNo, sectionName)
CourseInvoice (courseInvoiceNo, courseNo, serviceNo,
serviceName, startDate, endDate, paymentDueDate, amountToBePaid,
customerNo, staffNo)
CourseDetails (courseNo, courseName, startDate, endDate,
courseFees, instructorNumber, instructorName)
InstructorDetails ( instructorNo, firstName, lastName, position,
gender, dateOfBirth, salary, internalTelephoneNo, sectionNo,
officeNo)
Office (officeNo, instructorNo, staffNo, sectionNo)
Coursepayment (coursepaymentNo, customerNo, invoiceNo,
amountPaid, paymentType(cash or credit card),
dateOfPaid)
Notice (noticeNo, customerName, invoiceNo,
dateOfIssue)
OutstandingInvoice (outstandingInvoiceNo, noticeNo,
customerNo)
CourseReceipts(courseReceiptNo, customerName, dateOfPayment,
amountpaid, invoiceNo, paymentNo)
JobDetails (jobNo, customerName, repairNo,
dateOfJobLodgement, staffName)
AppointmentReservation (appointmentReservationNo, customerNo,
dateAndTime, staffNo)
Quotation ( quotationNo, appointmentNo, customerNo,
quotationPrice)
AppointmentDetails ( AppointmentNo, customerNo,
customerpropertyAddress, staffNo, repairDescription,
quotationPrice)
RepairDetails (repairNo, customerNo, dateAndTime,
repairerNo)
Repairer (repairerNo, repairerName, appointmentNo)
Repairinvoice ( repairInvoiceNo, repairNo, paymentDueDate,
amountToBePaid, propertyAddress, customerNo, staffNo,
quotationNo)
RepairPaymentDetails (repairpaymentNo, customerNo, invoiceNo,
amountPaid, paymentType(cash or credit card), dateOfPaid,
invoiceNo)
RepairReceipts (repairReceiptNo, customerNo,
dateOfPayment, amountPaid, paymentNo, invoiceNo)
SeminarRoom ( seminarRoomNo, customerNo)
Bookings (bookingNo, customerNo, seminarRoomNo, dateAndTime,
staffNo)
QUESTION:
Based on the entities, attributes, and primary keys of your
solution for Canberra Work Group (CWG) in Part 2 of this Take-Home
Assessment paper, Write the following queries using SQL:
List details of all customers from Canberra that have enrolled
in a course order by Customer Number.
How many customers from Canberra have enrolled in a course
conducted by an instructor with Instructor Number =
12345?
List the number of male staff in each section.
List the first and last name of all female staff that have made
an appointment with a customer from Canberra for repair
work.
What is the average salary of male staff from
Canberra?
Customers (customerNo, firstName, lastName, postalAddress,
homeAddress(street number, street name, suburb, post-code, city),
gender, cardNo, bookingNo, propertyNo , next-To-KinNo,
workType)
Property (propertyNo, customerNo)
WorkTypes (workTypeNo, customerNo, propertyNo)
Next-Of-Kin (Next-Of-KinNo, firstName, lastName, telephoneNo,
address (street number, street name, suburb, post-code, city,
state)
RepairServices ( serviceNo, serviceName, serviceType,
price)
Staff members ( staffNo, firstName, lastName, position, gender,
dateOfBirth, salary, sectionName, internalTelephoneNo, officeNo,
bookingNo)
SectionInformation ( sectionNo, sectionName, emailAddress,
location, telNo, faxNo)
SectionTelephoneNos ( sectionTelephoneID, TelephoneNo,
sectionName)
SectionFaxNos ( sectionFaxID, FaxNo, sectionName)
CourseInvoice (courseInvoiceNo, courseNo, serviceNo,
serviceName, startDate, endDate, paymentDueDate, amountToBePaid,
customerNo, staffNo)
CourseDetails (courseNo, courseName, startDate, endDate,
courseFees, instructorNumber, instructorName)
InstructorDetails ( instructorNo, firstName, lastName, position,
gender, dateOfBirth, salary, internalTelephoneNo, sectionNo,
officeNo)
Office (officeNo, instructorNo, staffNo, sectionNo)
Coursepayment (coursepaymentNo, customerNo, invoiceNo,
amountPaid, paymentType(cash or credit card),
dateOfPaid)
Notice (noticeNo, customerName, invoiceNo,
dateOfIssue)
OutstandingInvoice (outstandingInvoiceNo, noticeNo,
customerNo)
CourseReceipts(courseReceiptNo, customerName, dateOfPayment,
amountpaid, invoiceNo, paymentNo)
JobDetails (jobNo, customerName, repairNo,
dateOfJobLodgement, staffName)
AppointmentReservation (appointmentReservationNo, customerNo,
dateAndTime, staffNo)
Quotation ( quotationNo, appointmentNo, customerNo,
quotationPrice)
AppointmentDetails ( AppointmentNo, customerNo,
customerpropertyAddress, staffNo, repairDescription,
quotationPrice)
RepairDetails (repairNo, customerNo, dateAndTime,
repairerNo)
Repairer (repairerNo, repairerName, appointmentNo)
Repairinvoice ( repairInvoiceNo, repairNo, paymentDueDate,
amountToBePaid, propertyAddress, customerNo, staffNo,
quotationNo)
RepairPaymentDetails (repairpaymentNo, customerNo, invoiceNo,
amountPaid, paymentType(cash or credit card), dateOfPaid,
invoiceNo)
RepairReceipts (repairReceiptNo, customerNo,
dateOfPayment, amountPaid, paymentNo, invoiceNo)
SeminarRoom ( seminarRoomNo, customerNo)
Bookings (bookingNo, customerNo, seminarRoomNo, dateAndTime,
staffNo)
QUESTION:
Based on the entities, attributes, and primary keys of your
solution for Canberra Work Group (CWG) in Part 2 of this Take-Home
Assessment paper, Write the following queries using SQL:
List details of all customers from Canberra that have enrolled
in a course order by Customer Number.
How many customers from Canberra have enrolled in a course
conducted by an instructor with Instructor Number =
12345?
List the number of male staff in each section.
List the first and last name of all female staff that have made
an appointment with a customer from Canberra for repair
work.
What is the average salary of male staff from
Canberra?