The document discusses SQL and how to use it to access and manipulate databases. It covers how to create tables, add and drop columns, and alter tables. It also discusses one-to-many and many-to-many relationships and provides SQL examples to create these relationships.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
3 views3 pages
SQL1
The document discusses SQL and how to use it to access and manipulate databases. It covers how to create tables, add and drop columns, and alter tables. It also discusses one-to-many and many-to-many relationships and provides SQL examples to create these relationships.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3
SQL Structured Query Language
To Access and manipulate Data base
Create table
Create table table_Name (
Column1 datatype, Clo2 datatype, ….. Col datatype ); Data type : Text, int ,date,varchar(255),…
CREATE TABLE employee (
EmpID int primary key, LastName varchar(255), FirstName varchar(255), Age int , Email varchar(255), Address varchar(255), City varchar(255) );
2) Add Bdate column to employee
Alter table employee
Add Bdate date; 3) alter table_ Drop column Alter table employee Drop column City ;
4) alter table – alter /modify col
Alter table employee Alter column age date; Relationship 1 to many Employee Manager Create table manager( ManID int primary key, Location text , Mname text, EMPID int, Foreign key (EMPID) references employee(EmpID)); Many – many Employee Project Create table Project ( Pno int primary key , PName text );