What is a DBMS?
A Database Management System (DBMS) is software that enables users to create, update, and manage databases efficiently.
Define a relational database.
A relational database organizes data into tables (relations) consisting of rows and columns, enabling relationships between the data to be established.
What is a primary key?
A primary key is a column (or set of columns) in a table that uniquely identifies each row in the table.
What is a composite primary key?
A composite primary key is a primary key that consists of two or more columns, used to uniquely identify rows in a table.
Define a foreign key.
A foreign key is a column in one table that refers to the primary key in another table, establishing a relationship between the two tables.
What is a data type in SQL?
A data type specifies the type of data that a column can hold, such as integers, strings, or dates.
What is a default value in SQL?
A default value is the value automatically assigned to a column when no explicit value is provided during insertion.
What is Standard SQL?
Standard SQL is a standardized language for querying and manipulating relational databases.
Define Transact-SQL.
Transact-SQL (T-SQL) is a proprietary extension of SQL used in Microsoft SQL Server.
What are tables, rows, and columns in a database?
A table is a collection of related data, rows are individual records, and columns are the fields defining data attributes.
What is a null value?
A null value represents missing or unknown data in a database.
Explain the concept of an identity column.
An identity column automatically generates a unique number for each new row in a table.
What is a result set in SQL?
A result set is the collection of rows returned by a query.
Differentiate between an inner join and an outer join.
An inner join retrieves rows with matching values in both tables, while an outer join includes all rows from one table and matching rows from the other, with nulls for non-matches.
What is a schema in a database?
A schema is the structure that defines how data is organized in a database, including tables, columns, and relationships.
Define a database diagram.
A database diagram visually represents the structure of a database, including its tables and relationships.
What is a cascading update in SQL?
A cascading update automatically updates the foreign key values in related tables when the primary key value is updated.
What is a Boolean expression?
A Boolean expression is a logical statement that evaluates to true or false.
What is a column alias?
A column alias is a temporary name assigned to a column in a query result for better readability.
Define a scalar function in SQL.
A scalar function operates on a single value and returns a single value, such as LEN() or GETDATE().
What are aggregate functions?
Aggregate functions perform calculations on a group of values and return a single value, such as SUM(), AVG(), and COUNT().
What is a subquery?
A subquery is a query nested inside another query, used to retrieve data for the main query.
What are string data types?
String data types store alphanumeric characters, including fixed-length (CHAR) and variable-length (VARCHAR) strings.
Explain implicit and explicit data type conversions.
Implicit conversion is automatically performed by SQL, while explicit conversion requires functions like CAST() or CONVERT().
What is a view in SQL?
A view is a virtual table based on the result of a query, used for simplifying complex queries and enhancing security.
What is a stored procedure?
A stored procedure is a precompiled collection of SQL statements stored in the database, used to perform repetitive tasks.
What are the benefits of normalization?
Normalization reduces redundancy and improves data integrity by organizing data into efficient structures.
What is the first normal form?
A table is in the first normal form if each column contains atomic (indivisible) values and each row is unique.
What is referential integrity?
Referential integrity ensures that relationships between tables remain consistent, typically enforced using foreign key constraints.
Define an index in SQL.
An index improves query performance by providing a quick way to look up data in a table.
What are scalar and string functions?
Scalar functions operate on single values, while string functions manipulate text, such as CONCAT() and SUBSTRING().
What is a Cartesian product in SQL?
A Cartesian product is the result of a cross join, combining all rows from two tables.
What is the difference between a fully-qualified and partially-qualified object name?
A fully-qualified name includes the database, schema, and object, while a partially-qualified name omits some of these components.
What is the purpose of a linking table?
A linking table resolves many-to-many relationships by storing primary keys from the related tables as foreign keys.
What is data redundancy?
Data redundancy occurs when the same data is stored in multiple places, leading to potential inconsistencies.
What are the benefits of using indexes?
Indexes speed up data retrieval and improve query performance, especially on large datasets.
What is a logical operator in SQL?
Logical operators, such as AND, OR, and NOT, are used to combine or negate Boolean expressions.
What is a nested sort?
A nested sort specifies multiple levels of sorting in a query, using ORDER BY with multiple columns.
What are the types of joins in SQL?
Types of joins include inner join, left outer join, right outer join, full outer join, and cross join.
What is the purpose of a calculated value?
A calculated value is derived from existing data using expressions or functions in a query.
What are system stored procedures?
System stored procedures are built-in procedures provided by SQL Server to perform administrative tasks.
What is a return value in a stored procedure?
A return value is a single value returned by a stored procedure to indicate success, failure, or other statuses.
What are the steps in data structure design?
Steps include identifying entities, defining attributes, establishing relationships, and normalizing the data structure.
What is the second normal form?
A table is in the second normal form if it is in the first normal form and all non-key attributes are fully dependent on the primary key.
What is the third normal form?
A table is in the third normal form if it is in the second normal form and all attributes are only dependent on the primary key.
What is a fully-qualified object name?
A fully-qualified object name specifies the database, schema, and object name, ensuring clarity in references.
What is a correlation name?
A correlation name is a table alias used in queries to simplify references to table names.
What is an entity in database design?
An entity represents an object or concept in a database, with attributes defining its properties.
What is a composite key?
A composite key is a combination of two or more columns that uniquely identify a row in a table.
Define the term 'unnormalized data structure.'
An unnormalized data structure contains data that has not been organized to eliminate redundancy.
What is a wildcard in SQL?
A wildcard is a character used in search patterns, such as % for multiple characters and _ for a single character.
What is a concatenation operator?
A concatenation operator combines two or more strings into a single string, such as using '+' in T-SQL.
What are the benefits of views in SQL?
Views simplify complex queries, enhance security by restricting data access, and improve query organization.
What is a script in SQL Server?
A script is a collection of SQL statements written in a file or batch for execution.
What is normalization in database design?
Normalization organizes data to reduce redundancy, improve consistency, and simplify maintenance.