Posts

Showing posts from May, 2021

SQL Database

What is SQL Database? In simple database is collection of objects which stores a specific set of structured data. Let us consider an example of Facebook. It needs to store, manipulate, and present data related to members, their friends, member activities, messages, advertisements, and a lot more. These all information is stored in different tables and collection of these tables are kept at one place.   How to CREATE SQL Database? To create a new database in a SQL server use CREATE DATABASE statement. Syntax: CREATE DATABASE DATABASENAME   How to ALTER existing SQL Database? If we want to change the database name or file locations or collations etc. then we use ALTER DATABASE statement. Syntax: ALTER DATABASE { database_name   | CURRENT }   {    MODIFY NAME = new_database_name      | COLLATE collation_name     | < file_and_filegroup_options >     | SET < option_spec ...

SQL Database

What is SQL Database? In simple database is collection of objects which stores a specific set of structured data. Let us consider an example of Facebook. It needs to store, manipulate, and present data related to members, their friends, member activities, messages, advertisements, and a lot more. These all information is stored in different tables and collection of these tables are kept at one place.   How to CREATE SQL Database? To create a new database in a SQL server use CREATE DATABASE statement. Syntax: CREATE DATABASE DATABASENAME   How to ALTER existing SQL Database? If we want to change the database name or file locations or collations etc. then we use ALTER DATABASE statement. Syntax: ALTER DATABASE { database_name   | CURRENT }   {    MODIFY NAME = new_database_name      | COLLATE collation_name     | < file_and_filegroup_options >     | SET < option_spec ...

SQL Datatypes

Data Types Data types are used to represent the nature of the data that can be stored in the database table. For example, in a particular column of a table, if we want to store a string type of data then we will have to declare a string data type of this column. Data types mainly classified into three categories for every database. String Data types Numeric Data types Date and time Data types Unicode Character String Data types Binary Data type Miscellaneous Data types SQL Numeric Data Types Datatype From To bit 0 1 tinyint 0 255 smallint -32,768 32,767 int -2,147,483,648 2,147,483,647 bigint -9,223,372,036, 854,775,808 9,223,372,036, 854,775,807 decimal 1E+38 10^38 -1 numeric 1E+38 10^38 -1 float -1.79E + 308 ...

SQL Architecture

Image
   SQL Architecture When you are executing an SQL command for any RDBMS , the system determines the best way to carry out your request and SQL engine figures out how to interpret the task. There are various components included in this process. Query Dispatcher Optimization Engines Classic Query Engine SQL Query Engine, etc.   A classic query engine handles all the non-SQL queries, but a SQL query engine won't handle logical files.   A simple diagram showing the SQL Architecture −   Query Language Processor In a relational database system the query processor is the module responsible for executing database queries. The query processor receives input queries in the form of SQL text, parses and optimizes them, and completes their execution by employing specific data access methods and database operator implementations. The query processor communicates with the storage engine, which reads and writes data from the disk, manages records, controls concurrency,...

SQL Introduction

What is SQL? SQL is Structured Query Language , which is a computer language for storing, manipulating and retrieving data stored in a relational database.  SQL is the standard language for Relational Database System . SQL became a standard of the American National Standards Institute ( ANSI ) in 1986, and of the International Organization for Standardization ( ISO ) in 1987   Why is SQL used? It is used to manage and organize data in all sorts of systems in which various data relationships exist.   What does SQL do? SQL can execute queries against a database SQL can retrieve data from a database SQL can insert records in a database SQL can update records in a database SQL can delete records from a database SQL can create new databases SQL can create new tables in a database SQL can create stored procedures in a database SQL can create views in a database SQL can set permissions on tables, procedures, and views   What SQL cannot do? If we con...