Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts

Tuesday 17 April 2018

Create Table

Syntax :-

CREATE TABLE table name
(
Column_name1 data-type (size),
Column_name2 data-type (size),
Column_name3 data-type (size)
);

Ex :-
CREATE TABLE my_tab
(
name varchar (30),
roll int (4),
address varchar (100)
);


Another way to create a table

Syntax :-
CREATE TABLE table name
(
Column_name1 data-type (size) [constraints],
Column_name2 data-type (size) [constraints],
Column_name3 data-type (size) [constraints]
);

Ex :-
CREATE TABLE my_tab
(
name varchar (30) NOT NULL,
roll int (4) PRIMARY KEY,
address varchar (100)
);

Guidelines for creation of Table

 1. Table name should start with an alphabet.
 2. In table name, blank spaces and single quotes are not allowed.
 3. Reserve words of that RDBMS/DBMS cannot be used as table name.
 4. Proper data type and size should be specified.
 5. Unique column name should be specified.

 

Sunday 15 April 2018

Create Database

It is used to create database.

Syntax:- CREATE DATABASE database_name;
Ex:- CREATE DATABASE my_db;

Guide for creation of database:-
 Name should start with an alphabet
Blank space and single quotes are not allowed
Reserve words of that RDBMS/DBMS can not be used as database name




Use a database

 This is used to tell your RDBMS/DBMS that you want to use this database.

Syntax:- USE database_name;
Ex:- USE my_db;



Wednesday 21 March 2018

What is database?

A database is integrated collection of related information along with the details so that it is available to the several user for the different application.
                                        This is a database

Table/Entity
  Table is the structure inside database that contains data organized in columns and rows.




Column/Field/Feature/Attributes
  The name of each column in a table is used to interpret its meaning and is called an attributes.
 

Row/Records/Tuple
  Each row in a table represents a record and is called tuple.

Example:-
     Rahul , 101 , Delhi , rahul@gmail.com
     Sona , 102 , Kolkata , sona@gmail.com
     Sumit , 103 , sumit@gmail.com , Ranchi
     Sam , sam@gmail.com , Noida , 104
                This is a database list of four person, now its create in table form

Database Management System (DBMS)
  DBMS is the software system that allows the access to the data in the database.


Relational Database Management System (RDBMS)
 RDBMS avoided the navigation model as in old DBMS and introduced Relational model. The relational model has relationship between tables using primary keys, foreign keys and indexes. thus the fetching and storing  of data become faster than the old Navigation model.RDBMS is useful to efficiently manage  vast amount of data and is used in large business application.
  Ex:- SQL Server , Oracle , MySQL , MariaDB , SQLite.

Structural Query Language (SQL)
  It is commonly used with all relational database for data definition and manipulation.

Feature of SQL :-
  It is a non procedural language.
  It is an English-like language.
  It can process a single record as well as set of records at a time.
  All SQL statement define what is to be done rather than how it is to be done.
  SQL has facilities for defining database views , security , transaction etc. 

Popular Posts

Categories

AI (27) Android (24) AngularJS (1) Assembly Language (2) aws (17) Azure (7) BI (10) book (4) Books (117) C (77) C# (12) C++ (82) Course (62) Coursera (179) coursewra (1) Cybersecurity (22) data management (11) Data Science (95) Data Strucures (6) Deep Learning (9) Django (6) Downloads (3) edx (2) Engineering (14) Excel (13) Factorial (1) Finance (6) flutter (1) FPL (17) Google (19) Hadoop (3) HTML&CSS (46) IBM (25) IoT (1) IS (25) Java (92) Leet Code (4) Machine Learning (44) Meta (18) MICHIGAN (5) microsoft (3) Pandas (3) PHP (20) Projects (29) Python (753) Python Coding Challenge (226) Questions (2) R (70) React (6) Scripting (1) security (3) Selenium Webdriver (2) Software (17) SQL (40) UX Research (1) web application (8)

Followers

Person climbing a staircase. Learn Data Science from Scratch: online program with 21 courses