Sybase

SQL CREATE TABLE

SQL CREATE TABLE

Posted on by Fadıl

Tables are the basic structure where data is stored in the database. Given that in most cases, there is no way for the database vendor to know ahead of time …

Continue reading
SQL CREATE VIEW

SQL CREATE VIEW

Posted on by Fadıl

Views can be considered as virtual tables. Generally speaking, a table has a set of definition that sets the structure of the table, and physically stores the …

Continue reading
SQL CREATE INDEX

SQL CREATE INDEX

Posted on by Fadıl

Indexes help us retrieve data from tables quicker. Let’s use an example to illustrate this point: Say we are interested in reading about how to grow peppers in …

Continue reading
SQL ALTER TABLE

SQL ALTER TABLE

Posted on by Fadıl

Once a table is created in the database, there are many occasions where one may wish to change the structure of the table. Typical cases include the following: …

Continue reading
SQL PRIMARY KEY

SQL PRIMARY KEY

Posted on by Fadıl

A primary key is used to uniquely identify each row on a table. It can either be part of the actual record itself, or it can be an artificial field (something …

Continue reading
SQL FOREIGN KEY

SQL FOREIGN KEY

Posted on by Fadıl

A foreign key is a field (or fields) that points to the primary key of another table. The purpose of the foreign key is to ensure referential integrity of the …

Continue reading
SQL DROP TABLE

SQL DROP TABLE

Posted on by Fadıl

Sometimes we may decide that we need to get rid of a table in the database for some reason. In fact, it would be problematic if we cannot do so because this …

Continue reading
SQL TRUNCATE TABLE

SQL TRUNCATE TABLE

Posted on by Fadıl

Sometimes we wish to get rid of all the data in a table. One way of doing this is with DROP TABLE, which we saw in the last section. But what if we wish to …

Continue reading

SQL INSERT INTO

Posted on by Fadıl

In the previous sections, we have seen how to retrieve information from tables. But how do these rows of data get into these tables in the first place? This is …

Continue reading

SQL UPDATE

Posted on by Fadıl

Once we have the information in the table, we might find that there is a need to modify the data. To do so, we can use the UPDATE command. The syntax for this …

Continue reading