PROCESSING, PLEASE WAIT
This website uses cookies to grant a better experience for visitors. By browsing, you acknowledge that you read and accept Terms of Use, Privacy and Cookie Policy.
Change Edition (Content might be different) :
MENU SEARCH
Home \ Articles \ Education \ Database \ SQL

What is Database and SQL?

Posted On : Aug 14, 2020

What is Database and SQL?

Database is an important concept that has a huge place in digital world. As the name suggests, it is used to store data and almost every software today uses a database. Your profiles in social media or websites you signed up, your characters in online games, your settings and preferences etc. all of them stored in databases.

Databases are the data storage and management tools that run on a server and keep the data in tables (Relational) or can be used as a stand-alone file (Distributed) such as Microsoft Access and Excel without the need for a server. Apart from these, there are other database types, but the most commonly used one is "Relational Databases". Distributed type databases are not preferred for security and performance reasons.

Each table in relational databases consists of the columns to specify data properties and the rows to represent "new record".  In addition, data connections can be established between the columns in different tables by the features called "Foreign Keys".  You can find a typical database table schema which named as "Products" below.

Products
Product_ID (int)Product_Name (nvarchar)Product_Code (nvarchar)Product_Price (money)Product_Stock (int)
1GlovePCG-211$500
2MaskPCM-192$309

Every single line after header (Product_ID, Product_Name...) line is a data record of "Products" table and each record has a unique number (ID) in the "Product_ID" column. IDs shouldn't be duplicated numbers because of they will be used for reach to related data, otherwise IDs will not enough to reach requested data. IDs usually being set as auto-increment for new records when designing database tables.

Databases are managed by softwares called "Database Management Systems". These softwares provide us to create, edit or delete the databases and tables and also provides list, insert, update or delete the data in the tables with the SQL commands. There are various database management systems available today; the most used ones can be listed as Oracle, MySQL, Microsoft SQL Server, PostgreSQL and MongoDB.

Let's come to the SQL. SQL (Structured Query Language) is a database control language that allows us to send data to the database tables I mentioned above, list these data in a customizable way, or perform operations such as editing (updating) and deleting them. Although it is not actually a programming language, SQL is also considered a programming language in the programming world because of its operational functions.

SQL can be used via developed aplications as well as used directly on databases. For example, when you need to insert, update or delete products from a database like above, you use the application interface that you developed instead writing sql commands one by one in the database management system. Manual SQL operations usually being used when there is no any application interface available or for the commands that can not be handle in application interface. Changing your profile picture, updating your informations, deleting-updating or sharing a new post in your social media accounts are the examples for database operations that you're doing in application interface.

You can find some SQL examples for the "Products" table below. I'll continue my articles that i'll tell more of these commands in detail.

/* Comments write inside /* */ characters. */

/* List all data (*) in table called "Products". */
SELECT * FROM Products

/* Display the product name and product stock of the product which has product id is 2. */
SELECT Product_Name, Product_Stock FROM Products WHERE Product_ID=2

/* Display total (SUM) stock count of all products in "Products" table. */
SELECT SUM(Product_Stock) FROM Products

/* Insert a new record (INSERT INTO) to table called "Products". */
INSERT INTO Products (Product_Name, Product_Code, Product_Price, Product_Stock) VALUES ('Disinfectant', 'PCD-01', 4, 200)

/* Update the stock counts of all products that named as "Mask" and have stock count is under 100 in the "Products" table as 500. */
UPDATE Products SET Product_Stock=500 WHERE Product_Name='Mask' AND Product_Stock < 100

/* Delete all products that have no name (IS NULL) in the "Products" table. */
DELETE FROM Products WHERE Product_Name IS NULL

1,745
5 (0 %)
This may be the post also your loved ones are looking for a long time. Share and inform them.
COMMENTS 0
No comment made yet. Make first via below form.

WRITE COMMENT

Do you have any comments, additional informations or corrections? Right here, write now!
Name
Avatar
Change
Restore DefaultClose (X)

E-Mail (Will not publish, you’ll get notification when your comment is published or replied.)
Website (Optional)
Comment
Your profile will be stored for this browser automatically.
QUICK LINKS


HIGHLIGHTS

LATEST POSTS
MOST LIKED
MOST COMMENTED
NEWS
REVIEWS
DIGITAL MARKETING
DESIGN

HTML
CSS
PHOTOSHOP
PROGRAMMING

C#
JAVASCRIPT/JQUERY
.NET MVC
SQL
FLIGHT SIMULATOR

FLIGHT SIMULATOR X (FSX)
FLIGHT SIMULATOR 2020
NOTES FROM LIFE

FOOTBALL
TRAVEL
SOLUTION CENTER

ALL SOLUTIONS
DESIGN
PROGRAMMING
DATABASE
HARDWARE
MS WINDOWS
MS OFFICE
WEB
DIGITAL MARKETING
INFO

ABOUT ME
CONTACT


Kaan Çamur HELLO, THIS IS KAAN ÇAMUR. I’VE SOME SKILLS ON COMPUTERS AND DIGITAL TECHNOLOGIES. I CREATED MY THIS DIGITAL HOME TO SHARE ALL MY EXPERIENCES WITH YOU. I BELIEVE YOU’LL FIND USEFUL CONTENTS HERE THAT WILL MAKE YOU HAPPY. IF YOU BE HAPPY, I WILL ALSO BE HAPPY. SO, LET ME KNOW YOU’RE HAPPY. :-)
WANT TO BE INFORMED WHEN THE NEW POST HAS ARRIVED?
E-MAIL  :  
OR FOLLOW

Copyright © 2024 Kaan Çamur. All rights reserved.

All materials and posts in this website are protected by copyright laws.

TERMS OF USEPRIVACYCOOKIE POLICYCONTACT