FREE! Click here to Join FunTrivia. Thousands of games, quizzes, and lots more!
Quiz about SQL Commands and Database Concepts
Quiz about SQL Commands and Database Concepts

SQL Commands and Database Concepts Quiz


SQL or Structured Query Lanaguage is the most popular language used to create, retrieve, update and delete data from relational databases.

A multiple-choice quiz by kwdesigner. Estimated time: 4 mins.
  1. Home
  2. »
  3. Quizzes
  4. »
  5. Science Trivia
  6. »
  7. Computers
  8. »
  9. Software and Programming

Author
kwdesigner
Time
4 mins
Type
Multiple Choice
Quiz #
252,932
Updated
Dec 03 21
# Qns
10
Difficulty
Average
Avg Score
7 / 10
Plays
2110
Last 3 plays: ozzz2002 (6/10), Upstart3 (6/10), pollucci19 (9/10).
- -
Question 1 of 10
1. Which SQL command would you use to retrieve a record or records from the database? Hint


Question 2 of 10
2. Which SQL command would you use to add a new record (row) to the database? Hint


Question 3 of 10
3. Which SQL command would you use to modify the contents of an existing record (row) in the database? Hint


Question 4 of 10
4. What does the command: 'TRUNCATE TABLE Sample' do? Hint


Question 5 of 10
5. Look at the following SQL statement:

INSERT INTO ________________
VALUES (value1, value2)

What belongs in the blank?
Hint


Question 6 of 10
6. The ALTER tablename command would be used to... Hint


Question 7 of 10
7. This aggregate SQL function will return the number of rows in a database table. Hint


Question 8 of 10
8. This is a column with a unique value for each row used to bind data together, across tables, without repeating all of the data in every table. Hint


Question 9 of 10
9. This type of JOIN statement will return all the rows from the first table, even if there are no matches in the second table. Hint


Question 10 of 10
10. A WHERE clause can be added to a SELECT statement to add conditions to the rows being returned.

SELECT * FROM products WHERE ordernumber >= 1000

What rows will this select statement return?
Hint



(Optional) Create a Free FunTrivia ID to save the points you are about to earn:

arrow Select a User ID:
arrow Choose a Password:
arrow Your Email:




Most Recent Scores
Jul 08 2024 : ozzz2002: 6/10
Jul 08 2024 : Upstart3: 6/10
Jul 08 2024 : pollucci19: 9/10
Jun 13 2024 : moonraker2: 6/10
May 16 2024 : lg549: 8/10

Score Distribution

quiz
Quiz Answer Key and Fun Facts
1. Which SQL command would you use to retrieve a record or records from the database?

Answer: SELECT

In most applications, SELECT is the most commonly used SQL command.
2. Which SQL command would you use to add a new record (row) to the database?

Answer: INSERT

INSERT is used to add rows to an existing table.
3. Which SQL command would you use to modify the contents of an existing record (row) in the database?

Answer: UPDATE

UPDATE is used to modify the values of a set of existing table rows.
4. What does the command: 'TRUNCATE TABLE Sample' do?

Answer: Empties all data (rows) from the table called Sample.

TRUNCATE removes all data (rows) from the table but leaves the structure of the table intact.
5. Look at the following SQL statement: INSERT INTO ________________ VALUES (value1, value2) What belongs in the blank?

Answer: the table name

INSERT INTO table_name
VALUES (value1, value2)

In addition to the above syntax, you may also specify the columns for which you want to insert data:

INSERT INTO table_name (column1, column2)
VALUES (value1, value2)
6. The ALTER tablename command would be used to...

Answer: add columns to or drop columns from an existing database table

The ALTER statement is used to add or drop columns in an existing table.
7. This aggregate SQL function will return the number of rows in a database table.

Answer: COUNT(column_name) or COUNT(*)

The count function is common to most DBMS including MySQL, MS Access, and Microsoft SQL Server.
8. This is a column with a unique value for each row used to bind data together, across tables, without repeating all of the data in every table.

Answer: Primary Key

Primary keys are essential in creating a relational database.
9. This type of JOIN statement will return all the rows from the first table, even if there are no matches in the second table.

Answer: LEFT JOIN

JOIN commands allow you to select data from two tables at the same time.
10. A WHERE clause can be added to a SELECT statement to add conditions to the rows being returned. SELECT * FROM products WHERE ordernumber >= 1000 What rows will this select statement return?

Answer: All rows in the products table whose order number is greater than or equal to 1000.

Many different operators are available to add conditions to the WHERE statement.
Source: Author kwdesigner

This quiz was reviewed by FunTrivia editor crisw before going online.
Any errors found in FunTrivia content are routinely corrected through our feedback system.
Related Quizzes
1. Java Average
2. Computer Viruses Difficult
3. Compact Discs (CDs) Tough
4. Beginning C Programming Average
5. Microsoft Word 2000 for Windows Average
6. Oh Say Can You C++, Version 1.0 Average
7. Java Programming Average
8. Data Structures Tough
9. Number Bases Average
10. Software Engineering Tough
11. Sorting Tough
12. Microsoft Word 2000 for Windows - Part 2 Tough

7/14/2024, Copyright 2024 FunTrivia, Inc. - Report an Error / Contact Us