Sunday, February 15, 2009








SELECT DISTINCT it.name as Item, I.name as Ingredient
FROM madewith as mw, ingredients as i, items as it
WHERE (mw.itemid = it.itemid)
AND (mw.ingredientid = i.ingredientid)
AND ((quantity*3) > inventory)

Monday, February 2, 2009

THEODBS







CODE




Dim u1, u2, u3, u, qx, cbol As String
Public Sub DG2cr()
DataGrid2.Caption = DataCombo1.BoundText + "'s Ingredients"
End Sub
Public Sub tstb()
u1 = "UPDATE ingredients AS i INNER JOIN madewith AS mw ON i.ingredientid=mw.ingredientid SET i.inventory = i.inventory"
u2 = "mw.quantity WHERE mw.itemid='"
u3 = "';"

Select Case DataCombo1.BoundText
Case "Chicken Salad"
txta.Text = u1 + u + u2 + "CHKSD" + u3
tstdz
Case "Fruit Salad"
txta.Text = u1 + u + u2 + "FRTSD" + u3
tstdz
Case "Fruit Plate"
txta.Text = u1 + u + u2 + "FRPT" + u3
tstdz
Case "Fruit Latte"
txta.Text = u1 + u + u2 + "FRTLT" + u3
tstdz
Case "Fruit Juice"
txta.Text = u1 + u + u2 + "FRTJC" + u3
tstdz
Case "Vegan Eatin'"
txta.Text = u1 + u + u2 + "VGNET" + u3
tstdz
Case "Veggie Latte"
txta.Text = u1 + u + u2 + "VEGLT" + u3
tstdz
Case "Veggie Juice"
txta.Text = u1 + u + u2 + "VEGJC" + u3
tstdz
Case "Millennium Salad"
txta.Text = u1 + u + u2 + "MILSD" + u3
tstdz
Case "Garden Salad"
txta.Text = u1 + u + u2 + "GDNSD" + u3
tstdz
Case "Chicken N Spuds"
txta.Text = u1 + u + u2 + "CKSDS" + u3
tstdz
Case "Orange Juice"
txta.Text = u1 + u + u2 + "ORNGJ" + u3
tstdz
Case "Pizza"
txta.Text = u1 + u + u2 + "PIZZA" + u3
tstdz
Case "Soda"
txta.Text = u1 + u + u2 + "SODA" + u3
tstdz
Case "Water"
txta.Text = u1 + u + u2 + "WATER" + u3
tstdz
End Select
End Sub

Public Sub tstdz()
dz
txta.Text = "select name,inventory,unit from ingredients"dz
End Sub

Public Sub tst()
csa = "select name,quantity,unit from madewith as mw,ingredients as i where (mw.ingredientid=i.ingredientid)and(itemid = '"csb = "')"

Select Case DataCombo1.BoundText

Case "Chicken Salad"
txtc.Text = csa + "CHKSD" + csb
DG2cr
Case "Fruit Salad"
txtc.Text = csa + "FRTSD" + csb
DG2cr
Case "Fruit Plate"
txtc.Text = csa + "FRPT" + csb
DG2cr
Case "Fruit Latte"
txtc.Text = csa + "FRTLT" + csb
DG2cr
Case "Fruit Juice"
txtc.Text = csa + "FRTJC" + csb
DG2cr
Case "Vegan Eatin'"
txtc.Text = csa + "VGNET" + csb
DG2cr
Case "Veggie Latte"
txtc.Text = csa + "VEGLT" + csb
DG2cr
Case "Veggie Juice"
txtc.Text = csa + "VEGJC" + csb
DG2cr
Case "Millennium Salad"
txtc.Text = csa + "MILSD" + csb
DG2cr
Case "Garden Salad"
txtc.Text = csa + "GDNSD" + csb
DG2cr
Case "Chicken N Spuds"
txtc.Text = csa + "CKSDS" + csb
DG2cr
Case "Orange Juice"
txtc.Text = csa + "ORNGJ" + csb
DG2cr
Case "Pizza"
txtc.Text = csa + "PIZZA" + csb
DG2cr
Case "Soda"
txtc.Text = csa + "SODA" + csb
DG2cr
Case "Water"
txtc.Text = csa + "WATER" + csb
DG2cr
End Select
End Sub

Private Sub Command1_Click()
End Sub
Private Sub Command3_Click()
On Error GoTo HE
u = "-"Adodc2.RecordSource = txtc.Text
dx
tstb
Command2.Enabled = True
Command4.Enabled = True
Exit Sub

HE:
MsgBox "Select Menu.", vbOKOnly + vbInformation, "Empty file"
DataCombo1.SetFocus
End Sub

Private Sub Command4_Click()On Error GoTo EHa
u = "+"
txtb.Text = "select name,quantity,unit from madewith as mw,ingredients as i where (mw.ingredientid=i.ingredientid)and(itemid = '')"
Adodc2.RecordSource = txtb.Text
dy
tstb
Command2.Enabled = False
Command4.Enabled = False
Exit Sub

EHa:
DataCombo1.SetFocus
Exit Sub
End Sub

Private Sub Command5_Click()
DEcon1.rsingredients.Update
End Sub

Private Sub Command6_Click()
Unload Me
End Sub

Private Sub DataCombo1_Click(Area As Integer)
tst
End Sub

Public Sub dx()
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
If DEcon1.ConRDB.State = adstateclose Then
DEcon1.ConRDB.Open
End If
rs.Open txtc.Text, DEcon1.ConRDB, 1, 3
Set DataGrid2.DataSource = rs
End Sub

Public Sub dy()
Dim rs1 As ADODB.Recordset
Set rs1 = New ADODB.Recordset
If DEcon1.ConRDB.State = adstateclose Then
DEcon1.ConRDB.Open
End If
rs1.Open txtb.Text, DEcon1.ConRDB, 1, 3
Set DataGrid2.DataSource = rs1
End Sub

Public Sub dz()
Dim rs2 As ADODB.Recordset
Set rs2 = New ADODB.Recordset
If DEcon1.ConRDB.State = adstateclose Then
DEcon1.ConRDB.Open
End If
rs2.Open txta.Text, DEcon1.ConRDB, 1, 3
Set DataGrid1.DataSource = rs2
End Sub

Private Sub Form_Load()
qx = False
Command2.Enabled = False
Command4.Enabled = False
End Sub

Wednesday, November 12, 2008

RDBMS

Relational Database Management System
A Relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model as introduced by E. F. Codd. Most popular commercial and open source databases currently in use are based on the relational model.
A short definition of an RDBMS may be a DBMS in which data is stored in the form of tables and the relationship among the data is also stored in the form of tables.

Historical usage of the term
E. F. Codd introduced the term in his seminal paper "A Relational Model of Data for Large Shared Data Banks", published in 1970. In this paper and later papers he defined what he meant by relational. One well-known definition of what constitutes a relational database system is Codd's 12 rules. However, many of the early implementations of the relational model did not conform to all of Codd's rules, so the term gradually came to describe a broader class of database systems. At a minimum, these systems:
presented the data to the user as relations (a presentation in tabular form, i.e. as a collection of tables with each table consisting of a set of rows and columns, can satisfy this property)
provided relational operators to manipulate the data in tabular form
The first systems that were relatively faithful implementations of the relational model were from the University of Michigan; Micro DBMS (1969) and from IBM UK Scientific Centre at Peterlee; IS1 (1970–72) and its followon PRTV (1973–79). The first system sold as an RDBMS was Multics Relational Data Store, first sold in 1978. Others have been Berkeley Ingres QUEL and IBM BS12.
The most popular definition of an RDBMS is a product that presents a view of data as a collection of rows and columns, even if it is not based strictly upon relational theory. By this definition, RDBMS products typically implement some but not all of Codd's 12 rules.
A second, theory-based school of thought argues that if a database does not implement all of Codd's rules (or the current understanding on the relational model, as expressed by Christopher J Date, Hugh Darwen and others), it is not relational. This view, shared by many theorists and other strict adherents to Codd's principles, would disqualify most DBMSs as not relational. For clarification, they often refer to some RDBMSs as Truly-Relational Database Management Systems (TRDBMS), naming others Pseudo-Relational Database Management Systems (PRDBMS).
Almost all commercial relational DBMSes employ SQL as their query language. Alternative query languages have been proposed and implemented, but very few have become commercial products.

Market structure
Given below is a list of top RDBMS vendors in 2006 with figures in millions of United States Dollars published in an IDC study.
Vendor
Global Revenue
Oracle
7,912
IBM
3,483
Microsoft
3,052
Sybase
524
Teradata
457
Others
1,624
Total
16,452
Low adoption costs associated with open-source RDBMS products such as MySQL, PostgreSQL and public domain RDBMS libraries such as SQLite have begun influencing vendor pricing and licensing strategies[citation needed].