Simple table creation


In this section we are going to discuss the
Data Definition Language (DDl):Data definition language is used to create alter and the drop the database objects.database obejects are nothing but a table ,views,indexes,etc.
Here we will see how to create a simple table. for creating a table we must have a database like oracle.sql server2008,DB2, and etc..install in owr  system and if you dont have any database  installed in your system then you can try
For this series I have used mysql database which is already installed in wamp server. If to see installation of wamp server then click here.



Take a look at this image here we have given the query to mysql server and my sql server process the request and creted the table in the database.


Syntex:
In this syntax create table is the keyword to create a table in the database Table_name is the name of table to be created in the database ,column_name1 to column_nameN is the name of the column creted in the table in this table creation we must specify the table datatype during table creation it specifiy the type of data and the length of data to be store in the table columns in this table definition we can also specify the default expression to be store in the column .
So before going to create a table decide the data type of the of different data which we will store in database so just have a look on below video and try to create a  table by your self.


I am interested in hearing your feedback, so that I can improve my articles and learning resources for you.

Share

Did you enjoy reading this and found it useful? If so, please share it with your friends:


SQL Data Types


In this section we will learn about datatype.
Data is stored in the form of tables in the database and the data is in differents formats such as name of person ,data of birth of a persion ,etc.So we need to specify the type of data before storing them .so we need to know about different types
Meaning of “data type”
Data type used to indicate the type of information in the database columns .Here is the list of database supported by oracle10g.
visit oracle10gsql server, mysql for more data type supported by oracle10gsql server, mysql.

I am interested in hearing your feedback, so that I can improve my articles and learning resources for you.

Share

Did you enjoy reading this and found it useful? If so, please share it with your friends:

INTRODUCTION TO SQL


Sql is the main language which is used in all the databases to create database and access data from the database.
Here we are going to discuss sql,before getting into sql let find out:
what sql is?
Sql stands for “structure query language ”.sql is non procedural language used to access and manipulate databases.
From sql we can say what do we want from a database. I hope this definition gives you basic idea of sql
next we will see,
Meaning of word “QUERY”?
A “query ” is a question we ask the database .if the asked data is in the database then SQL retrive it.
Here we will see sub language of sql SQL components are sub language in sql
to create ,modify,maintain,and provide security to database.sql  divided into six sub language.
Data Query Language (DQL)   statement used to  retrive a data from a database . Some Example:
  • SELECT:-retrive data from the database.
Data Definition Language (DDL) statements are used to define the database structure or schema .Some Example:
  • CREATE:-to create object in the database.
  • ALTER:-alter the structure of the database.
  • DROP :- delete object from the database.
  • TRUNCATE:-romove all records from a table ,including all space allocated for the records are removed.
  • COMMENT:- add comment to the data dictionary.
  • RENAME:-rename an object.
Data Manipulation Language (DML) statements are used for managing data within schema objects.Some Example:
  • SELECT:-retrive data from the database.
  • INSERT:-insert data into table.
  • UPDATE:-update existing data within a table.
  • DELETE:-delete all records from a table ,the space for the record remain .
  • MERGE: -UPSERT operation (insert or update)
  • CALL:-call a PL/SQL or java subprogram.
  • EXPALIN PLAN:- explain access path to data.
  • LOCK TABLE:- control concurrency.
Data Control Language(DCL) statements are used to control the database like giving permission to access the database to user of database.Some Examples:
  • GRANT:-gives user access privilage to database.
  • REVOKE:-withdraw access privileges given with GRANT command
Transaction Control(TCL) statements are used to manage the changes made by DML statements.it allows user statements to be grouped together into logical transactions.
  • COMMIT:-save work done.
  • SAVE POINT:-identify a point in a transaction to which you can later roll back
  • ROLLBACK :-restore database to original since the last COMMIT
  • SET TRANSACTION: change transaction option like isolation level and what rollback segment
    to use
I am interested in hearing your feedback, so that I can improve my articles and learning resources for you.

Share

Did you enjoy reading this and found it useful? If so, please share it with your friends:

What is RDBMS?


-->
Before we get into RDBMS let get to know 

what is database mangament system DBMS?

Database Management System (DBMS): a database management system is a set of programs in an operating system that create and maintains a database .
  • Store and retrive information from that database.
Ralational Database Management System(RDBMS) :
Maintains data in table and realationship which are created and maintaind across and among data and tables.

Differnce between DBMS and RDBMS:Now a days RDBS replace DBMS.
DBMS:
  • data is stored in a single large table.
  • Whole database is modified.
RDBMS:
  • database is “broken down” into smaller pices.
  • Changes will affect the entire database.

Relational Database Management System :
  • developed by Dr E.F.Coddd in the year 1970.
  • all the latest database product use this data model.
  • Entire database is divided into number of table and they are connected through a “key feild”.
  • Data is stored in the form of table in table,data are stored in rows and columns.
  • “key field” is nothing but a column in a table.by using this column different table are link together.
Relational Database Management System :
a student database consist of different table like “Personal Details” Table,”Mark ” Table,”Departments” Table and etc. we can relate this table through Register Number because all this table have Register Number column. This column is a key field.
I am interested in hearing your feedback, so that I can improve my articles and learning resources for you.

Share

Did you enjoy reading this and found it useful? If so, please share it with your friends:


What is normalization?


  • Normalization is the process of oragnizing data in database effetively.
  • In a database normalization is the process of breaking data down into most basic components.
  • We can use this to remove redundancy in data.
  • Database refinement process that organizes a database; so the data in the database are alwas unambiguous.

Main goal of normalization :
  • to reduces the dublicate entries in the database.
  • Duplicate entries will occupy more memory space and it leads corruption because same information is stored in different location .
Normalization is the process to avoid this problem, in normalization a set of guideline to be followed to avoid this problem.
  • In 1970 ,Edge Codd proposed the first normal form which is represented as 1NF and then he defined normal form two and three.since then several other noramlform have been defined 4NF,5NF and some other normalform are also defined.

First normal form (1NF):
  • first normal form sets the very basic rule for an oranised database.
  • Elliminate duplicate columns from the same table.
  • Create seperate table for each group of releted data and identify each row with a unique column or set of columns(primary key).

Second normal form (2NF):
  • second noramal form further address the concept of removing duplicative data.
  • The table should meet all the requirements of the first normal form and it removes subset of data that apply to multiple rows of the table and place them in separate table.
  • Relationship between these new table are created and their relationship are created the use of foregin keys.

Third normal form (3NF):
  • third noramal form (3NF) goes one large step further over other two normal forms.
  • The database must meet all the requirements of the seconds form and it removes columns that are not dependent upon the primary key.
Fouth normal form (4NF):
  • fourth normal form(4NF) has one additional requirement over the other normal forms.
  • The database in this normal form should meet all the requirements of other three normal forms and forms and a relation is in 4NF if it has no multi-value dependencies.
Related article:
I am interested in hearing your feedback, so that I can improve my articles and learning resources for you.