В базе данных AdvantShop.NET - порядка 80 таблицы и более 270 хранимых процедур, все они служат для гибкого функционирования магазина на платформе ASP.NET

Таблицы сгруппированы в схемы по их назначению. Примеры схем: [Catalog], [Customers], [Order], [Settings], [CMS] ...

Перечень таблиц

[Catalog].[CustomOptions] [Customers].[RecentlyViewsData] [Order].[PaymentDetails]
[Catalog].[TaxMappingOnProduct] [Customers].[Country_en] [Order].[PaymentMethod]
[Catalog].[Tax] [Customers].[Customer] [Order].[OrderStatus]
[Catalog].[Currency] [Customers].[Region] [Order].[OrderPriceDiscount]
[Catalog].[OptionPriceTypes] [Customers].[ClientInfo] [SEO].[RoutingParams]
[Catalog].[OnlineClientInfo] [Customers].[Country_ru] [SEO].[Settings]
[Catalog].[ImportLog] [Customers].[Country] [SEO].[MetaInfo]
[Catalog].[RelatedProducts] [Customers].[Contact] [SEO].[CategoryLinks]
[Catalog].[MainPageProduct] [Customers].[GeoIP] [SEO].[Link]
[Catalog].[OffersList] [Customers].[CustomerGroup] [Settings].[Language]
[Catalog].[FakeBestSellers] [dbo].[MessageLog] [Settings].[MailFormat]
[Catalog].[Offer] [dbo].[Subscribe] [Settings].[AuthorizeLog]
[Catalog].[Options] [dbo].[BreakMessage] [Settings].[ExportFeedHistory]
[Catalog].[ProductDiscussion] [dbo].[ASPStateTempSessions] [Settings].[ExportFeedCategories]
[Catalog].[ProductFile] [dbo].[ASPStateTempApplications] [Settings].[InternalSettings]
[Catalog].[ProductPhoto] [dbo].[SubscribeDeactivateReason] [Settings].[ExportFeedProducts]
[Catalog].[TaxSelectedCategories] [Internal].[SessionRestartLog] [Settings].[Redirect]
[Catalog].[Product] [Order].[PaymentParam] [Settings].[NewsCategory]
[Catalog].[ProductCategories] [Order].[OrderCustomer] [Settings].[ProfitPlan]
[Catalog].[Property] [Order].[ShippingMethod] [Settings].[Ranges]
[Catalog].[PropertyValue] [Order].[TempOrder] [Settings].[MailFormatType]
[Catalog].[Ratio] [Order].[ShippingParam] [Settings].[SocialWidgets]
[Catalog].[Category] [Order].[OrderCustomOptions] [Settings].[News]
[Catalog].[TaxRegionRate] [Order].[OrderedCart] [Settings].[Settings]
[Catalog].[ProductPropertyValue] [Order].[OrderCurrency] [Voice].[VoiceTheme]
[CMS].[MainMenu] [Order].[Order] [Voice].[Answer]
[CMS].[StaticBlock] [Order].[OrderContact]  
[CMS].[StaticPage] [Order].[OrderPaymentShipping]  
[CMS].[BottomMenu] [Order].[OrderTax]  

Примеры SQL запросов

Создание таблицы [ProductPhoto]

CREATE TABLE [ProductPhoto]( [ProductPhotoID] [int] IDENTITY(1,1) NOT NULL, [ProductID] [nvarchar](50) COLLATE Cyrillic_General_CI_AS NOT NULL, [Path] [nvarchar](255) COLLATE Cyrillic_General_CI_AS NOT NULL, [ModifiedDate] [datetime] NOT NULL, [Description] [nvarchar](255) COLLATE Cyrillic_General_CI_AS NULL, [PhotoSortOrder] [int] NULL, [Main] [bit] NOT NULL, CONSTRAINT [PK_ProductPhoto] PRIMARY KEY CLUSTERED ( [ProductPhotoID] ASC )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY] ) ON [PRIMARY] 

Создание хранимой процедуры [sp_AddOption]

CREATE PROCEDURE [sp_AddOption]  @CustomOptionsId int, @Title nvarchar(255), @PriceBC money, @PriceType int, @SortOrder int AS BEGIN  INSERT INTO [Catalog].[Options] ([CustomOptionsId], [Title], [PriceBC], [PriceType], [SortOrder]) VALUES (@CustomOptionsId, @Title, @PriceBC, @PriceType, @SortOrder) END

Создание представления [view_GetCurrency]

CREATE VIEW [Catalog].[view_GetCurrency] AS SELECT TOP (100) PERCENT [CurrencyIso3], [Name] FROM Catalog.Currency ORDER BY Name GO EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]' Begin DesignProperties = Begin PaneConfigurations = Begin PaneConfiguration = 0 NumPanes = 4 Configuration = "(H (1[40] 4[20] 2[20] 3) )" End Begin PaneConfiguration = 1 NumPanes = 3 Configuration = "(H (1 [50] 4 [25] 3))" End ...