daily pastebin goal


a guest Aug 12th, 2017 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Create table Bills
  2. (
  3.   BillNo INT NOT NULL,
  4.   MeterNo INT NOT NULL,
  5.   FirstDate datetime NOT NULL,
  6.   FirstDateReading INT NOT NULL,
  7.   CurrentDate as MAX(FirstDate) CurrentDateReadng INT NOT NULL,
  8.   LastDate as DATEADD(m,-1,CurrentDate) LastDateReading INT NOT NULL,
  9.   Usageinm3 as (CurrentDateReadng-LastDateReading),
  10.   Usageinlitres as (Usageinm3 * 1000), TotalBill as (UsageinLitres * 3) Primary Key (BillNo),
  11.   Foreign Key (MeterNo) References MeterReading(MeterNo)
  12. );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand