Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Write a query using mysql to display grant title, summary and grand amount which was received during the past
decade. Sort the data by title & amount
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write a query that returns the EMP_NUM and Number of ratings he/she earned (based on EARNEDRATING table, call this Num_RTG), for those who had at least got 1 rating earned, but the number of ratings he/she earned must lower than the average number of ratings for all employees who had earned ratings before, and such employee has been served as “Copilot” before.arrow_forwardWrite a query to display the employee number, last name, first name, salary "from" date, salary end date, and salary amount for employees 83731, 83745, and 84039. Sort the output by employee number and salary "from" date (Figure P7.31). EMP NUM EMP INAME EMP FNAME SAL FROM SAL END SAL AMOUNT 83731 VARGAS SHERON 20140-15 2015a-14 43.00 VARSAS SHERON 2015014 2016--13 481.00 83731 VARGAS SHERON 2016 04 201714 4.00 VARGAS SHERON 20170715 NUL S1040.00 SPICER DWAN 201102 2012-0-01 83745 SPICER 2012 0-2 2013-0-02 S7700.00 DWAN 3745 SCER DWAN 2013 o 2014-08-01 63470.00 SPICER DWAN 2014 08-02 2015-08-01 se.00 SPICER DWAN 2015O1 2010--31 71.00 SPICER DWAN 2016 O01 2017-08-01 7414.00 Figure P7.31 In the SQL Query do the following Select clause: Display the columns specified above in the problem statement from LGEMPLOYEE and LGSALARY_HISTORY tables From: Since we are displaying the information from these two tables specify the join condition here or in the where clause Where clause: Only…arrow_forwardWrite a query to display the customer code, first name, and last name of all customers who have had at least one invoice completed by employee 83649 and at least one invoice completed by employee 83677. Sort the output by customer last name and then the first name.arrow_forward
- Use the code below to write a query to display the movie title, movie year, and movie genre for all movies CREATE TABLE MOVIE ( MOVIE_NUM NUMBER(8,0) PRIMARY KEY, MOVIE_TITLE VARCHAR2(75) NOT NULL, MOVIE_YEAR NUMBER(4,0) CHECK (MOVIE_YEAR > 1900), MOVIE_COST NUMBER(5,2), MOVIE_GENRE VARCHAR2(50), PRICE_CODE NUMBER(2,0) CONSTRAINT MOVIE_PRICE_CODE_FK REFERENCES PRICE ); INSERT INTO MOVIE VALUES (1234, 'The Cesar Family Christmas', 2011, 39.95, 'FAMILY', 2); INSERT INTO MOVIE VALUES (1235, 'Smokey Mountain Wildlife', 2008, 59.95, 'ACTION', 1); INSERT INTO MOVIE VALUES (1236, 'Richard Goodhope', 2012, 59.95, 'DRAMA', 2); INSERT INTO MOVIE VALUES (1237, 'Beatnik Fever', 2011, 29.95, 'COMEDY', 2); INSERT INTO MOVIE VALUES (1238, 'Constant Companion', 2012, 89.95, 'DRAMA', NULL); INSERT INTO MOVIE VALUES (1239, 'Where Hope Dies', 2002, 25.49, 'DRAMA', 3); INSERT INTO MOVIE VALUES (1245, 'Time to Burn', 2009, 45.49, 'ACTION', 1);arrow_forwardWrite a query to display the employee number, last name, first name, salary “from” date, salary end date, and salary amount for employees 99675, 53845, and 44035. Sort the output by employee number and salary “from” date.arrow_forwardWrite a query to list the book title, checkout date, checkout due date and checkout in date for each book.arrow_forward
- Write a query to display student ID, First name and age. Sort the result based on student ID. [Note : Age can be calculated using DOB and give alias name as age] STUDENT COURSE Number(4) Varchar2(20) Varchar2(20) PK Studld PK courseid number(4) varchar2(20) number(2) number(7,2) FirstName LastName Street City CourseName Duration Varchar2(20) Fees Varchar2(20) DOB Date REGISTRATION PK-Primary key FK-Foreign key FK CourselD number(4) FK Studld number(4) DOJ Datearrow_forwardWrite a query to display the author ID and the number of books written by that author. Sort the results in descending order by number of books, then in ascending order by author ID (Figure P7.85). In the SQL Query do the following Select clause: Display author Id and count of author Id as “Books Written” From clause: WRITES table Where clause: Not needed as we are not limiting any data here Order by clause: “books written” desc, au_id ascarrow_forwardProblem 87 Write a query to display the patron ID, book number, and days kept for each checkout. “Days Kept” is the difference from the date on which the book is returned to the date it was checked out. Sort the results by days kept in descending order, then by patron ID, and then by book number (Figure P7.87). (68 rows)arrow_forward
- From invoices table, write a query to retrieve everything (all columns), plus, add an additional column that retrieves difference in the number of days between the invoice due date and paymentdate, and name the column “Difference”. Note that the difference in days should be calculated bysubtracting “payment_date” from “invoice_due_date”.Hint1, refer to the following sample:... Invoice Due Date Payment Date Difference... 2018-05-08 2018-05-07 1... 2018-05-10 2018-05-14 -4... 2018-05-13 2018-05-09 4Hint 2: simple subtraction or DATEDIFF function. Both works.arrow_forwardWrite a query to produce the number of invoices and the total purchase amounts by customer, using the output shown in Figure P7.18 as your guide. Note the results are sorted by customer code. (Compare this summary to the results shown in Problem 17.)arrow_forwardProblem 90 Write a query to display the author last name, author first name, and book number for each book written by that author. Sort the results by author last name, first name, and then book number (Figure P7.90). (25 rows)arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education