0% found this document useful (0 votes)
18 views10 pages

SQL Exam Full 50 Items

The document is an SQL Fundamentals Exam consisting of two parts: Fundamentals and Data Definition Commands, and Data Manipulation and Queries. It contains multiple-choice questions covering various SQL concepts, including data types, commands, constraints, and query clauses. Each question is assigned a point value, with Part I questions worth 2 points each and Part II questions worth 3 points each.

Uploaded by

shiiama312
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views10 pages

SQL Exam Full 50 Items

The document is an SQL Fundamentals Exam consisting of two parts: Fundamentals and Data Definition Commands, and Data Manipulation and Queries. It contains multiple-choice questions covering various SQL concepts, including data types, commands, constraints, and query clauses. Each question is assigned a point value, with Part I questions worth 2 points each and Part II questions worth 3 points each.

Uploaded by

shiiama312
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

SQL Fundamentals Exam

Part I: Fundamentals and Data Definition Commands (2 points each)

1. What does SQL stand for?

( ) a. Standard Query List

( ) b. System Query Language

(*) c. Structured Query Language

( ) d. Sequential Query Language

2. Which of the following is a valid SQL data type for dates?

( ) a. varchar

(*) b. datetime

( ) c. int

( ) d. image

3. Which SQL command creates a new database?

(*) a. CREATE DATABASE

( ) b. NEW DATABASE

( ) c. MAKE DATABASE

( ) d. INIT DATABASE

4. What does the SQL command DROP TABLE do?

( ) a. Deletes all records

(*) b. Removes a table structure

( ) c. Removes duplicates

( ) d. Creates a table

5. Which command is used to create a new table?

(*) a. CREATE TABLE

( ) b. MAKE TABLE

( ) c. NEW TABLE

( ) d. BUILD TABLE

6. To ensure a column cannot be NULL upon creation, which keyword is used?

( ) a. DEFAULT

( ) b. UNIQUE

(*) c. NOT NULL


SQL Fundamentals Exam

( ) d. CHECK

7. Which of the following is a character string data type?

( ) a. int

( ) b. datetime

(*) c. varchar

( ) d. money

8. Which SQL operator checks if a value exists in a set?

( ) a. LIKE

(*) b. IN

( ) c. BETWEEN

( ) d. IS NULL

9. The % symbol in a LIKE clause represents:

( ) a. One character

( ) b. No character

(*) c. Multiple characters

( ) d. Only numbers

10. Which of the following is a valid constraint for setting a default value?

( ) a. PRIMARY KEY

(*) b. DEFAULT

( ) c. NOT NULL

( ) d. UNIQUE

11. Which SQL data type is used for exact numeric values?

( ) a. real

( ) b. float

(*) c. int

( ) d. text

12. Which of the following is a logical operator in SQL?

( ) a. SELECT

( ) b. ADD

(*) c. OR
SQL Fundamentals Exam

( ) d. MULTIPLY

13. Which clause is used to sort the result set?

( ) a. GROUP BY

(*) b. ORDER BY

( ) c. HAVING

( ) d. SORT BY

14. To remove all rows from a table without deleting the table, use:

( ) a. DROP TABLE

(*) b. TRUNCATE TABLE

( ) c. DELETE TABLE

( ) d. REMOVE TABLE

15. Which command is used to modify an existing table?

( ) a. MODIFY TABLE

(*) b. ALTER TABLE

( ) c. UPDATE TABLE

( ) d. CHANGE TABLE

16. Which of the following creates a primary key during table creation?

( ) a. UNIQUE KEY

( ) b. PRIMARY CONSTRAINT

(*) c. PRIMARY KEY

( ) d. FOREIGN KEY

17. Which constraint ensures all values in a column are different?

( ) a. DEFAULT

( ) b. NOT NULL

( ) c. CHECK

(*) d. UNIQUE

18. Which command permanently deletes a database?

( ) a. DROP TABLE

(*) b. DROP DATABASE

( ) c. DELETE DATABASE
SQL Fundamentals Exam

( ) d. REMOVE DATABASE

19. Which clause is used to filter rows returned by a query?

( ) a. ORDER BY

( ) b. DISTINCT

(*) c. WHERE

( ) d. LIMIT

20. What is the use of the DISTINCT keyword?

( ) a. Selects rows with all values

( ) b. Removes all rows

(*) c. Selects unique values

( ) d. Sorts values

21. Which data type is best suited for storing large text documents?

( ) a. char

(*) b. text

( ) c. varchar

( ) d. int

22. Which type of SQL command is CREATE TABLE?

( ) a. Data Manipulation

( ) b. Data Query

( ) c. Data Control

(*) d. Data Definition

23. What does the CHECK constraint do?

( ) a. Ensures uniqueness

( ) b. Prevents NULLs

(*) c. Sets a condition

( ) d. Sets a default

24. To add a column to an existing table, which command is used?

( ) a. MODIFY COLUMN

(*) b. ALTER TABLE ... ADD

( ) c. CHANGE TABLE
SQL Fundamentals Exam

( ) d. INSERT COLUMN

25. Which keyword is used to reference a key in another table?

( ) a. UNIQUE

( ) b. CHECK

(*) c. FOREIGN KEY

( ) d. DEFAULT

Part II: Data Manipulation and Queries (3 points each)

26. Which command adds new records to a table?

( ) a. UPDATE

( ) b. MERGE

(*) c. INSERT

( ) d. ADD

27. Which clause is used to filter records?

( ) a. ORDER BY

( ) b. SELECT

(*) c. WHERE

( ) d. GROUP BY

28. How do you select all columns from a table?

( ) a. SELECT ALL

( ) b. SELECT EVERYTHING

(*) c. SELECT * FROM table_name;

( ) d. SELECT COLUMNS

29. The LIKE operator is used for:

(*) a. Pattern matching

( ) b. Sorting

( ) c. Arithmetic

( ) d. Grouping

30. The IN operator checks:

( ) a. Date values

( ) b. Range limits
SQL Fundamentals Exam

(*) c. Presence in a list

( ) d. Character length

31. What does the BETWEEN clause do?

( ) a. Matches pattern

( ) b. Checks NULL

(*) c. Specifies range

( ) d. Selects duplicates

32. How do you retrieve unique values?

( ) a. GROUP BY

( ) b. ORDER BY

(*) c. DISTINCT

( ) d. COUNT

33. What is the correct syntax to delete a specific record?

( ) a. REMOVE * FROM table

( ) b. DELETE * FROM table

(*) c. DELETE FROM table WHERE condition;

( ) d. DROP ROW

34. Which command modifies existing data?

( ) a. ALTER

(*) b. UPDATE

( ) c. MODIFY

( ) d. CHANGE

35. To select students aged 18 or older, use:

( ) a. WHERE Age = 18

(*) b. WHERE Age >= 18

( ) c. Age > '18'

( ) d. WHERE Age <= 18

36. To find all students without a section, use:

(*) a. IS NULL

( ) b. IS EMPTY
SQL Fundamentals Exam

( ) c. IS BLANK

( ) d. EQUALS NULL

37. Wildcard for a single character in LIKE clause is:

( ) a. %

(*) b. _

( ) c. *

( ) d. ?

38. What does the SELECT statement do?

( ) a. Insert data

( ) b. Update data

(*) c. Query data

( ) d. Delete data

39. The ORDER BY clause sorts results in:

( ) a. Random order

( ) b. Descending order only

(*) c. Ascending/Descending order

( ) d. Duplicate order

40. Which SQL command removes all data from a table?

( ) a. DROP

(*) b. TRUNCATE

( ) c. DELETE

( ) d. CLEAR

41. Which command selects all data from 'Students' table?

( ) a. SELECT ALL Students

( ) b. SELECT FROM Students

(*) c. SELECT * FROM Students;

( ) d. SELECT EACH Students

42. Which clause sorts results alphabetically by name?

( ) a. GROUP BY name

(*) b. ORDER BY name


SQL Fundamentals Exam

( ) c. FILTER BY name

( ) d. SORT name

43. Which operator checks for NULL?

( ) a. EQUAL NULL

(*) b. IS NULL

( ) c. = NULL

( ) d. NOT NULL

44. Which command changes the section of a student?

( ) a. SET Section

(*) b. UPDATE Students

( ) c. MODIFY Students

( ) d. INSERT INTO Students

45. Which clause checks if a value falls within a range?

( ) a. LIKE

( ) b. IN

(*) c. BETWEEN

( ) d. RANGE

46. What is the correct syntax to update a record?

( ) a. MODIFY table SET

(*) b. UPDATE table_name SET column=value WHERE condition;

( ) c. CHANGE value WHERE

( ) d. SET column=value

47. What does DELETE FROM table_name do?

( ) a. Deletes table

( ) b. Removes schema

(*) c. Deletes all records

( ) d. Deletes selected row

48. What happens if no WHERE clause is used with DELETE?

( ) a. Deletes one row

( ) b. Nothing
SQL Fundamentals Exam

(*) c. Deletes all records

( ) d. Syntax error

49. Which command is used to filter records with specific values in a list?

( ) a. SELECT ALL

( ) b. BETWEEN

(*) c. IN

( ) d. GROUP

50. To match names that start with 'J', use:

( ) a. LIKE 'J_'

(*) b. LIKE 'J%'

( ) c. IN ('J')

( ) d. BETWEEN 'J'

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy