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.

Unit 6 MCQs SQL Server and ASP.NET Core Web API

CSE253 — .Net Programming 60 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 Introduction to SQL Server Easy

    What is SQL Server primarily used for?

  2. Question 2 of 60 SQL Commands Easy

    Which SQL command is used to retrieve data from a table?

  3. Question 3 of 60 SQL Commands Easy

    Which SQL command adds a new row to a table?

  4. Question 4 of 60 SQL Server Tables Easy

    What does a row in a SQL Server table usually represent?

  5. Question 5 of 60 SQL Server Tables Easy

    What does a column in a table represent?

  6. Question 6 of 60 Constraints Easy

    Which constraint uniquely identifies each row in a table?

  7. Question 7 of 60 Constraints Easy

    Which constraint prevents a column from containing NULL values?

  8. Question 8 of 60 Joins Easy

    What is the purpose of a SQL join?

  9. Question 9 of 60 Joins Easy

    Which join returns matching rows from both tables?

  10. Question 10 of 60 Introduction to REST Architecture Easy

    What does REST commonly describe?

  11. Question 11 of 60 Introduction to REST Architecture Easy

    In REST, resources are commonly identified using what?

  12. Question 12 of 60 HTTP Protocol and HTTP Methods Easy

    Which HTTP method is commonly used to retrieve data?

  13. Question 13 of 60 HTTP Protocol and HTTP Methods Easy

    Which HTTP method is commonly used to create a new resource?

  14. Question 14 of 60 HTTP Status Codes Easy

    What does HTTP status code 200 OK indicate?

  15. Question 15 of 60 HTTP Status Codes Easy

    What does HTTP status code 404 Not Found mean?

  16. Question 16 of 60 Introduction to ASP.NET Core Web API Easy

    What is ASP.NET Core Web API used to build?

  17. Question 17 of 60 API Controllers Easy

    What is the main role of an API controller?

  18. Question 18 of 60 Routing using Convention and Attribute Routing Easy

    What does routing determine in a Web API?

  19. Question 19 of 60 Data Transfer Objects (DTOs) Easy

    What is the main purpose of a DTO?

  20. Question 20 of 60 CRUD Operations using Web API Easy

    What does the letter D represent in CRUD?

  21. 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?

  22. Question 22 of 60 SQL Commands Medium

    Which SQL statement correctly increases the salary by 10% for employees in department 3?

  23. 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?

  24. 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?

  25. Question 25 of 60 Constraints Medium

    The Orders.CustomerId column references Customers.CustomerId. What is the main purpose of this foreign key constraint?

  26. 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?

  27. 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?

  28. Question 28 of 60 Introduction to REST Architecture Medium

    Which design best follows REST principles for retrieving a product with identifier 42?

  29. Question 29 of 60 Introduction to REST Architecture Medium

    A REST API is described as stateless. What does this mean for requests?

  30. 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?

  31. 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?

  32. 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?

  33. 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?

  34. 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?

  35. 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?

  36. 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?

  37. 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?

  38. 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?

  39. 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?

  40. Question 40 of 60 Swagger/OpenAPI Documentation Medium

    What is a practical benefit of adding Swagger/OpenAPI to an ASP.NET Core Web API?

  41. 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?

  42. 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?

  43. 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?

  44. Question 44 of 60 Constraints Hard

    A nullable column has a UNIQUE constraint in SQL Server. Which behavior should an application generally account for?

  45. 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?

  46. 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?

  47. 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?

  48. 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?

  49. 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?

  50. 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?

  51. 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?

  52. 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?

  53. 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?

  54. 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?

  55. 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?

  56. 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?

  57. 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?

  58. 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?

  59. 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?

  60. 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?

That's unit 6

Answer a few questions and your score shows up here.