SQL Queries Flashcards
Which of the following is the correct syntax for referencing an Attribute within an Entity in an SQL Query?
A. {Entity}.[Attribute]
B. (Entity).{Attribute}
C. [Entity].{Attribute}
D. Entity.Attribute
A. {Entity}.[Attribute]
What does the term “SQL dialect” refer to?
A. The specific version of the SQL language used by a particular database system.
B. The way in which SQL code is written in a specific region.
C. The process of converting SQL code into machine-readable instructions.
D. The specific type of data a database can store.
A. The specific version of the SQL language used by a particular database system.
What is the difference between an Entity and a Structure in OutSystems?
A. An Entity represents data stored in a database, while a Structure is a data type definition.
B. An Entity is a data type, while a Structure represents a table in the database.
C. Entities can be used to define relationships between tables, while Structures are used for simple data types.
D. Entities can be used in both client-side and server-side logic, while Structures are used only on the server side.
A. An Entity represents data stored in a database, while a Structure is a data type definition.
What is the purpose of “input parameters” in SQL Queries?
A. To allow dynamic values to be passed into the query at runtime.
B. To define the data types of the columns in the query result.
C. To specify the order in which data is retrieved from the database.
D. To define the tables involved in the query.
A. To allow dynamic values to be passed into the query at runtime.
Why are curly brackets used for Entities and square brackets for Attributes in SQL Queries within OutSystems?
A. To differentiate between Entities and Attributes.
B. To ensure compatibility with different database systems.
C. To prevent conflicts with reserved keywords in SQL.
D. To facilitate syntax highlighting in the SQL editor.
A. To differentiate between Entities and Attributes.
What is the purpose of the “LIMIT” keyword in other databases?
A. To specify the maximum number of rows to be retrieved.
B. To order the retrieved data.
C. To filter the retrieved data based on certain criteria.
D. To group the retrieved data.
A. To specify the maximum number of rows to be retrieved.
What is the purpose of the “TOP” keyword in SQL Server?
A. To specify the maximum number of rows to be retrieved.
B. To order the retrieved data.
C. To filter the retrieved data based on certain criteria.
D. To group the retrieved data.
A. To specify the maximum number of rows to be retrieved.
What is the purpose of the “Test Inputs” tab in the SQL Tool?
A. To define the values of input parameters for testing the query.
B. To view the results of a previous query execution.
C. To define the data types of the input parameters.
D. To edit the SQL query itself.
A. To define the values of input parameters for testing the query.
What is the role of the “Output Entities/Structures” section in the SQL Tool?
A. To define the data structure of the query’s output.
B. To specify the order in which data is retrieved from the database.
C. To define the tables involved in the query.
D. To define the input parameters for the query.
A. To define the data structure of the query’s output.
What is a “non-select query” in SQL?
A. A query that performs actions on the data, such as inserting, updating, or deleting records.
B. A query that retrieves data from multiple tables.
C. A query that retrieves a specific subset of data.
D. A query that uses aggregate functions like COUNT or AVG.
A. A query that performs actions on the data, such as inserting, updating, or deleting records.
What is the primary benefit of using an Aggregate instead of a SQL Query when retrieving data?
A. Aggregates are generally easier to use and maintain than SQL Queries.
B. Aggregates provide a more efficient way to retrieve data.
C. Aggregates automatically handle joins between entities.
D. Aggregates are required for performing complex data transformations.
A. Aggregates are generally easier to use and maintain than SQL Queries.
When is it recommended to use an SQL Query instead of an Aggregate?
A. When retrieving a small number of records.
B. When performing complex queries involving sub-queries or joins that cannot be easily defined in an Aggregate.
C. When retrieving data from multiple tables.
D. When using aggregate functions like COUNT or AVG.
B. When performing complex queries involving sub-queries or joins that cannot be easily defined in an Aggregate.
What is the first step involved in converting an existing Aggregate to an SQL Query?
A. Copy the Aggregate and paste it into a Data Action.
B. Create a new Data Action and drag the Aggregate into it.
C. Delete the existing Aggregate and drag an SQL into the Data Action.
D. Open the Aggregate and click the “Convert to SQL” button.
C. Delete the existing Aggregate and drag an SQL into the Data Action.
After converting an Aggregate to an SQL Query, what changes are typically required?
A. Update the input and output parameters of the SQL Query.
B. Re-wire the user interface to use the SQL Query instead of the Aggregate.
C. Change the data type of the output structure to match the SQL Query’s output.
D. All of the above.
D. All of the above.
What is the purpose of a “DELETE” SQL Query?
A. To retrieve data from a database.
B. To update existing data in a database.
C. To remove data from a database.
D. To create new data in a database.
C. To remove data from a database.
What is the purpose of an “INSERT” SQL Query?
A. To retrieve data from a database.
B. To modify existing data in a database.
C. To remove data from a database.
D. To add new data into a database.
D. To add new data into a database.