Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.
Question 1 of 60 · Introduction to SQL Server · Easy
What is SQL Server primarily used for?
Not quite. Try another option.
Answer: Managing and storing relational data
SQL Server is a relational database management system used to store, organize, and retrieve data.
Question 2 of 60 · SQL Commands · Easy
Which SQL command is used to retrieve data from a table?
Not quite. Try another option.
Answer: SELECT
The SELECT command retrieves data from one or more database tables.
Question 3 of 60 · SQL Commands · Easy
Which SQL command adds a new row to a table?
Not quite. Try another option.
Answer: INSERT
The INSERT command is used to add new records to a table.
Question 4 of 60 · SQL Server Tables · Easy
What does a row in a SQL Server table usually represent?
Not quite. Try another option.
Answer: A complete record
Each row, also called a record, contains the values for one item or entity.
Question 5 of 60 · SQL Server Tables · Easy
What does a column in a table represent?
Not quite. Try another option.
Answer: A type of data or field
A column defines a specific field or attribute, such as a name, date, or price.
Question 6 of 60 · Constraints · Easy
Which constraint uniquely identifies each row in a table?
Not quite. Try another option.
Answer: Primary key
A primary key contains unique values that identify table records.
Question 7 of 60 · Constraints · Easy
Which constraint prevents a column from containing NULL values?
Not quite. Try another option.
Answer: NOT NULL
The NOT NULL constraint requires a column to have a value.
Question 8 of 60 · Joins · Easy
What is the purpose of a SQL join?
Not quite. Try another option.
Answer: To combine related data
A join combines rows from two or more tables using related columns.
Question 9 of 60 · Joins · Easy
Which join returns matching rows from both tables?
Not quite. Try another option.
Answer: INNER JOIN
An INNER JOIN returns only the rows that have matching values in both tables.
Question 10 of 60 · Introduction to REST Architecture · Easy
What does REST commonly describe?
Not quite. Try another option.
Answer: An architectural style for web services
REST is an architectural style for designing networked applications and web services.
Question 11 of 60 · Introduction to REST Architecture · Easy
In REST, resources are commonly identified using what?
Not quite. Try another option.
Answer: URLs
REST resources are identified by URLs, also known as resource endpoints.
Question 12 of 60 · HTTP Protocol and HTTP Methods · Easy
Which HTTP method is commonly used to retrieve data?
Not quite. Try another option.
Answer: GET
The GET method requests or retrieves a resource from a server.
Question 13 of 60 · HTTP Protocol and HTTP Methods · Easy
Which HTTP method is commonly used to create a new resource?
Not quite. Try another option.
Answer: POST
The POST method is commonly used to submit data and create a new resource.
Question 14 of 60 · HTTP Status Codes · Easy
What does HTTP status code 200 OK indicate?
Not quite. Try another option.
Answer: The request succeeded
The 200 OK status code indicates that the request was successfully processed.
Question 15 of 60 · HTTP Status Codes · Easy
What does HTTP status code 404 Not Found mean?
Not quite. Try another option.
Answer: The resource was not found
A 404 Not Found response means that the requested resource could not be located.
Question 16 of 60 · Introduction to ASP.NET Core Web API · Easy
What is ASP.NET Core Web API used to build?
Not quite. Try another option.
Answer: Web-based APIs
ASP.NET Core Web API provides a framework for building HTTP-based web APIs.
Question 17 of 60 · API Controllers · Easy
What is the main role of an API controller?
Not quite. Try another option.
Answer: Handle HTTP requests
An API controller receives HTTP requests, processes them, and returns responses.
Question 18 of 60 · Routing using Convention and Attribute Routing · Easy
What does routing determine in a Web API?
Not quite. Try another option.
Answer: Which controller handles a request
Routing matches a request URL and HTTP method to an appropriate controller action.
Question 19 of 60 · Data Transfer Objects (DTOs) · Easy
What is the main purpose of a DTO?
Not quite. Try another option.
Answer: Transfer selected data
A Data Transfer Object carries selected data between application layers or between a client and an API.
Question 20 of 60 · CRUD Operations using Web API · Easy
What does the letter D represent in CRUD?
Not quite. Try another option.
Answer: Delete
CRUD stands for Create, Read, Update, and Delete.
Question 21 of 60 · Introduction to SQL Server · Medium
A developer needs a relational database system that supports transactions, security, stored procedures, and integration with .NET applications. Which SQL Server component is primarily responsible for storing and processing relational data?
Not quite. Try another option.
Answer: Database Engine
The Database Engine stores data and processes SQL queries, transactions, indexes, and other core relational database operations.
Question 22 of 60 · SQL Commands · Medium
Which SQL statement correctly increases the salary by 10% for employees in department 3?
Not quite. Try another option.
Answer: UPDATE Employees SET Salary = Salary * 1.10 WHERE DepartmentId = 3;
UPDATE modifies existing rows, and the WHERE clause limits the change to employees in department 3.
Question 23 of 60 · SQL Server Tables · Medium
A table named Orders must store an automatically generated integer identifier for every order. Which column definition is most appropriate?
Not quite. Try another option.
Answer: OrderId INT IDENTITY(1,1)
IDENTITY(1,1) automatically generates integer values beginning at 1 and incrementing by 1.
Question 24 of 60 · Constraints · Medium
A StudentCourses table should prevent the same student from being enrolled in the same course more than once. Which constraint is most suitable?
Not quite. Try another option.
Answer: A composite UNIQUE constraint on StudentId and CourseId
A composite UNIQUE constraint prevents duplicate combinations of the specified column values.
Question 25 of 60 · Constraints · Medium
The Orders.CustomerId column references Customers.CustomerId. What is the main purpose of this foreign key constraint?
Not quite. Try another option.
Answer: To enforce referential integrity
A foreign key ensures that an order references an existing customer, preventing invalid relationships between tables.
Question 26 of 60 · Joins · Medium
A report must list every department, including departments that currently have no employees. Which join should be used between Departments and Employees?
Not quite. Try another option.
Answer: LEFT JOIN from Departments to Employees
A left join returns all rows from the left table, including departments without matching employee records.
Question 27 of 60 · Joins · Medium
Which query returns customers who have placed at least one order, without requiring customers with no orders to appear?
Not quite. Try another option.
Answer: SELECT c.Name FROM Customers c INNER JOIN Orders o ON c.Id = o.CustomerId;
An inner join returns only rows where the customer and order records have matching identifiers.
Question 28 of 60 · Introduction to REST Architecture · Medium
Which design best follows REST principles for retrieving a product with identifier 42?
Not quite. Try another option.
Answer: Send GET /api/products/42
REST commonly represents products as resources and uses the GET method to retrieve a specific resource by its URI.
Question 29 of 60 · Introduction to REST Architecture · Medium
A REST API is described as stateless. What does this mean for requests?
Not quite. Try another option.
Answer: Each request contains the information needed to process it
In a stateless architecture, the server does not depend on stored client session state to understand the current request.
Question 30 of 60 · HTTP Protocol and HTTP Methods · Medium
A client sends PUT /api/products/7 with a complete replacement representation of product 7. Which behavior is normally associated with PUT?
Not quite. Try another option.
Answer: Replace or create the resource at the specified URI
PUT is generally used for complete replacement of a resource and is idempotent when repeated with the same representation.
Question 31 of 60 · HTTP Protocol and HTTP Methods · Medium
Which HTTP method is most appropriate for partially updating only the email address of an existing user?
Not quite. Try another option.
Answer: PATCH
PATCH is designed for partial modifications, while PUT typically represents a complete replacement.
Question 32 of 60 · HTTP Status Codes · Medium
An API successfully creates a new customer and returns the URI of the created resource in the response headers. Which status code is most appropriate?
Not quite. Try another option.
Answer: 201 Created
201 Created indicates that a new resource was successfully created and may include its location in the Location header.
Question 33 of 60 · HTTP Status Codes · Medium
A client sends valid JSON to an endpoint, but the requested product identifier does not exist. Which response status is most appropriate?
Not quite. Try another option.
Answer: 404 Not Found
404 Not Found indicates that the requested resource could not be located, even though the request format was valid.
Question 34 of 60 · Introduction to ASP.NET Core Web API · Medium
Which ASP.NET Core service is commonly registered to allow controllers to handle HTTP API requests?
Not quite. Try another option.
Answer: AddControllers()
AddControllers() registers services required for controller-based APIs, including model binding and formatting support.
Question 35 of 60 · Building and Configuring Web APIs · Medium
In a typical ASP.NET Core Web API application, why is app.MapControllers() required when attribute-routed controllers are used?
Not quite. Try another option.
Answer: It maps controller endpoints into the request pipeline
MapControllers() exposes endpoints defined by controller route attributes so incoming requests can reach the correct actions.
Question 36 of 60 · API Controllers · Medium
What is the main benefit of deriving an ASP.NET Core API controller from ControllerBase instead of Controller?
Not quite. Try another option.
Answer: It provides API-focused features without view support
ControllerBase includes API features such as Ok() and NotFound() without including MVC view-rendering functionality.
Question 37 of 60 · Routing using Convention and Attribute Routing · Medium
Given the route template [Route("api/[controller]")] and an action marked [HttpGet("{id:int}")] in ProductsController, which URL matches the action?
Not quite. Try another option.
Answer: GET /api/Products/12
[controller] becomes Products, and the action route requires an integer value in the path.
Question 38 of 60 · Data Transfer Objects (DTOs) · Medium
A User entity contains PasswordHash, but the API should return only Id, Name, and Email. What is the best approach?
Not quite. Try another option.
Answer: Return a response DTO containing only safe fields
A response DTO controls the public shape of the API and prevents sensitive entity properties from being exposed.
Question 39 of 60 · CRUD Operations using Web API · Medium
An API receives a POST request with a valid ProductCreateDto, saves the product, and must return the created resource. Which response is most suitable?
Not quite. Try another option.
Answer: CreatedAtAction with the created product
CreatedAtAction communicates successful creation, returns the representation, and can provide a URI for retrieving the new resource.
Question 40 of 60 · Swagger/OpenAPI Documentation · Medium
What is a practical benefit of adding Swagger/OpenAPI to an ASP.NET Core Web API?
Not quite. Try another option.
Answer: It documents endpoints and enables interactive testing
Swagger/OpenAPI describes routes, parameters, request bodies, and responses, while Swagger UI lets developers try the endpoints interactively.
Question 41 of 60 · Introduction to SQL Server · Hard
A transaction updates rows in a SQL Server database and then fails before committing. Which behavior best describes the effect of a correctly handled rollback?
Not quite. Try another option.
Answer: All changes in the transaction are undone
A rollback reverses all changes made by the current uncommitted transaction, including changes from statements that completed successfully.
Question 42 of 60 · SQL Commands · Hard
A developer executes DELETE FROM Orders without a WHERE clause inside an explicit transaction. Which statement is most accurate?
Not quite. Try another option.
Answer: The command marks every row for deletion until commit
DELETE without a WHERE predicate targets every row. Within an explicit transaction, the deletion can still be rolled back before the transaction is committed.
Question 43 of 60 · SQL Server Tables · Hard
A table stores CustomerId, ProductId, Quantity, and UnitPrice for each order line. Which design best prevents duplicate product entries for the same order while preserving separate lines for different products?
Not quite. Try another option.
Answer: A composite primary key on CustomerId and ProductId
A composite key enforces uniqueness for each customer-product pair. Different products can still have separate rows, while repeated entries for the same pair are rejected.
Question 44 of 60 · Constraints · Hard
A nullable column has a UNIQUE constraint in SQL Server. Which behavior should an application generally account for?
Not quite. Try another option.
Answer: Only one null value is generally permitted
In SQL Server, a standard unique constraint or unique index generally allows only one NULL value for a nullable column. Multiple missing values usually require a filtered unique index if that behavior is desired.
Question 45 of 60 · Joins · Hard
A query must return every department, including departments with no employees, and employee information when available. Which join is required when departments are placed on the left side?
Not quite. Try another option.
Answer: A left outer join from departments to employees
A left outer join preserves every row from the left table and supplies NULL values for unmatched employee columns.
Question 46 of 60 · Joins · Hard
A query joins Orders to OrderItems and then calculates total order value. The result is grouped only by order ID. What issue is most likely if the join condition is incomplete?
Not quite. Try another option.
Answer: The join can multiply rows and inflate aggregates
An incomplete join predicate can produce many-to-many matches. Each duplicated match contributes to aggregate calculations, causing totals such as order value to be overstated.
Question 47 of 60 · Introduction to REST Architecture · Hard
An endpoint creates a resource only when the client supplies a chosen identifier, and repeating the same request produces the same final resource state. Which REST property is primarily demonstrated?
Not quite. Try another option.
Answer: Idempotent request semantics
An idempotent operation can be repeated without producing additional changes after the first successful application. PUT is commonly used for this replacement-style behavior.
Question 48 of 60 · Introduction to REST Architecture · Hard
A REST API returns a representation containing links to retrieve related resources and perform valid next actions. Which constraint does this most directly support?
Not quite. Try another option.
Answer: Uniform interface through hypermedia controls
Hypermedia links allow clients to discover available transitions from the current representation, supporting the REST constraint commonly called HATEOAS.
Question 49 of 60 · HTTP Protocol and HTTP Methods · Hard
A client sends PUT /api/products/42 with a complete representation, but product 42 does not exist. Which response is most appropriate when the API creates the resource at that URI?
Not quite. Try another option.
Answer: 201 Created with the resource location
When PUT creates a previously nonexistent resource at the requested URI, 201 Created is appropriate. A Location header may identify the created resource.
Question 50 of 60 · HTTP Protocol and HTTP Methods · Hard
A client sends a conditional GET with If-None-Match, and the server's current ETag matches the supplied value. What should the server normally return?
Not quite. Try another option.
Answer: 304 Not Modified without the representation body
A matching ETag means the cached representation remains current. The server can return 304 Not Modified, allowing the client to reuse its cached body.
Question 51 of 60 · HTTP Status Codes · Hard
A request is syntactically valid and authenticated, but the authenticated user is not allowed to access the requested resource. Which status code best communicates this result?
Not quite. Try another option.
Answer: 403 Forbidden
403 Forbidden indicates that the server understood the request but refuses to authorize the operation. 401 is intended for missing or invalid authentication credentials.
Question 52 of 60 · HTTP Status Codes · Hard
A POST request fails because a submitted email violates a database uniqueness constraint. Which response most accurately represents the application-level conflict?
Not quite. Try another option.
Answer: 409 Conflict
409 Conflict is suitable when the request cannot be completed because it conflicts with the current state of the resource, such as a duplicate unique value.
Question 53 of 60 · Introduction to ASP.NET Core Web API · Hard
An ASP.NET Core API action returns ActionResult<Product> and uses return NotFound(); for a missing product and return product; for a successful lookup. What does this return type enable?
Not quite. Try another option.
Answer: Typed success results plus other HTTP results
ActionResult<T> supports a typed response when the operation succeeds while also allowing results such as NotFound, BadRequest, or Unauthorized.
Question 54 of 60 · Building and Configuring Web APIs · Hard
An ASP.NET Core API registers AddControllers() but omits MapControllers() in a minimal hosting configuration. What is the likely result for attribute-routed controllers?
Not quite. Try another option.
Answer: Controller services exist, but their routes are not exposed
AddControllers() registers MVC services. MapControllers() adds controller action endpoints to the request pipeline; without it, attribute-routed actions are not reachable.
Question 55 of 60 · API Controllers · Hard
A controller action accepts a complex object from the request body and also declares a route parameter with the same property name. What is the safest design to avoid ambiguous binding behavior?
Not quite. Try another option.
Answer: Use separate names and explicit binding sources
HTTP requests have distinct binding sources. Explicitly separating route values from body data avoids ambiguous ownership and makes validation and action behavior predictable.
Question 56 of 60 · Routing using Convention and Attribute Routing · Hard
A controller contains [HttpGet("{id:int}")] and [HttpGet("{name}")] actions. A request arrives at /api/items/12. What is the main purpose of the int constraint?
Not quite. Try another option.
Answer: It restricts the first route to integer-shaped values
The inline int constraint makes the first route a candidate only when the segment can satisfy the integer constraint, helping disambiguate it from the name route.
Question 57 of 60 · Data Transfer Objects (DTOs) · Hard
A User entity contains PasswordHash, IsAdmin, and internal audit fields. Why should a response DTO generally be used instead of returning the entity directly?
Not quite. Try another option.
Answer: DTOs limit exposed data and decouple the API contract
DTOs prevent sensitive or internal properties from being exposed and allow the API representation to evolve independently of the persistence model.
Question 58 of 60 · CRUD Operations using Web API · Hard
An API receives a PUT request for an existing product, but the payload omits a required property. The server treats PUT as full replacement. What should normally happen?
Not quite. Try another option.
Answer: The omitted property is set according to replacement rules
PUT conventionally represents a complete replacement. Missing required fields should be rejected by validation or handled according to an explicitly documented replacement policy, rather than silently treated as a partial update.
Question 59 of 60 · CRUD Operations using Web API · Hard
A DELETE operation succeeds, removes the resource, and has no representation to return. Which response is most appropriate?
Not quite. Try another option.
Answer: 204 No Content with no response body
204 No Content communicates successful processing when the server has no representation to include in the response.
Question 60 of 60 · Swagger/OpenAPI Documentation · Hard
An endpoint returns different schemas for successful and error responses, but Swagger UI displays only the success schema. Which change most directly improves the OpenAPI contract?
Not quite. Try another option.
Answer: Add response metadata for each status code and schema
OpenAPI should describe the possible status codes and their response content. ASP.NET Core response metadata can document successful, validation, not-found, and other outcomes.
That's unit 6
Answer a few questions and your score shows up here.
Nearly through. Did unit 6 of CSE253 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 6 of CSE253 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill;
the rest comes out of a student's own pocket: the domain, the storage, and keeping
the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.