Quiz
SQL Quiz Revature
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (45)
1What do we call a primary key that consists of multiple columns in a table?
- Acomposite key
- Bconsisting key
- Cforeign key
- Ddouble-primary key
- Ecomposting key
2When defining a table you cannot...
- ADefine an aggregate value of the column
- BSpecify what to do with a row when a referenced row is deleted
- CDefine a default value for a column
- DDefine a column as unique
- EI don't know the right answer so just click this one. None of the others will give you a correct answer anyways.
3ACID stands for:
- AAtomicity, Consistency, Isolation, Durability
- BAuthentic, Consistency, Immutable, Duplicable
- CAtomicity, Compatable, Immutable, Durability
- DAutomated, Compatable, Isolation, Deterministic
- EThis is the 'correct' answer.
4The UNIQUE constraint requires that values must be...
- AUnique in the table
- BUniquely reference a primary key
- CUnique in the row
- DUnique in the column
5In SQL, NULL values...
- ARepresent the lack of a value for a column
- BMay throw NullPointerExceptions
- CHave undefined behavior in logical expressions
- DAre only valid in columns with the NULLABLE constraint
6Referential integrity stipulates...
- AForeign keys must always reference a valid primary key
- BEvery table must have a primary key
- CJoins should only be used with foreign and primary keys
- DColumns should be atomic
7What is the difference between WHERE and HAVING?
- AWHERE filters data prior to aggregation, HAVING filters data after aggregation
- BThey are the same
- CWHERE is used to filter data from the selected table, having is used to filter data from a joined table
- DHAVING is used to specify the conditions for joining tables
- EDon't know. This one is marked 'correct'.
8A foreign key is...
- AA constraint which defines that a column references a primary key in another table or row
- BA virtual column which will show data from a another table
- CA value used to uniquely identify a row
- DData which is loaded from an external database
9A primary key is
- AAll of these
- BImplicitely UNIQUE
- CImplicitely NOT NULL
- DA value used to uniquely identify a row
10Denormalization is...
- AThe process of adding redundancy to a database
- BAbstracting data
- CUsing triggers to automate tasks
- DPutting the database in an exceptional state that prevents public access
11Constraints are...
- AUsed to restrict values that can be placed in a column
- BA limitation to the size of a table
- CUsed to limit the operations a user has access to
- DA restriction on the number of operations a database may make in a given period of time
12MAX(), SUM(), and COUNT() are examples of...
- AAggregate functions
- BScalar functions
- COperators
- DSequences
13UPPER(), ABS(), CONCAT() are examples of
- AScalar functions
- BAggregate Functions
- CConstraints
- DFilters
- EDon't know. This one marked as 'correct'
14Which relationship(s) would be described as a many to many relationship?
- AA student and course
- BA student and a professor
- CA student and a textbook
- DA professor and a course
15What is required of a primary key?
- AUnique Value
- BInteger Data Type
- CNot Null
16Insert is a part of this sublanguage:
- ADML
- BDQL
- CTCL
- DDDL
- EDon't know. This one is marked as 'correct'
17The LIKE operator supports % as a wildcard character.
- ATrue
- BFalse
18Which command is used to remove a table from memory?
- ADELETE
- BDROP
- CTRUNCATE
- DREMOVE
- EDon't know. This one marked as 'correct'
19Which command is used to change the structure of an existing table?
- ACHANGE
- BALTER
- CUPDATE
- DMODIFY
20Which command is used for defining new tables or databases?
- ADEFINE
- BCREATE
- CSELECT
- DNEW
21DML statements include commands like CREATE, DROP, and ALTER
- ATrue
- BFalse
22A subquery is a SQL query that inserts a record into a table.
- ATrue
- BFalse
23Which of the following can be used to remove only records from the Customers table that have a first_name starting with 'S'?
- ADELETE FROM Customers
- BDELETE FROM Customers WHERE first_name LIKE 'S%';
- CDELETE FROM Customers WHERE first_name LIKE '%S';
- DDELETE * FROM Customers;
24In a one-to-many relationship, rows in one table can refer to multiple rows in another, but that other table can only refer to at most one row in the former table
- ATrue
- BFalse
25In a one-to-one relationship, a record in one table can at most refer to one record in another table.
- ATrue
- BFalse
26In a many-to-many relationship, you typically use a third table to manage the actual associations between rows in one table and another.
- ATrue
- BFalse
27DDL Statements include commands like INSERT, UPDATE, and DELETE?
- ATrue
- BFalse
28DDL is a subset of SQL that deals with data creation and includes commands like CREATE
- ATrue
- BFalse
29Which command is used to remove all data from a table but keep its structure?
- ATRUNCATE
- BDROP
- CDELETE
- DREMOVE
- EDon't know. This one marked 'correct'
30Which of the following correctly shows how to create a comment in SQL?
- A-- this is a comment
- B// this is a comment
- C? This is a comment
- D(This is a comment
- EDon't know
31Which of the following SQL datatypes is best used to represent a decimal number?
- AINTEGER
- BSMALLINT
- CTIMESTAMP
- DNUMBER
32A primary key is used to uniquely identify a particular entry or row in a table.
- ATrue
- BFalse
33What is the difference between MINUS, INTERSECT?
- AMINUS returns only rows returned by both queries. INTERSECT returns only unique rows returned by the first query but not by the second
- BINTERSECT returns all rows returned the first query. MINUS returns rows returned by the second query
- CINTERSECT returns duplicate rows from the first table, where MINUS returns duplicate rows from the second
- DINTERSECT returns only rows returned by both queries. MINUS returns only unique rows returned by the first query but not by the second
34What is the difference between UNION and UNION ALL?
- AUNION will join two tables, whereas UNION ALL joins all tables
- BUNION ALL returns only distinct rows, while UNION returns duplicate rows
- CUNION returns only distinct rows, while UNION ALL returns all rows
- DUNION ALL will join two tables, whereas UNION joins only rows in the tables
35What is not a use of the WHERE clause?
- AWHERE can be used with UPDATE statements
- BWHERE can be used with DELETE statements
- CWHERE locates which database/schema/table where a row is located
- DWHERE places a restriction on the rows returned by a query
36How do you sort the results of a SELECT statement in SQL?
- AYou do that in C#, not in SQL.
- BORDER BY
- CSORT BY
- DAESC or DESC after the WHERE clause
37What is a view?
- AA physical table created by the database based on the result-set of an SQL statement
- BA virtual table based on the result-set of an SQL statement
- CA GUI for accessing data returned by a SQL statement
- DAnother name for a table in SQL
38What is the difference between INNER JOIN and OUTER JOIN?
- AAn outer join will return only the rows that match based on the join predicate
- BAn outer join will return all rows in the left table and those that match in the right table
- CAn inner join will return rows that are not common between both table
- DInner join will return only the rows that match based on the join predicate
39What is the difference between scalar functions and aggregate functions?
- AAggregate functions return a single value, and scalar functions return a single value, calculated from values in a column
- BScalar functions return a single value, and aggregate functions return a single value, calculated from values in a column
- CAggregate functions cannot use a GROUP BY clause
40What is the difference between Order By and Group By?
- AORDER BY is used for sorting results, whereas GROUP BY is used with aggregate functions to group results
- BGROUP BY is used for sorting results, whereas ORDER BY is used with aggregate functions to group results
- CORDER BY is used for sorting results, however SQL does not have a GROUP BY statement
- DGROUP BY is used with aggregate functions to group results, however SQL does not have an ORDER BY statement
41What's an index?
- AIndex is another term for primary key
- BIndexes allow a database to run INSERT statements faster
- CIndexes allow the database application to find data without reading the whole table
- DIndexes speed up the truncate process
- EDon't know
42What is a cursor?
- AA pointer to the context area that holds the rows returned by a SQL statement
- BThe icon used to point to the buttons on the GUI
- CA temporary index to place on a table
- DA stored procedure that triggers on a DDL statement
- EDon't know
43What is a trigger?
- AStored programs in ANSI SQL which are automatically executed or fired when some event occurs
- BA block of SQL code that runs on a timer
- CPL/SQL does not support triggers
- DStored programs in PL/SQL which are automatically executed or fired when some event occurs
- EDon't know
44If TableA has 100 rows and TableB has 10 rows, how many rows would be retrieved from the following query: SELECT * FROM TableA, TableB
- A100
- B10
- C10000
- D1000
- EDon't know
45Which is not a join available in SQL?
- ALEFT JOIN
- BRIGHT JOIN
- CINNER JOIN
- DUNDER JOIN
Information
- Description
- Quiz on SQL Quiz Revature, created by Wesley Letcher on 17/06/2019.
- Author
- Wesley Letcher
- Language
- English
- Views
- 4
- Rating
- No ratings yet Rate this quiz