In DDL we will know more about tables, which is the object of a database that is responsible for storing the data. Other than this we will also get to know about establishing relationship between tables and also how to alter and drop tables.
It is an object where we can store data. The data inside a table is arranged in a row and column format. Thus the components of a table are- records(rows), fields(columns) and data(values in each cell-row and column intersection). Each field should have a name or heading. Each row of information is called as record.
In the above table we can see that data is arranged in row and column format. The first row contains the field names(Regd.no,name,address,gender). The second row onwards are the records. R103,sushree panigrahi, Bhubaneswar, Female are values.
SQL TABLE structure:
A table can be created at any time while we are using the database. While creating a table, the size occupied by it is defined by the amount of space that is allocated to the database. In other words the user does not have to specify the table size. A table structure helps us to know more about a specific table, like:
SQL TABLE naming rules:
A table name
It is advisable to give meaningful names for tables and other objects . in Oracle names are case insensitive. For example STUDENT is treated as the same name as student or Student.
How to create a SQL TABLE:
The CREATE TABLE statement helps us to create a table. To create a table a user must have the create table privilege. The syntax of create table statement is:
SQL CREATE TABLE Example:
The above statement create an employee table having four attributes named Emp-id, Name,, Designation. If we want to confirm the creation of the table , then the describe statement can be used.
Syntax of describe statement:
Describe table name;
For example, describe employee;
After executing this statement it will display
The employee table can be filled with data with the INSERT INTO statement.