SQL Flashcards
(45 cards)
What does SQL stand for?
Structured Query Language
True or False: PostgreSQL is an open-source relational database management system.
True
Fill in the blank: In SQL, the command to retrieve data from a database is ______.
SELECT
What is the purpose of normalization in databases?
To reduce data redundancy and improve data integrity.
What does the acronym ACID stand for in database transactions?
Atomicity, Consistency, Isolation, Durability
Which SQL command is used to add new records to a table?
INSERT
True or False: A primary key can contain duplicate values.
False
What type of relationship is represented by a foreign key in a database?
A relationship between two tables.
Multiple choice: Which of the following is NOT a type of JOIN in SQL? A) INNER JOIN B) OUTER JOIN C) CROSS JOIN D) LINK JOIN
D) LINK JOIN
What is a database schema?
The structure that defines the organization of data in a database.
Fill in the blank: The command to delete records from a table in SQL is ______.
DELETE
True or False: A unique constraint allows for duplicate values in a column.
False
What is the purpose of the GROUP BY clause in SQL?
To arrange identical data into groups.
Which SQL command is used to modify existing records in a table?
UPDATE
What is the result of a LEFT JOIN?
It returns all records from the left table and matched records from the right table.
What is the difference between a primary key and a foreign key?
A primary key uniquely identifies a record in its own table, while a foreign key links to a primary key in another table.
Multiple choice: Which SQL function is used to count the number of rows in a result set? A) COUNT() B) SUM() C) AVG() D) TOTAL()
A) COUNT()
Fill in the blank: The SQL command ______ is used to create a new table.
CREATE TABLE
True or False: In PostgreSQL, data types can be customized by the user.
True
What is a composite key?
A key that consists of two or more attributes that together uniquely identify a record.
What does the term ‘denormalization’ refer to?
The process of combining tables to reduce the complexity of queries and improve performance.
Multiple choice: Which of the following is a valid SQL data type? A) INTEGER B) NUMBER C) TEXT D) All of the above
D) All of the above
What is the SQL command to create an index?
CREATE INDEX
Fill in the blank: The ______ clause is used to filter records in a SQL query.
WHERE