Quiz
SQL Queries
This quiz has question types that open in the usual player.
Questions in this quiz (18)
1Complete the syntax needed to check the number of rows in a "movie" table:
SELECT [blank_start]count(*)[blank_end] FROM movies- Acount(*)
2How would you structure a query if you wanted to view two different columns (name and age) from the same table(employees)?
SELECT [blank_start]name, age[blank_end] FROM employees- Aname, age
3In many situations we're only interested in a subset of the data we have available. In order to be more specific in our queries we can use what operator after specifying the table?
- ASUBSET
- BWHERE
- CPARAMS
- DHOLDING
4What kind of syntax would we use to find out how many employees in our database have the name Joe?
[blank_start]SELECT[blank_end] name [blank_start]FROM[blank_end] employees [blank_start]WHERE[blank_end] name = "Joe"- ASELECT
- BFROM
- CWHERE
5If you wanted to check more than one conditional statement in a query string, what command would you use?
- APLUS
- BALSO
- CINCLUDING
- DAND
6what syntax would be used to find someone named "David" who was born after 1960 in a table called "employees"?
[blank_start]SELECT[blank_end] names, birthdays [blank_start]FROM[blank_end] employees [blank_start]WHERE[blank_end] names = David [blank_start]AND[blank_end] birthdays > 1960;- ASELECT
- BFROM
- CWHERE
- DAND
7If was only interested in searching for a portion of a name, what command would I use?
- ALIKE
- BINCLUDING
- CHOLDING
- DSIMILAR
8when calling the LIKE operator in a query string, we are able to get back values that may only include a portion of what we asked for.
- ATrue
- BFalse
9When using the LIKE operator, we must wrap our specific query in what syntax?
- ALIKE "selection"
- BLIKE '%selection%'
- CLIKE @selection
- DLIKE selection
10How would I structure a query statement to find all movies with a name that includes "crazy" in a table called "movies"?
[blank_start]SELECT[blank_end] names [blank_start]FROM[blank_end] movies [blank_start]WHERE[blank_end] names [blank_start]LIKE[blank_end] [blank_start]'%[blank_end]crazy[blank_start]%'[blank_end]- ASELECT
- BFROM
- CWHERE
- DLIKE
- E'%
- F%'
11How would I structure a query statement to find all movies with a name that did not include "crazy" in a table called "movies"?
[blank_start]SELECT[blank_end] names [blank_start]FROM[blank_end] movies [blank_start]WHERE[blank_end] names [blank_start]NOT[blank_end] LIKE '%crazy%'- ASELECT
- BFROM
- CWHERE
- DNOT
12Using the BETWEEN and the NOT BETWEEN methods can allow you to search for values that fall between two parameters
- ATrue
- BFalse
13What syntax would I use if I wanted to locate all products in my store table that had a price between 10 and 20?
[blank_start]SELECT[blank_end] * [blank_start]FROM[blank_end] store [blank_start]WHERE[blank_end] price [blank_start]BETWEEN[blank_end] 10 AND 20;- ASELECT
- BFROM
- CWHERE
- DBETWEEN
14If I wanted to view a list of items in a certain order, what command would I use?
- AORDER BY
- BORDER WITH
- CSHOW IN ORDER
- DORDER
15When the ORDER BY command is used, what order will the information default to?
- Aascending
- Bdecending
16If I wanted to show my ordered information in a descending manner, what would I add to the end of my query string?
- ADOWN
- B!ASC
- CDSC
- DDESC
17If I only wanted a certain number of values to be displayed, what command would I use?
- ASTOP AFTER
- BLIMIT
- CONLY
- DINCLUDE
18How can I structure a SQL query to look for 10 names on people in my employees table with the name "Joe"
[blank_start]SELECT[blank_end] names [blank_start]FROM[blank_end] employees [blank_start]WHERE[blank_end] names [blank_start]LIKE[blank_end] '%Joe%' [blank_start]LIMIT[blank_end] 10;- ASELECT
- BFROM
- CWHERE
- DLIKE
- ELIMIT
Information
- Description
- 1 Web Development (SQL) Quiz on SQL Queries, created by jlangford on 04/06/2016.
- Author
- jlangford
- Language
- English
- Views
- 1
- Tags
- Rating
- No ratings yet Rate this quiz