diff_months: 19

What SQL statement can be used to retrieve the last names of borrowers with a card number less than 150, listed in ascending order?

Download Solution Now
Added on: 2024-03-13 10:54:43
Order Code: CLT223470
Question Task Id: 0
  • Subject Code :

    HIT-234

Part A - Single and multiple table queries

Value: 10%

For the first five questions you have to provide your answer in the form of a SQL statement, with description before as necessary. For example:

  1. Example Question: Select all columns from the `Customer` table Example Answer:

This answer will select out all the columns from the Customer table SELECT * from Customer;

Questions 1 & 5:

  1. List in ascending order the Last Names of all borrowers with Card Number less than150.
  2. What are the records of those loans between 3 June 2014 and 8 Mar2018?
    • The output should include the name of the cardholder, and title of the book
    • List in ascending order by last name and first name
  3. Find the total numbers of loans with last name beginning with D through E (including E); include last name beginning with Q as well as Z also.
    • The output of the above question should be a column containing the sum of all the loan based on the condition in the query, alternatively the output could be a table with columns that has the last name as per the condition in the query condition, also the table contains the list of loans.
  4. Find all borrowers for a loan that have the Date-in before 15-March-15 and the Card number between 100 and 300 in Karama or Darwin.
    • The output for the above question is a list of all borrowers (first name and last name) based on the condition in the query.
  5. Find the number of loans, which have been made from each branch?
    • Note all branches need to be included even those with no loans
    • The output of the above question is a table containing the list of loans only as per the condition in the query

Question 6:

  1. Create your own question based on the library database, and also provide a SQL Statement to answer your question.

Part B Table and Advanced Queries

Value: 6%

The questions are broken into: Q1 (4 marks), Q2 (3 marks), Q3 and Q4 (3 marks). For all questions, provide the answer in the form of a SQL statement, with description before as necessary.

sql2-1710327794.jpg

  1. The following Gym application database for weight session recording is as follows. Write and run SQL statements for creating the Occurrence Exercise table.
    • Include constraint values for the Condition Column: Heavy, Medium, Light.

sql3-1710327906.jpg

    1. Write an SQL statement that will insert the data into Occurrence Exercise table
      • Definition of rep stands for repetition.
      • Each exercise attempt has the rep number as indicated in the occurrence table.

sql4-1710328204.jpg

sql7-1710328468.jpg

Create the following queries:

  1. Find the exercise which contains the maximum total weight lifted.
  • Show: Exercise, Maximum weight.
  • Ensure you show captions for each of the columns.
  • Hint: you would need to consider the number of times the weight is lifted and weight.

E.g. rep multiplied by attempt multiplied by the weight.

  1. Find the exercise that the user was not able to complete 3 attempts in, or the exercise that the user has not attempted.
  • Show appropriate columns.
  • List in ascending order exercise type.
  • Do not show repeated names.
  • Ensure you show captions for each of the columns.

Part C All Topics

Value: 14%

For the first four questions refer to the Library Database. For question 5 refer to CDU Customer Invoice Database.

The questions are broken into: Q1-5.

For all questions, provide the answer in the form of a SQL statement, with description before as necessary.

Questions Using the Library Database

  1. What are the 5 most popular books?
    • Show ASBN,
    • HINT: To limit results use ROWNUM.
  2. Which branches currently have no loans out?
    • Show all branch names.
    • List in ascending order by branch.
  3. Find the longest time a book has been loaned out for each branch
    • Show only branch name and number of days.
    • List in ascending order by branch name.
    • Show all branches, even if there are no loaned out books. Therefore, a branch may have a null value for the longest loaded out book.
    • Format the number of days to one decimal place.
  4. Find the borrower that has returned a book on the dated 16 December 2010 and 8 May2012
    • Show two different methods.

Question Using the CDU Customer Invoice Database

  1. Devise a delete query, which will eliminate duplicates for customer columns "ID",

"Customer Last Name", "Customer First Name" and invoice columns "Invoice Date" and

"Invoice No".

  • Ensure the query removes all duplicate data.

Are you struggling to keep up with the demands of your academic journey? Don't worry, we've got your back! Exam Question Bank is your trusted partner in achieving academic excellence for all kind of technical and non-technical subjects.

Our comprehensive range of academic services is designed to cater to students at every level. Whether you're a high school student, a college undergraduate, or pursuing advanced studies, we have the expertise and resources to support you.

To connect with expert and ask your query click here Exam Question Bank

  • Uploaded By : Mohit
  • Posted on : March 13th, 2024
  • Downloads : 0
  • Views : 601

Download Solution Now

Can't find what you're looking for?

Whatsapp Tap to ChatGet instant assistance

Choose a Plan

Premium

80 USD
  • All in Gold, plus:
  • 30-minute live one-to-one session with an expert
    • Understanding Marking Rubric
    • Understanding task requirements
    • Structuring & Formatting
    • Referencing & Citing
Most
Popular

Gold

30 50 USD
  • Get the Full Used Solution
    (Solution is already submitted and 100% plagiarised.
    Can only be used for reference purposes)
Save 33%

Silver

20 USD
  • Journals
  • Peer-Reviewed Articles
  • Books
  • Various other Data Sources – ProQuest, Informit, Scopus, Academic Search Complete, EBSCO, Exerpta Medica Database, and more