SANS GFACT SQL Quiz Questions
The UNION operator is used to emulate a FULL JOIN, not supported by MySQL
True
The first table in a LEFT JOIN will always have all of its records returned in the query no matter what the condition of the join is
True
To retrieve rows that meet defined conditions in 2 tables, use the INNER JOIN command
True - An INNER JOIN is used for retrieving rows that meet a condition in both tables
To combine results from two or more table queries, you would use the JOIN clause?
True - The JOIN command, INNER, LEFT and RIGHT, are used to combine output from queries to different database tables
The 'WHERE' SQL command is used to filter data that meet certain criteria.
True - The `WHERE` clause helps us to filter records to only the ones that match a certain condition, i.e.the defined value within a database column
Database fields do not have to have a defined datatype, like they do in programming
False - Each field must have a specified datatype. SQL is a structured database, so each field has a static type.
The data in non-relational databases is structured, just like relational databases.
False - Non-relational databases are for use when the kind of data is not known, and/or if the type of data changes frequently.
The `EXISTS` operator checks for the existence of records in a subquery before the subquery is evaluated
False - The 'EXISTS' operator evaluates subqueries after all the subqueiries are evaluated
The `default NULL` constraint means that if no value is entered into this field for a row then the value defaults to an empty field.
False - The `default NULL` constraint means that if no value is entered into this field for a row then the value defaults to `NULL`.
To select all data from a table, use the wild card character '!', exclamation point
False - The asterisks '*' is the wild card character
When using the AS command, the renaming of the field is permanent
False - The renaming of a field using the AS command only exists fo the duration of the SQL query.
The first table to be joined is mentioned in the INNER JOIN clause.
False - The second table to be joined is mentioned in the INNER JOIN clause.
When you execute a query that contains a subquery, the subquery is evaluated at the same time as the query
False - The subquery is evaluated first and then the result of that query is used in the enclosing query
The CONSTRAINTS operator is used to define rules for a field in a table
False - There is no CONSTRAINT operator, rather we use commands like FOREIGN KEY, PRIMARY KEY or REFERENCES
Operators UNION, IN, LIKE and SOME are examples of Comparison operators
False - These are Logical operators
When using the SELECT command, data is returned in alphabetical order
False - Use the ORDER BY command along with the SELECT command to order the data returned
Scripting table creation must be done with a scripting language like Python
False - You can combine command into a single script to automate the creation and insertion of tables.
a LEFT JOIN includes matching results from the first table and all results from the second table
False - the RIGHT JOIN command includes matching results from the first table and all results from the second table