Sunday, February 15, 2009
ass in THEODBS
SELECT DISTINCT it.name as Item i.name as Ingredients
From madewith as mw, ingredients as i, items as it
Where (mw.itemid = it.itemid)
And (mw.ingredientid = i.ingredientid)
And ((quantity * 3) > inventory);
Sunday, February 1, 2009
assignment
Private Sub Command1_Click()
Dim rsu As ADODB.Recordset
Set rsu = New ADODB.Recordset
Dim li As ListItems
If ListView1.ListItems.Count = 0 Then
MsgBox "Please insert a Ingredients.", vbInformation
ListView2.SetFocus
Exit Sub
End If
If Label1.Caption = "" Then
MsgBox "Please press click.", vbInformation
Command4.SetFocus
Exit Sub
End If
If Len(Combo1) = 0 Then
MsgBox "Please insert a Item", vbInformation
ListView2.SetFocus
Exit Sub
End If
rsu.Open "select * from madewith", DataEnvironment1.Connection1, 1, 3
X = Val(ListView1.ListItems(ListView1.SelectedItem.Index).SubItems(4))
W = Val(ListView1.ListItems(ListView1.SelectedItem.Index).SubItems(2))
Do Until ListView1.ListItems.Count = 0
rsu.MoveNext
rsu.Fields("itemid") = Label1.Caption
rsu.Fields("ingredientid") = W
rsu.Fields("quantity") = X
rsu.Update
rsu.MoveNext
ListView1.SetFocus
ListView1.ListItems.Remove ListView1.SelectedItem.Index
Loop
rsu.Close
MsgBox "Save!", vbInformation, "Recipe Setup"
Text1.Enabled = True
Text1.Text = ""
Combo1.ListIndex = -1
Combo1.Enabled = True
Combo1.SetFocus
Command1.Enabled = True
Command3.Enabled = True
Label1.Caption = ""
ListView1.ListItems.Clear
End Sub
Private Sub Command2_Click()
Text1.Enabled = True
Text1.Text = ""
Combo1.ListIndex = -1
Combo1.Enabled = True
Combo1.SetFocus
Command1.Enabled = True
Command3.Enabled = True
ListView1.ListItems.Clear
End Sub
Private Sub Command3_Click()
If ListView1.ListItems.Count = 0 Then
MsgBox "There is no Item(s) in the list.", vbInformation, "System Info"
Else
ListView1.ListItems.Remove ListView1.SelectedItem.Index
End If
End Sub
Private Sub Command4_Click()
Dim q As String
Dim rscustoms As New ADODB.Recordset
If Combo1.ListCount > 0 Or Combo1.Text > "" Then
q = Combo1.Text
rscustoms.Open "select * from items where name='" & q & "'", DataEnvironment1.Connection1, 1, 3
If rscustoms.RecordCount > 0 Then
Label1.Caption = rscustoms.Fields("itemid")
End If
End If
End Sub
Private Sub Command5_Click()
End Sub
Private Sub Form_Load()
Dim rs As New ADODB.Recordset
Dim r As New ADODB.Recordset
Dim s As New ADODB.Recordset
If DataEnvironment1.Connection1.State = adstateclose Then
DataEnvironment1.Connection1.Open
End If
rs.Open "select* from ingredients ", DataEnvironment1.Connection1, 1, 3
If rs.RecordCount > 0 Then
Do While Not rs.EOF
ListView2.ListItems.Add , , Val(Text)
ListView2.ListItems(ListView2.ListItems.Count).SubItems(1) = rs.Fields("name")
ListView2.ListItems(ListView2.ListItems.Count).SubItems(2) = rs.Fields("ingredientid")
rs.MoveNext
Loop
End If
End Sub
Private Sub Label3_Click()
End Sub
Private Sub ListView1_BeforeLabelEdit(Cancel As Integer)
Cancel = 1
End Sub
Private Sub ListView2_BeforeLabelEdit(Cancel As Integer)
Cancel = 1
End Sub
Private Sub ListView2_DblClick()
Dim li As ListItem
Dim X As String
Dim rsc As New ADODB.Recordset
Dim Y As String
If ListView2.ListItems.Count <> 0 Then
Y = ListView2.SelectedItem.Text
rsc.Open "select * from ingredients where name='" & Y & "'", DataEnvironment1.Connection1, 1, 3
If rsc.RecordCount > 0 Then
With ListView3.ListItems
lv = ListItem
Set lv = .Add(, , Val(Text2))
lv.SubItems(2) = rsc.Fields("ingredientid")
lv.SubItems(3) = ListView2.SelectedItem.Text
End With
End If
End If
If Text1.Text = "" Then
MsgBox "Please type the quantity!", vbExclamation, "System Info"
Text1 = ""
Text1.SetFocus
Else
With ListView1.ListItems
z = Text1.Text
Set li = .Add(, , Val(Text2))
li.SubItems(1) = ListView2.SelectedItem.SubItems(1)
li.SubItems(2) = z
li.SubItems(3) = ListView2.SelectedItem.Text
End With
Text1.Text = ""
Text1.SetFocus
End If
End Sub
Private Sub ListView2_KeyPress(KeyAscii As Integer)
Dim li As ListItem
If Text2.Text = "" Then
MsgBox "Please type the quantity!", vbExclamation, "System Info"
Text2.SetFocus
Else
With ListView1.ListItems
Set li = .Add(, , Val(Text1))
li.SubItems(1) = ListView2.SelectedItem.SubItems(1)
li.SubItems(3) = ListView2.SelectedItem.Text
End With
Text1.Text = ""
Text1.SetFocus
End If
End Sub
Private Sub ListView3_BeforeLabelEdit(Cancel As Integer)
Cancel = 1
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command1.SetFocus
End If
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 And KeyAscii <> 46 Then
Chr (KeyAscii)
Else
KeyAscii = 0
End If
End Sub
Sunday, November 16, 2008
About 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
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.