annotated-LAB3.docx
pdf
keyboard_arrow_up
School
University of South Florida, Tampa *
*We aren’t endorsed by this school
Course
1540
Subject
Information Systems
Date
Apr 3, 2024
Type
Pages
7
Uploaded by ProfCloverQuail45
CGS 1540
Lab 3
Page 1
of 7
In this activity, you must use the MySQL Command Line
. Do not
use Workbench.
You'll need to take screenshots of the MySQL Command Line Client window throughout the assignment. o
It is strongly recommended to use the 'Snipping Tool'
or
'Snip and Sketch'
(on Windows) , or 'Grab'
(on MacOS). o
All your images (screenshots) must include only the requested command and results, showing in your MySQL command line. We need to see both the command and the results
(not one or the other). Please do not include the previous steps or errors you made along the way - include only the requested content for each image.
o
Note that the screenshots must follow their respective assignment instructions, in the correct order
, and the font is clear, easy to read (not too small or blurry).
Important
: Take screenshots as you go. The tables are saved from session to session, but the command history is not.
Again, all of the steps must be done in the MySQL Command Line.
Perform the following steps in order. Some steps are repeated on purpose.
Open the MySQL Command Line Client. Enter your password. 1.
The first query you must do is : SELECT NOW(); Take a screenshot now and paste it here (replace this bullet with your screenshot). 2.
Tell MySQL to use
the database labs
. Take a screenshot now and paste it here.
CGS 1540
Lab 3
Page 2
of 7
3.
Insert the following data in the table movie
. Notes:
NULL is not the same
as 'NULL'. It means that the data is not available.
Surf's Up must
include the apostrophe. See page 65 of the textbook
.
Insert all records with a single INSERT command.
title
year
duration
gross
Soul
2020
100
NULL
Surf's Up
2007
85
152
Trolls
2016
92
346.9
Trolls World Tour
2020
90
NULL
Zootopia
2016
108
1023.8
Take a screenshot now and paste it here.
For the next items, run SQL commands to perform exactly what is requested. Write the SQL queries to return only the requested data. You must write only one command per item (
a command ends with a semicolon
).
4.
List all the data
in your table movie
.
CGS 1540
Lab 3
Page 3
of 7
Take a screenshot now and paste it here. 5.
List only the title of all the movies in your table.
Take a screenshot now and paste it here. 6.
List only the movies that have a value for gross
(not NULL values). Include all columns in the result set.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
CGS 1540
Lab 3
Page 4
of 7
Take a screenshot now and paste it here. 7.
List only the title of the movies that have the word story anywhere in the title. Use wildcards.
Take a screenshot now and paste it here. 8.
List only the title of the movies that have the letter o as the second letter in the title. Use wildcards.
Take a screenshot now and paste it here.
CGS 1540
Lab 3
Page 5
of 7
9.
List only the title of the movies that have exactly 6 characters in the title. Use wildcards (do not use a function). Take a screenshot now and paste it here. 10.
List the title and year for all the movies released in 2019.
. 11.
List the title and year for all the movies, except the ones released in 2016. 12.
List only the title and year of all movies released in either 2016 or 2019.
CGS 1540
Lab 3
Page 6
of 7
13.
List the title and year of all movies, except the movies released in either 2016 or 2019. Take a screenshot now and paste it here. 14.
List only the movies released after 2018 that are longer than 101 minutes. Include all columns in the result set. Take a screenshot now and paste it here. 15.
List only the movies released after 2018, that have earnings (
gross)
either less than 200 (million) or greater than 800 (million). Include all columns in the result set.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
CGS 1540
Lab 3
Page 7
of 7
Take a screenshot now and paste it here. 16.
List only the title and duration of the movies that are between 90 and 92 minutes long (including 90 and 92). Take a screenshot now and paste it here. 17.
The last query you must do is : SELECT NOW(); Take a screenshot now and paste it here (replace this bullet with your screenshot). You may close the MySQL Client by entering the command quit or exit.