Database Tables

Every RDBMS, Relational Database Management System stores data in database object called table. Database consists of different tables which have different rows and columns. The rows on a table contains records of the database table.

  • Table is the database object used to store data
  • Database consists of one or more tables
  • The rows of the table are known as records

Database Table “Members”

Id FirstName LastName Email City Phone
1 Gilbert Duncan [email protected] Newark 973-600-3300
2 Elvis Daniels [email protected] Piscataway 862-600-3050
3 Michael Green [email protected] Detroit 732-500-5050

The above “Members” table contains 3 rows of records and 6 columns. Each row contains a record for each member and the columns contain information about the Id, LastName, FirstName, Email, City and Phone.

SQL Statements

SQL statements can be divided into two parts namely the Data Manipulation Language, DML and the Data Definition Language, DDL.

The DML part consists on the following SQL commands:

  • SELECT to extract data from a database
  • UPDATE to update data in a database
  • DELETE to delete data from a database
  • INSERT INTO to insert new data into a database

The DDL part consists of the following SQL commands:

  • CREATE DATABASE to create a new database
  • ALTER DATABASE to modify a database
  • CREATE TABLE to create a new table
  • ALTER TABLE to modify a table
  • DROP TABLE to delete a table
  • CREATE INDEX to create an index or search key
  • DROP INDEX to delete an index or search key

SQL Statements are not case sensitive and multiple SQL statements are separated with semicolon when executing multiple SQL statements at once.

  • SQL is not case sensitive
  • Multiple SQL statements are separated with semicolon
  • Some database systems require the use semicolon at the end of single or each SQL statement