A database can be defined as a collection of data, having the descriptions of the activities of organization. Normally, every computer user faces the use of database nowadays, but it may be used unknowingly in most of the cases.
In this tutorial we will highlight on what is sql database and we will also see how we can fetch data from database tables.
Step 1-Very Basic Introduction of Database
A SQL Database is basically a collection of data, having some entities, their relationships and their description.
Step 2- Entities Defined
Entities are basically the real world object that can be distinguished from other objects, For example, entities in a university database may contain:
Step3-Database Relationships Explained
SQL databases contain the relationships among the entities.
Thus, the relationship in the same university database assumed previously may be:
• the student’s enrollment in courses,
• faculty teaching the courses,
Step 4- Database Table Structure
In SQL databases, the data is stored in tables which have columns and rows.
Columns of the table contain the description of the entities such as Id, Name etc. and the Rows of the table contain the data for those entities.
An SQL database can contain more than one table at the same time, with each table identified with a name.
Step 5-Simple Query Structure
Queries are used in SQL to tabulate, display and change the data stored in these tables.
For example, if we want to display the data stored in the table, we can use the SELECT keyword followed by the table name.
This whole query over here can be identified as an SQL statement and fetches all the records from the employee table.
Select * from EMP;
Where, Select is a keyword of SQL, asterisk(*) sign is used to specify the criterion of the filter to be used to fetch data. Next, “from” is another keyword used to specify the location, or the table from where to fetch the data from, which in this case is a table named EMP.
When we will execute the above query, all of the data of EMP table will be displayed on the screen.
And this is all about what is sql database actually.