#2 Programando un sistema de ventas real | Diseño de la base de datos

#2 Programando un sistema de ventas real | Diseño de la base de datos

Introduction to the Course on Real Sales System Development

Overview of the Project

  • Héctor de León introduces himself and outlines the purpose of the video series, which focuses on developing a real sales system.
  • The project will involve creating a system that can generate sales, store them in a database, and utilize SQL Server as part of its requirements.

Technologies Involved

  • The application will be built using Angular for the frontend and Chamartín for backend services, with an intermediary service to centralize methods.
  • A third-party SMTP server will be used for email functionalities within the application.

Database Design Process

Importance of Database

  • The database is essential for storing information that can be retrieved later for reporting and consultation purposes.
  • SQL Server will be utilized; users must specify service name, username, and password to connect.

Creating a Database

  • Héctor demonstrates how to create a new database named "venta real" using Microsoft SQL Server Management Studio (SSMS).
  • He emphasizes downloading free versions of SQL Server for practice.

Structuring Tables in the Database

Initial Table Creation

  • Discussion on creating tables necessary for storing sales data; specifically focusing on 'venta' (sales).
  • Two primary tables are identified: one for sales ('venta') and another for sale items or products ('conceptos') linked to each sale.

Key Considerations in Table Design

  • Importance of choosing appropriate data types such as bigint versus int based on expected data volume.
  • Recommendations include using primary keys effectively while considering future scalability when dealing with large datasets.

Defining Sale Attributes

Essential Fields in Sales Table

  • Key fields discussed include date/time of sale and total amount. Storing total amounts is considered good practice despite being calculable from individual item totals.
  • Total field type is set as decimal with specific character limits to ensure accuracy in financial reporting.

Creating Product Concept Table

Structure of Product Table

  • A new table called 'concepto' or product is created with fields like quantity, unit price, and total amount per product sold.
  • Emphasis placed on performance considerations when generating reports from large datasets by pre-calculating totals rather than recalculating during queries.

Linking Products to Sales

Establishing Relationships Between Tables

  • Discussion about linking product details directly into sales transactions through foreign keys ensuring relational integrity between tables.

Visualizing Database Structure

Using Diagrams for Clarity

  • Héctor shows how to create visual diagrams within SSMS to represent relationships between different tables clearly.

(t=955] Adding Customer Information

Incorporating Customer Data

  • A new table named 'cliente' (customer ) is introduced , allowing tracking of customer information related to each sale .

Conclusion

Next Steps

  • Héctor concludes by stating that further videos will build upon this foundational work , adding more components and features over time .
Video description

#programación #hdeleon #curso En este video crearemos la base de datos que utilizaremos en nuestro sistema, más adelante iremos incrementando su tamaño con nuevos elementos. Si quieres apoyarme y darme para una cerveza puedes hacerlo por aquí: http://paypal.me/HectorDeLeonGuevara Puedes apoyarme desde 0.5 USD al mes uniéndote como miembro al canal aquí: https://www.youtube.com/channel/UCDUdeFslCNoM29MAlZOfdWQ/join También puedes vía patreon: https://www.patreon.com/powerhdeleon Todos los videos de este curso: https://www.youtube.com/watch?v=b5iZ2cJyIi0&list=PLWYKfSbdsjJghGaiXPs3fbuZWk2EDdNZf Todos mis podcasts: https://www.youtube.com/watch?v=TPFrrcOsrbc&list=PLWYKfSbdsjJj9VHAK5tkWJWS-NWM2EeC4 Curso de MVC .Net: https://www.youtube.com/watch?v=UZNoQMio4XM&list=PLWYKfSbdsjJhzIXJW7FUZUEivr3HGKQZG Curso de MVC Api .Net: https://www.youtube.com/watch?v=H09-3kUb3NY&list=PLWYKfSbdsjJg1_t72NSy5hPetthqhacLh Curso de facturación electrónica en c# .Net: https://www.youtube.com/watch?v=XlTz0NRQLm4&list=PLWYKfSbdsjJg-yuu9K53GwthkEE8lkXDL Todos mis videos sobre facturación electrónica: https://www.youtube.com/watch?v=XlTz0NRQLm4&list=PLWYKfSbdsjJiQwcGNZmICkes0iJHN_7XJ La falta de respeto tanto a mí como a cualquier otra persona y el SPAM son razones de bloqueo en mi canal. "Copyright Disclaimer Under Section 107 of the Copyright Act 1976, allowance is made for "fair use" for purposes such as criticism, comment, news reporting, teaching, scholarship, and research. Fair use is a use permitted by copyright statute that might otherwise be infringing. Non-profit, educational or personal use tips the balance in favor of fair use" --------------------------------------------------------------------------------------------------------------- Sigueme en twitter ⇒ https://twitter.com/powerhdeleon Sigueme en facebook ⇒ https://www.facebook.com/hdeleon666 Mi Sitio web ⇒ http://hdeleon.net