Suggestions
- Create your database. A basic point of sale database can be named anything. The database name is used to connect from your application, so it is a requirement for desktop and web software connections. The following code creates your database:create database point_of_sale
- Create your tables. The tables hold all the information for your customers. Each table is a "module" of the point of sale database. For instance, a customer table is the "module" that holds all the customer information. The following code shows you how to create a table for your database:
CREATE TABLE customer
(customer_id int,
LastName varchar(30),
FirstName varchar(30),)
Each row in the parenthesis is a column for your table. Repeat this SQL command for each of your sales tables. - Generate some data for your tables. When testing your point of sale database, some test data is created to use for testing. This allows you to set up a testing environment, which is an integral part of software development. The following SQL command inserts some data into the customer table created in step two:
- insert into customer (customer_id, FirstName, LastName) values (1, 'James', 'Doe')
- Test your new database. Testing the database ensures that there will be no SQL code errors before connecting it to your website or desktop application. The "select" statement retrieves data from a table, and it is used often in your point of sale database to send data to users or run reports. The following code tests the data:
- select * from customer
- This statement retrieves data from the customer table. You can also replace "customer" with the names of your other tables to test data.
______________________
No comments:
Post a Comment