![]() ![]() Most of the configuration options within this file are driven by the values of your application's environment variables. In this file, you may define all of your database connections, as well as specify which connection should be used by default. Now, you should be familiar with the BikeStores sample database and ready to load it into the SQL Server.The configuration for Laravel's database services is located in your application's config/database.php configuration file. ) Code language: SQL (Structured Query Language) ( sql )Ĭlick the following link to download the sample database script: the quantity of a particular product in a specific store. The production.stocks table stores the inventory information i.e. ![]() ) Code language: SQL (Structured Query Language) ( sql ) Table production.stocks REFERENCES production.products (product_id) CREATE TABLE sales.order_items(ĭiscount DECIMAL ( 4, 2) NOT NULL DEFAULT 0, Each line item belongs to a sales order specified by the order_id column.Ī sales order line item includes product, order quantity, list price, and discount. The sales.order_items table stores the line items of a sales order. ) Code language: SQL (Structured Query Language) ( sql ) Table sales.order_items Order status: 1 = Pending 2 = Processing 3 = Rejected 4 = Completed Order_id INT IDENTITY ( 1, 1) PRIMARY KEY, A sales order has one or many line items stored in the sales.order_items table. It also stores the information on where the sales transaction was created (store) and who created it (staff).Įach sales order has a row in the sales_orders table. The sales.orders table stores the sales order’s header information including customer, order status, order date, required date, shipped date. ) Code language: SQL (Structured Query Language) ( sql ) Table sales.orders CREATE TABLE sales.customers (Ĭustomer_id INT IDENTITY ( 1, 1) PRIMARY KEY, The sales.customers table stores customer’s information including first name, last name, phone, email, street, city, state and zip code. ) Code language: SQL (Structured Query Language) ( sql ) Table sales.customers REFERENCES production.categories (category_id) Product_id INT IDENTITY ( 1, 1) PRIMARY KEY, Also, each category may have zero or many products. Hence, a brand may have zero or many products.Įach product also belongs a category specified by the category_id column. The production.products table stores the product’s information such as name, brand, category, model year, and list price.Įach product belongs to a brand specified by the brand_id column. ) Code language: SQL (Structured Query Language) ( sql ) Table production.products CREATE TABLE production.brands (īrand_id INT IDENTITY ( 1, 1) PRIMARY KEY, The production.brands table stores the brand’s information of bikes, for example, Electra, Haro, and Heller. ) Code language: SQL (Structured Query Language) ( sql ) Table production.brands CREATE TABLE production.categories (Ĭategory_id INT IDENTITY ( 1, 1) PRIMARY KEY, The production.categories table stores the bike’s categories such as children bicycles, comfort bicycles, and electric bikes. ) Code language: SQL (Structured Query Language) ( sql ) Table production.categories Staff_id INT IDENTITY ( 1, 1) PRIMARY KEY, If a staff no longer works for any stores, the value in the active column is set to zero. If the value in the manager_id is null, then the staff is the top manager. A store can have one or more staffs.Ī staff reports to a store manager specified by the value in the manager_id column. It also contains the communication information such as email and phone.Ī staff works at a store specified by the value in the store_id column. The sales.staffs table stores the essential information of staffs including first name, last name. ) Code language: SQL (Structured Query Language) ( sql ) Table sales.staffs Store_id INT IDENTITY ( 1, 1) PRIMARY KEY, Each store has a store name, contact information such as phone and email, and an address including street, city, state, and zip code. The sales.stores table includes the store’s information. The following illustrates the BikeStores database diagram:Īs you can see from the diagram, the BikeStores sample database has two schemas sales and production, and these schemas have nine tables. ![]() Summary: in this tutorial, you’ll learn about the SQL Server sample database called BikeStores. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |