If you’re looking to test your knowledge on AWS Redshift, this curated set of 30 multiple-choice questions (MCQs) will help you understand key concepts. These questions cover Core Database Concepts, Schemas and Tables, Data Types, Constraints and Keys, and Basic Querying in SQL. This is perfect for students and professionals preparing for AWS Redshift assessments or interviews. Answers are provided in a table at the end.
AWS Redshift MCQs
Understanding Schemas and Tables
Which of the following is true about schemas in Redshift? a) They are used to store metadata b) They organize database objects c) They are only accessible to superusers d) They limit the size of data
How can you create a schema in Redshift? a) CREATE SCHEMA schema_name; b) INSERT INTO schema_name; c) DEFINE schema_name; d) ALTER SCHEMA schema_name;
What is the default schema when a user logs in to a Redshift database? a) public b) default c) admin d) custom
Which command lists all schemas in the current database? a) LIST SCHEMAS; b) SHOW SCHEMAS; c) SELECT * FROM pg_schemas; d) DESCRIBE SCHEMAS;
What is a table in Redshift? a) A view of joined data b) A structured set of data c) A placeholder for schemas d) An archive for database logs
Data Types Supported by Redshift
Which data type is best for storing alphanumeric characters? a) INT b) VARCHAR c) BOOLEAN d) DECIMAL
What is the maximum size of a VARCHAR column in Redshift? a) 256 b) 4096 c) 65535 d) 1MB
Which of these is a supported numeric data type in Redshift? a) TEXT b) FLOAT8 c) ARRAY d) TIMESTAMP
What happens when you insert a value longer than the defined size of a VARCHAR column? a) Data is truncated b) Data is rejected c) Column size auto-increases d) Redshift raises a warning
Which data type would you use for true/false values? a) INTEGER b) BOOLEAN c) CHAR d) SMALLINT
Constraints and Keys
What is the primary purpose of constraints in Redshift? a) Data formatting b) Data validation c) Performance tuning d) Logging
Which constraint ensures uniqueness in a column? a) FOREIGN KEY b) UNIQUE c) DEFAULT d) CHECK
What is a primary key in Redshift? a) A constraint that allows NULL values b) A constraint that ensures each row is unique c) A key used for database backups d) A reference key for joins
Can a table in Redshift have multiple primary keys? a) Yes b) No
Which constraint allows linking two tables through a relationship? a) DEFAULT b) UNIQUE c) FOREIGN KEY d) NOT NULL
Basic Querying with SQL
What SQL command is used to retrieve data from a table? a) SELECT b) FETCH c) QUERY d) RETRIEVE
How do you limit the number of rows returned by a query in Redshift? a) LIMIT b) WHERE c) ROWS d) TOP
What does the following SQL statement do: DELETE FROM users WHERE id = 5;? a) Removes all data from the users table b) Updates the row with ID = 5 c) Deletes the row where ID = 5 d) Selects data where ID = 5
Which operator is used for pattern matching in SQL? a) = b) LIKE c) IN d) BETWEEN
What is the result of the following query: SELECT COUNT(*) FROM orders;? a) Total columns in orders b) Total rows in orders c) All data from orders d) Unique rows in orders
Advanced Questions
How do you rename a table in Redshift? a) UPDATE TABLE table_name; b) ALTER TABLE table_name RENAME TO new_table_name; c) RENAME TABLE table_name TO new_table_name; d) MODIFY TABLE table_name;
What does the EXPLAIN command do in Redshift? a) Executes a query b) Analyzes the query execution plan c) Describes table constraints d) Lists table columns
What is the purpose of the ANALYZE command in Redshift? a) Updates query statistics b) Cleans up unused space c) Rebuilds table data d) Renames columns
Which function converts data to lowercase in SQL? a) TO_CHAR() b) LOWER() c) LCASE() d) CONVERT()
What does the DISTINCT keyword do in a query? a) Limits rows b) Removes duplicates c) Optimizes execution d) Reorders columns
What is the role of a Distribution Key in Redshift? a) Indexing data b) Partitioning data c) Distributing data across nodes d) Sorting data
Which SQL clause is used to sort query results? a) GROUP BY b) ORDER BY c) FILTER d) LIMIT
How do you join two tables in SQL? a) WITH b) JOIN c) UNION d) INTERSECT
What does a NULL value in SQL mean? a) Zero b) Undefined value c) Empty string d) Unused column
Which SQL function returns the current date in Redshift? a) CURRENT_DATE() b) GETDATE() c) TODAY() d) NOW()
Answers
Qno
Answer
1
b) They organize database objects
2
a) CREATE SCHEMA schema_name;
3
a) public
4
b) SHOW SCHEMAS;
5
b) A structured set of data
6
b) VARCHAR
7
c) 65535
8
b) FLOAT8
9
a) Data is truncated
10
b) BOOLEAN
11
b) Data validation
12
b) UNIQUE
13
b) A constraint that ensures each row is unique
14
b) No
15
c) FOREIGN KEY
16
a) SELECT
17
a) LIMIT
18
c) Deletes the row where ID = 5
19
b) LIKE
20
b) Total rows in orders
21
b) ALTER TABLE table_name RENAME TO new_table_name;