Problem 1 SQL [10 points] We define a database for FSU libraries as follow, Books: (bookID...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Problem 1 SQL [10 points] We define a database for FSU libraries as follow, Books: (bookID INTEGER, title TEXT, genre TEXT, lib INTEGER REFERENCES Libraries, PRIMARY KEY (bookID)); Libraries: (libraryID INTEGER, name TEXT, PRIMARY KEY (libraryID)); Checkouts: (book INTEGER REFERENCES Books, day DATETIME, PRIMARY KEY (book, day)). 1. [3 points] Write a SQL query that returns the bookID and genre of each book that has ever been checked out; 2. [3 points] Write a SQL query that returns the bookID of the book that has been checked out the most times, and the corresponding checked-out count. We assume that each book was checked out a unique number of times; 3. [4 points] Write a SQL query that finds the name of all of the pairs of libraries that have books with matching titles. In the output, report the names of both libraries (the first name is alphabetically less than the second) and the matching titles of the books. Problem 1 SQL [10 points] We define a database for FSU libraries as follow, Books: (bookID INTEGER, title TEXT, genre TEXT, lib INTEGER REFERENCES Libraries, PRIMARY KEY (bookID)); Libraries: (libraryID INTEGER, name TEXT, PRIMARY KEY (libraryID)); Checkouts: (book INTEGER REFERENCES Books, day DATETIME, PRIMARY KEY (book, day)). 1. [3 points] Write a SQL query that returns the bookID and genre of each book that has ever been checked out; 2. [3 points] Write a SQL query that returns the bookID of the book that has been checked out the most times, and the corresponding checked-out count. We assume that each book was checked out a unique number of times; 3. [4 points] Write a SQL query that finds the name of all of the pairs of libraries that have books with matching titles. In the output, report the names of both libraries (the first name is alphabetically less than the second) and the matching titles of the books.
Expert Answer:
Answer rating: 100% (QA)
ANSWER 1 SELECT bookID genre FROM Books INNER JOIN Checkouts ON BooksbookID Chec... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
In problem 1-4 find the slope and y-intercept of each line. 1. 3y = - 2x + 1 2. - 4y = 5x - 6 3. 6 - 2y = 10x - 2
-
In problem, find the center and radius of each circle. Write the standard form of the equation. yA (0, 1) (2, 1)
-
In problem, find the center and radius of each circle. Write the standard form of the equation.. (1, 2) (1, 0)
-
Jones Archaeology began 2018 with retained earnings of $180,000. During 2018, Jones made sales of $832,000 with 56% of sales allocated to cost of goods sold. Selling and administrative expense for...
-
Select an accounting, auditing, or information systems RFP from the site www. fbo. gov. In one page or less (unless otherwise instructed by your professor), summarize what is being procured, how you...
-
The probability that a randomly selected 24-year-old male will survive the year is 0.9986 according to the National Vital Statistics Report, Vol. 56, No. 9. (a) What is the probability that three...
-
What does argv provide to our program?
-
Valdespin Company manufactures three sizes of camping tentssmall (S), medium (M), and large (L). The income statement has consistently indicated a net loss for the M size, and management is...
-
Consider the following set for n N: F = {f : {1, . . . , n} {0, 1, 2} :1 i n 1, f(i) + f(i + 1)4}. (a) Given a recurrence and boundary conditions for |F|. (b) Solve the recurrence and give an...
-
Newton Company manufactures and sells one product. The company assembled the following projections for its first year of operations: Variable costs per unit: Manufacturing: Direct materials . . . . ....
-
project managers seem to be involved in a lot of their work ahead of the project. They are provided with a budget that they oversee throughout the project to ensure the project does not go over...
-
Sportsman Shoes has been a leader in the shoe industry for more than 30 years. Sportsman manufactures and sells athletic shoes for all types of sports. The company has pursued a low-cost strategy in...
-
An ordinary vapor compression cycle is to be operated on methane to cool a chamber to 112 K. Heat is rejected to liquid ethylene at 160 K. The temperatures in the coils are 168 K and 100 K. (a) Write...
-
Jane Swift is becoming frustrated with her job as a shift leader at Jones Department Store. Shes worked there for 6 months, and the full-time job has turned into more than full time. Several...
-
Three kg of saturated liquid water are to be evaporated at 60C. (a) At what pressure will this occur at equilibrium? (b) What is the initial volume? (c) What is the system volume when 2 kg have been...
-
How did Adler and Dumas (1984) define currency risk? How is currency risk different than exchange rate risk? How did they propose to measure the exchange risk exposure of a security? Write an...
-
You purchased 100 shares of the common stock in Brown-Forman two years ago for $55 per share. You incurred a transaction cost of $10 when you bought the shares. Over the past two years the firm has...
-
Whats the difference between an ordinary annuity and an annuity due? What type of annuity is shown below? How would you change the time line to show the other type of annuity?
-
Consider the algorithm in figure to compute ?+. Show that this algorithm is more efficient than the one presented in Figure (Section 7.3.3) and that it computes ?+ correctly. result := 0; /* fdcount...
-
Give a recursive procedure to efficiently compute the spatial join of two relations with R-tree indices.
-
Write an assertion for the bank database to ensure that the assets value for the Perryridge branch is equal to the sum of all the amounts lent by the Perryridge branch.
-
This chapter suggests that estimating project costs is a challenging process that can resemble an art form as much as science. Describe the different methods used to estimate costs on a project. How...
-
Consider the common problems with project cost estimation and recall a project with which you have been involved. Which of these common problems did you encounter most often? Why?
-
Explain the concept of activity-based costing. What are the steps involved in this process?
Study smarter with the SolutionInn App