
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
Question
Using the Winners table from Figure 12-2, write a SELECT statement that selects
the Actor and Actress fields for the years 2008 through 2010. Sort the records in
descending order by the Year field.

Transcribed Image Text:Winners table in the Oscars.mdf database
Name
Data Type Allow Nulls Default
o Year
int
Actor
varchar(50)
Actiess
varchar(50)
Picture
varchar(50)
Animated
varchar(50)
Year
Actor
Actress
Picture
Animated
2008
2009
Danicl Day-Lewis
Marion Cotillard
No Country for Old Men Ratatouille
Scon Penn
Kete Winslet
Slumdog Millioneire
WALL-E
2010
Jeff Bridges
Sandra Bullock
The Hurt Locker
Up
2011
Colin Firth
Natalie Portman
The King's Speech
Toy Story 3
2012
2013
2014
Jean Dujardin
Meryl Streep
The Artist
Rango
Danid-Day Lewis
Jennifer Lawrence Argo
Brave
Matthew McConaughey Cate Blanchett
Eddie Redmayne
12 Vears a Slave
Frozen
2015
Julianne Moore
Birdman
Big Hero 6
2016
2017
Leonardo DiCaprio
Brie Larson
Spotlight
Inside Out
Casey Affleck
Emma Stone
Moonlight
Zoctopia
Example 1
SELECT Year, Actor, Actress, Picture, Animated FROM Winners
selects all of the fields and records from the table
Example 2
SELECT Year, Actor, Actress, Picture, Animated FROM Winners
WHERE Year >= 2014
selects all of the fields from records for the year 2014 and later
Example 3
SELECT Year FROM Winners WHERE Picture =
'Argo'
selects the Year field for the Argo record

Transcribed Image Text:(continued)
Example 4
SELECT Year, Picture FROM Winners
WHERE Picture LIKE 'The %'
selects the Year and Picture fields for all records whose Picture field begins with the word
"The" followed by a space and zero or more characters
Example 5
SELECT Year, Animated FROM Winners
WHERE Year = 2010 OR Year = 2015
ORDER BY Year DESC
selects the Year and Animated fields for records whose Year field contains either 2010 or 2015
and then arranges the records in descending order by the Year field
Expert Solution

arrow_forward
Step 1: Query
A query that selects the “Actor” and “Actress” fields for the years “2008” through “2010” and sorts the records in descending order by the “Year” field is as follows,
SELECT Actor, Actress FROM Winners
WHERE Year BETWEEN 2008 AND 2010
ORDER BY Year DESC;
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
- Products dataset contalns Price column. Which of the following is the correct way to Increase the ticket price by 7%? Select one: O summarise(Products , Price = Price * 0.07) O mutate(Products , Price = Price + Price 0.07) O mutate(Products, Price = Price 0.07) O summarise(Products , Price = Price + Price • 0.07)arrow_forwardSQL: For every invoice, display the invoice number, invoice date and the total dollar amount for all products purchased in the invoice, ordered by invoice number in descending order and then by invoice date in ascending order. Here you will use an aggregate SUM(x,y) function in your SELECT clause to calculate the total dollar amount (a calculated field – name it TOTAL). Don’t forget to join on the tables as well. [hint: you should have 8 rows of output ordered properly]. My code is as follows: select inv_number, inv_date, sum(line_price) as 'total' from invoice, line where invoice.inv_number = line.inv_number order by inv_number desc, inv_date asc ; I am getting this error: ORA-00923: FROM keyword not found where expected Any recommendations on what I am doing wrong?arrow_forwardTask 7: The StayWell marketing team considers sending small gifts to all residents and owners. To decrease the postal costs, they will send gifts to owners in batches to their corresponding offices. Similarly, the marketing team will send the gifts in groups to the residents living in the same property. Therefore, you will need to provide them the number of gifts for each StayWell office and number of gifts for each property. The column headers for the first table should be OFFICE_NUM and GIFTS, the column headers for the second table should be PROPERTY_ID and GIFTS.arrow_forward
- Q1. Write a SELECT statement that returns these columns from the Invoices table: ⚫ The invoice_total column • A column that uses the ROUND function to return the invoice_total column with 1 decimal digit • A column that uses the ROUND function to return the invoice_total column with no decimal digits invoice_total one_digit 3813.33 zero_digits 3813.3 3813arrow_forwardCountry ISOCode3 Name PopDensity NIC MLT Nicaragua Malta 140 3920 LBN Lebanon 1730 Complete the UPDATE statement to change 140 to 5220 in the Country table. In the WHERE clause, identify the row to be changed using the Name column. UPDATE Your code here */ SET WHERE Note: Your answers for SET and WHERE should include the column names followed by an equals sign and the corresponding value.arrow_forwardPlease explain the purpose of the GROUPING SETS clause and its primary use.arrow_forward
- Write a SELECT statement that uses the ranking functions to rank products by the total quantity sold. Return these columns: The product_name column from the Products table A column named total_quantity that shows the sum of the quantity for each product in the Order_Items table A column named rank that uses the RANK function to rank the total quantity in descending sequence A column named dense_rank that uses the DENSE_RANK function to rank the total quantity in descending sequencearrow_forwardJump to level Complete the following statement to create a table named Country. Choose data types based on the following requirements: ISOCode3 stores the country's code, consisting of one to three letters. • IndepDate stores the country's independence date. CREATE TABLE Country ); ( ISOCode 3 /* Your code goes here */ IndepDate /* Your code goes here */ Enter a statement to delete the above table. /* Your code goes here */ ;arrow_forwardTask 7: The StayWell marketing team considers sending small gifts to all residents and owners. To decrease the postal costs, they will send gifts to owners in batches to their corresponding offices. Similarly, the marketing team will send the gifts in groups to the residents living in the same property. Therefore, you will need to provide them the number of gifts for each StayWell office and number of gifts for each property. The column headers for the first table should be OFFICE_NUM and GIFTS, the column headers for the second table should be PROPERTY_ID and GIFTS. Provide the StayWell team the number of gifts for each office. Provide the StayWell team the number of gifts for each residence.arrow_forward
- The Horse table has the following columns: ID - integer, primary key RegisteredName - variable-length string Breed - variable-length string Height - decimal number BirthDate - date Write a SELECT statement to select the registered name and height for only horses that have an above average height. Order the results by height (ascending). Hint: Use a subquery to find the average height.arrow_forwardList the names of all Staff members who hold a faculty position and have a salary of $45,000 or less. Show their names as their first name, followed by a space, and then their last name but sort the list alphabetically by last name and then first name. Hint: Check out the Position column in the Staff table. All staff members who do not hold a faculty position will get a bonus this year equal to 5% of their salary. List the names, current salary, and bonus amount for each Staff member (non-faculty) who is due a bonus. Show your list in order with the person receiving the highest bonus first.arrow_forwardIf the DOCTORS table has the following columns, and you want to write a SELECT statement to return the Doctors name and join_year who were joined before 2000, and after 2018. Column Name Data type Size Doctor_id Number Doctor_name Varchar2 30 Degree Varchar2 25 Join_year Number 4 Salary Number which of the following SQL statements should you use?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