SQL- LAB-2 || Create database, Create Table, Insert values into Table || SQL Lab Manual-2


INTRODUCTION TO SQL
  • Pronounced as SEQUEL: Structured English QUERY Language.
  • Designed and developed by IBM, Implemented by Oracle. 
  • Accepted by both ANSI + ISO as Standard Query Language for any RDBMS.
  • Supports all the three sublanguages of DBMS: DDL, DML, DCL, TCL, etc
CREATE DATABASE 
  • Create database "DatabaseName "            like Create database student_info
This command will create a database into your application just refresh the system that the database will display on your system.

CREATE A TABLE / RELATION 
  • SYNTAX 
  • CREATE TABLE table_name 
  • ( column1 datatype,
  •   column2 datatype,
      column3 datatype  )
Creates a new table, a view of a table, or another object in the database, When we need to store the new amount of data so we should have to create a new table to store new records 

SQL QUERY TO CREATE A TABLE 
  • CREATE TABLE Student_recoed (
        PersonID int,
        LastName varchar(255),
        FirstName varchar(255),
  •     Class varcahr(255),
        Address varchar(255),
        City varchar(255)
    );
  OUTPUT
PersonIDLastNameFirstNameCLASS          AddressCity
     
 INSERT INTO TABLE 

  • SYNTAX
  • INSERT INTO table_name VALUES (value1, value2, value3, ...);

SQL QUERY TO INSERT RECORDS
  • INSERT INTO VALUES (01 'SHAIKH''KHALID''GRADUATE ''NF''TS');
OUTPUT
PersonIDLastNameFirstNameCLASS     AddressCity
 1SHAIKH KHALID  GRADUATE   NF TS




Post a Comment

0 Comments