NEW
Font size
WorksheetsSQL Basics
Total questions: 29
Worksheet time: 58mins
What does SQL stand for?
Strong Question Language
Structured Query Language
Structured Question Language
Strong Query Language
Which SQL Statement is used to get data from a database
GET
EXTRACT
SELECT
SHOW
What is missing from the following SQL statement:
SELECT * _______ Customers;
SELECT
ORDER BY
WHERE
FROM
What is the purpose of a * ?
Selects all fields from a table
Selects all rows from a table
Selects the first record from a table
Selects the last record from a table
Which of the following does not describe the relationship in the diagram
A player can play no games or many games
A game must have at least one player
A game can have more then one player
A player has to play at least one game
Which clause lets you filter data?
SORT
ORDER BY
WHERE
FILTER
For an AND operator either condition must be true to return a record.
True
False
What does the FROM clause do?
Selects the columns to be returned
Selects the rows to be returned
Selects the table to use in the query
Selects the database to use in the query
Which of the following is used to select all the records from the Order Table where the Price is more then $100?
SELECT * FROM Order WHERE Price > 100;
SELECT [all] FROM Order WHERE Price > 100;
SELECT Order WHERE Price > 100;
SELECT * FROM Order WHERE Price OVER 100
Which of the following allows you to add more then one filter to a query?
LIKE
BETWEEN
EQUALS
OR
You must always use ______ when filtering string values?
Percent Signs
Exclamation Mark
Quote Marks
Asterisk
A Foreign Key is:
Specifies which table to select or delete data from
Two or more columns in a table that can be used to uniquely identify each row
A constraint that uniquely identifies each record in a database table
A constraint that is a key used to link two tables together
What does the notation in the image mean?
One
One and only one
One or more
One or none
Which of the following is NOT required for the following query: "Get all books that have a user rating higher then 3.5"
SELECT
FROM
WHERE
ORDER BY
A Primary Key can be a null value.
True
False
When looking at a row in a table we refer to it as a?
Record
Result
Row
Information
When looking at a column in a table we refer to it as a?
Name
Field
Column
Data Type
A Primary Key ensures that each value in the field is:
Meaningful
Identical
A number
Unique
To get all of the matching records between Table A and Table B you would use which of the following?
Left Outer Join
Right Outer Join
Inner Join
Cartesian Table
What will this SQL query return?
All the records in tableA and the matching records in tableB
The records where there is a match between tableA and tableB
The records from tableA where there is a match and all the records from tableB
All of the records from both tables.
With SQL, how can you insert a new record into the "Person" table?
Which operator is used to search for a specified pattern in a column?
LIKE
GET
FROM
SOME
Which SQL Command changes data that already exists in a table?
EDIT
MODIFY
UPDATE
ALTER
Which of the following clause allows us to extract data in a range?
RANGE
BETWEEN
FIND IN
LIKE
Which of the following shows comment in SQL?
/* This is a comment. */
# This is a comment.
% This is a comment. %
& This is a comment.
Which of the following is true about NULL values in SQL?
A NULL value means zero.
A null value can only be used with numeric attributes.
Null value means that data of that field is not available.
None of these
This part of the Join is doing what?
Setting the ID column of tableA to the same as the ID column of tableB
Identifying the columns to use when checking for records that match
Setting a foreign key relationship between tableA and tableB on IDColumn
Selecting the tables to join together.
What happens when we run the below query but emp_id ‘AR5’ doesn’t exist in our table?
SELECT * FROM DataFlair_info WHERE emp_id = ‘AR5’
Error in the query execution.
Compilation error.
Nothing appears in the result tab.
None of these.
Which of the following is not a constraint in SQL?
UNIQUE
NULL
NOT NULL
PRIMARY KEY
