幸运抽奖数据结构


/****** Object:  Table [dbo].[Sweepstakes]    Script Date: 12/15/2014 08:50:41 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Sweepstakes](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[title] [nvarchar](200) NOT NULL,
	[detail] [ntext] NOT NULL,
	[startTime] [datetime] NOT NULL,
	[endTime] [datetime] NOT NULL,
	[iHit] [int] NOT NULL,
	[ParticipateTimes] [int] NOT NULL,
	[ModifyTime] [datetime] NOT NULL,
	[bActive] [bit] NOT NULL,
	[keyword] [nvarchar](200) NOT NULL,
	[dayTryTimes] [int] NOT NULL,
	[iTotalTime] [int] NOT NULL,
 CONSTRAINT [PK_Sweepstakes] PRIMARY KEY CLUSTERED
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘活动名称‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘Sweepstakes‘, @level2type=N‘COLUMN‘,@level2name=N‘title‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘活动详细‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘Sweepstakes‘, @level2type=N‘COLUMN‘,@level2name=N‘detail‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘活动开始时间‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘Sweepstakes‘, @level2type=N‘COLUMN‘,@level2name=N‘startTime‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘活动结束时间‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘Sweepstakes‘, @level2type=N‘COLUMN‘,@level2name=N‘endTime‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘点击数‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘Sweepstakes‘, @level2type=N‘COLUMN‘,@level2name=N‘iHit‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘参与人次‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘Sweepstakes‘, @level2type=N‘COLUMN‘,@level2name=N‘ParticipateTimes‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘最后编辑时间‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘Sweepstakes‘, @level2type=N‘COLUMN‘,@level2name=N‘ModifyTime‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘是否启用‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘Sweepstakes‘, @level2type=N‘COLUMN‘,@level2name=N‘bActive‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘抽奖关键字‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘Sweepstakes‘, @level2type=N‘COLUMN‘,@level2name=N‘keyword‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘每人每天可抽奖次数(-1表示无限制)‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘Sweepstakes‘, @level2type=N‘COLUMN‘,@level2name=N‘dayTryTimes‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘每人总共可抽奖次数(-1表示无限制)‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘Sweepstakes‘, @level2type=N‘COLUMN‘,@level2name=N‘iTotalTime‘
GO

ALTER TABLE [dbo].[Sweepstakes] ADD  CONSTRAINT [DF_Sweepstakes_title]  DEFAULT (N‘‘) FOR [title]
GO

ALTER TABLE [dbo].[Sweepstakes] ADD  CONSTRAINT [DF_Sweepstakes_detail]  DEFAULT (N‘‘) FOR [detail]
GO

ALTER TABLE [dbo].[Sweepstakes] ADD  CONSTRAINT [DF_Sweepstakes_bActive]  DEFAULT ((0)) FOR [bActive]
GO

ALTER TABLE [dbo].[Sweepstakes] ADD  CONSTRAINT [DF_Sweepstakes_dayTryTimes]  DEFAULT ((1)) FOR [dayTryTimes]
GO

ALTER TABLE [dbo].[Sweepstakes] ADD  CONSTRAINT [DF_Sweepstakes_iTotalTime]  DEFAULT ((-1)) FOR [iTotalTime]
GO

/****** Object: Table [dbo].[SweepstakesItem] Script Date: 12/15/2014 08:52:21 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[SweepstakesItem](
[id] [int] IDENTITY(1,1) NOT NULL,
[iSweepstakesId] [int] NOT NULL,
[itemName] [nvarchar](50) NOT NULL,
[Prize] [nvarchar](200) NOT NULL,
[PrizePic] [nvarchar](200) NOT NULL,
[Probability] [decimal](18, 9) NOT NULL,
[MaxCount] [int] NOT NULL,
[iOrder] [int] NOT NULL,
CONSTRAINT [PK_SweepstakesItem] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘奖项名称‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘SweepstakesItem‘, @level2type=N‘COLUMN‘,@level2name=N‘itemName‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘奖品‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘SweepstakesItem‘, @level2type=N‘COLUMN‘,@level2name=N‘Prize‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘奖品图片‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘SweepstakesItem‘, @level2type=N‘COLUMN‘,@level2name=N‘PrizePic‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘中奖机率‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘SweepstakesItem‘, @level2type=N‘COLUMN‘,@level2name=N‘Probability‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘奖项最多人数‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘SweepstakesItem‘, @level2type=N‘COLUMN‘,@level2name=N‘MaxCount‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘排序‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘SweepstakesItem‘, @level2type=N‘COLUMN‘,@level2name=N‘iOrder‘
GO

ALTER TABLE [dbo].[SweepstakesItem] ADD CONSTRAINT [DF_SweepstakesItem_itemName] DEFAULT (N‘‘) FOR [itemName]
GO

ALTER TABLE [dbo].[SweepstakesItem] ADD CONSTRAINT [DF_SweepstakesItem_Prize] DEFAULT (N‘‘) FOR [Prize]
GO

ALTER TABLE [dbo].[SweepstakesItem] ADD CONSTRAINT [DF_SweepstakesItem_PrizePic] DEFAULT (N‘‘) FOR [PrizePic]
GO

ALTER TABLE [dbo].[SweepstakesItem] ADD CONSTRAINT [DF_SweepstakesItem_Probability] DEFAULT ((0)) FOR [Probability]
GO

ALTER TABLE [dbo].[SweepstakesItem] ADD CONSTRAINT [DF_SweepstakesItem_MaxCount] DEFAULT ((0)) FOR [MaxCount]
GO

ALTER TABLE [dbo].[SweepstakesItem] ADD CONSTRAINT [DF_SweepstakesItem_iOrder] DEFAULT ((0)) FOR [iOrder]
GO

USE [db_ShopBest]
GO

/****** Object: Table [dbo].[SweepStakesRecord] Script Date: 12/15/2014 08:52:31 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[SweepStakesRecord](
[id] [bigint] IDENTITY(1,1) NOT NULL,
[Man] [nvarchar](100) NOT NULL,
[ManIP] [nvarchar](50) NOT NULL,
[iSweepstakesId] [int] NOT NULL,
[date] [datetime] NOT NULL
) ON [PRIMARY]

GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘参与者‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘SweepStakesRecord‘, @level2type=N‘COLUMN‘,@level2name=N‘Man‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘参与者IP‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘SweepStakesRecord‘, @level2type=N‘COLUMN‘,@level2name=N‘ManIP‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘抽奖活动id‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘SweepStakesRecord‘, @level2type=N‘COLUMN‘,@level2name=N‘iSweepstakesId‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘抽奖日期‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘SweepStakesRecord‘, @level2type=N‘COLUMN‘,@level2name=N‘date‘
GO

ALTER TABLE [dbo].[SweepStakesRecord] ADD CONSTRAINT [DF_SweepStakesRecord_date] DEFAULT (getdate()) FOR [date]
GO

USE [db_ShopBest]
GO

/****** Object: Table [dbo].[SweepstakesWinning] Script Date: 12/15/2014 08:52:39 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[SweepstakesWinning](
[id] [int] IDENTITY(1,1) NOT NULL,
[WinningMan] [nvarchar](50) NOT NULL,
[winningNumber] [nvarchar](200) NOT NULL,
[iSweepstakesId] [int] NOT NULL,
[iItemId] [int] NOT NULL,
[WinningTime] [datetime] NOT NULL,
[bUsed] [bit] NOT NULL,
[bUsedTime] [datetime] NULL,
[bUsedIP] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_SweepstakesWinning] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘中奖者‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘SweepstakesWinning‘, @level2type=N‘COLUMN‘,@level2name=N‘WinningMan‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘中奖密码‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘SweepstakesWinning‘, @level2type=N‘COLUMN‘,@level2name=N‘winningNumber‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘活动id‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘SweepstakesWinning‘, @level2type=N‘COLUMN‘,@level2name=N‘iSweepstakesId‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘奖项id‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘SweepstakesWinning‘, @level2type=N‘COLUMN‘,@level2name=N‘iItemId‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘中奖时间‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘SweepstakesWinning‘, @level2type=N‘COLUMN‘,@level2name=N‘WinningTime‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘密码是否已使用‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘SweepstakesWinning‘, @level2type=N‘COLUMN‘,@level2name=N‘bUsed‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘密码被使用时间‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘SweepstakesWinning‘, @level2type=N‘COLUMN‘,@level2name=N‘bUsedTime‘
GO

EXEC sys.sp_addextendedproperty @name=N‘MS_Description‘, @value=N‘被使用IP‘ , @level0type=N‘SCHEMA‘,@level0name=N‘dbo‘, @level1type=N‘TABLE‘,@level1name=N‘SweepstakesWinning‘, @level2type=N‘COLUMN‘,@level2name=N‘bUsedIP‘
GO

ALTER TABLE [dbo].[SweepstakesWinning] ADD CONSTRAINT [DF_SweepstakesWinning_WinningMan] DEFAULT (N‘‘) FOR [WinningMan]
GO

ALTER TABLE [dbo].[SweepstakesWinning] ADD CONSTRAINT [DF_SweepstakesWinning_bUsedIP] DEFAULT (N‘‘) FOR [bUsedIP]
GO

  

  

时间: 2024-12-24 10:13:18

幸运抽奖数据结构的相关文章

幸运抽奖,分解一个千位数求各位数之和

import java.util.Scanner; /** * @author 蓝色以太 * 幸运抽奖 */ public class LuckyDraw { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("请输入4位会员卡号:"); int num=sc.nextInt(); int ge=num%10; int shi=num%100/10

java-第四章-实现幸运抽奖功能

import java.util.Scanner; public class A01 { /**  * @param args  */ public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("我行我素购物管理系统>幸运抽奖"); Scanner input = new Scanner (System.in); System.out.println

12.幸运抽奖

import java.util.Scanner; /* * 幸运抽奖:会员号的百位数与系统随机数相同,即为中奖 * */ public class GoodLuck { public static void main(String[] args) { //随机产生一个0-9之间的任意整数 int random=(int)(Math.random()*10); // System.out.println(random); //从控制台接收一个任意的四位数 System.out.println("

第十章 幸运抽奖

一.课程内容回顾 1 控制台程序开发 2 变量与运算符 3 数据类型与数组 4 流程控制语句 二.任务 为某商场开发一套幸运抽奖系统,客户首先注册成为商场会员,会员登录系统,参加抽奖活动 三.主要功能 注册 登录 幸运抽奖 四.综合练习:幸运抽奖 阶段1:实现菜单的输出显示 需求: 输出菜单 选择菜单编号,输出菜单信息 如果编号选择错误,输出"您的输入有误!" 实现 public class LuckyNumber1 { /** * 幸运抽奖-实现基本逻辑的输出显示 */ public

幸运抽奖

package cn.com.bdqn.keke; import java.util.*; public class Test12 { public static void main(String[]args){ int i; int j; boolean a=false; String name1 = ""; String name2 = ""; String jiXu="y"; int miMa1 = 0; int miMa2 = 0; in

Java 幸运抽奖项目

package com.ob.anjou; import java.util.Scanner; public class project_five { public static void main(String[] args) { int i; int x = 0,y=0,id=0; //x为注册的用户名 y为注册的密码 id为随机生成的会员卡号 char cha; boolean yn=false; //yn 为注册标识 boolean ok=false; //ok用于判断登录的账号密码是否

幸运抽奖Dp

题目:http://acm.hfut.edu.cn/OnlineJudge/ 赛后听人说用背包搞一下,然后就搞了一下,wa到不能忍啊.注意下范围. ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 #include <cstdio> #include <cstdlib> #include <cstrin

Android之实现“抽奖大轮盘”

这个实例能够帮助我们学习旋转动画和计时器这两个知识点,废话不多说,上主程序: package com.bear.lotterywheel; import java.util.Timer; import java.util.TimerTask; import android.app.Activity; import android.os.Bundle; import android.os.Handler; import android.view.Menu; import android.view.

小型抽奖系统的一个总结

package com.Test; import java.util.Arrays; import java.util.Scanner; public class Test2 { /** 主要功能 注册 登录 幸运抽奖 需求说明 输出菜单 选择菜单编号,输出菜单信息 如果编号选择错误,输出“您的输入有误!” 需求说明 系统询问用户是否继续 如果用户选择继续,则可以继续选择菜单,否则程序结束,退出系统 需求说明 输入用户名和密码,系统产生4位随机数作为卡号. 注册成功,显示注册信息并修改注册标识为